------- 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 = .skipL0341-sfx_explosion 100 28000 ???? 101 28000 ???? 00 30 sfx_plainlaser_length = .skipL0340-sfx_plainlaser 102 28000 ???? 103 28000 ???? 00 54 sfx_pulsecannon_length = .skipL0339-sfx_pulsecannon 104 28000 ???? 105 28000 ???? 00 36 sfx_bling_length = .skipL0338-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 ???? 01 77 enemy01_Slowdown = var55 237 28000 ???? 238 28000 ???? 01 9c mob_X = var92 239 28000 ???? 01 9e mob_Y = var94 240 28000 ???? 01 a0 mob_speedX = var96 241 28000 ???? 01 a2 mob_speedY = var98 242 28000 ???? 01 73 temp_speedY = temp_YSu 243 28000 ???? 01 74 temp_YSf = var52 244 28000 ???? 245 28000 ???? 01 73 temp_YSu = var51 246 28000 ???? 247 28000 ???? 01 71 temp_speedX = temp_XSu 248 28000 ???? 01 72 temp_XSf = var50 249 28000 ???? 250 28000 ???? 01 71 temp_XSu = var49 251 28000 ???? 252 28000 ???? 01 6f total_speedY = total_YSu 253 28000 ???? 01 70 total_YSf = var48 254 28000 ???? 255 28000 ???? 01 6f total_YSu = var47 256 28000 ???? 257 28000 ???? 01 6d total_speedX = total_XSu 258 28000 ???? 01 6e total_XSf = var46 259 28000 ???? 260 28000 ???? 01 6d total_XSu = var45 261 28000 ???? 262 28000 ???? 22 50 enemy_shotSYf = $2250 263 28000 ???? 264 28000 ???? 22 40 enemy_shotSXf = $2240 265 28000 ???? 266 28000 ???? 22 30 enemy_shotSY = $2230 267 28000 ???? 268 28000 ???? 22 20 enemy_shotSX = $2220 269 28000 ???? 270 28000 ???? 22 10 enemy_shotYf = $2210 271 28000 ???? 272 28000 ???? 22 00 enemy_shotXf = $2200 273 28000 ???? 274 28000 ???? 01 6c enemy_shotDirection = var44 275 28000 ???? 276 28000 ???? 01 6b timer = var43 277 28000 ???? 278 28000 ???? 01 6a isDead_flag = var42 279 28000 ???? 280 28000 ???? 01 69 continue_flag = var41 281 28000 ???? 282 28000 ???? 01 68 twinlaser_Slowdown = var40 283 28000 ???? 284 28000 ???? 01 67 twinlaser_flag = var39 285 28000 ???? 286 28000 ???? 01 66 twinlaserY = var38 287 28000 ???? 288 28000 ???? 01 65 twinlaserX = var37 289 28000 ???? 290 28000 ???? 01 64 lives = var36 291 28000 ???? 292 28000 ???? 01 63 explosion_aniframe = var35 293 28000 ???? 294 28000 ???? 01 62 extra_shipFlag = var34 295 28000 ???? 296 28000 ???? 01 61 extra_shipY = var33 297 28000 ???? 298 28000 ???? 01 60 extra_shipX = var32 299 28000 ???? 300 28000 ???? 01 5f gameover_flag = var31 301 28000 ???? 302 28000 ???? 01 5e enemy01_speed = var30 303 28000 ???? 304 28000 ???? 01 5d rMovement6 = var29 305 28000 ???? 306 28000 ???? 01 5c rMovement5 = var28 307 28000 ???? 308 28000 ???? 01 5b rMovement4 = var27 309 28000 ???? 310 28000 ???? 01 5a rMovement3 = var26 311 28000 ???? 312 28000 ???? 01 59 enemy01_Flag = var25 313 28000 ???? 314 28000 ???? 01 58 enemy01_Y = var24 315 28000 ???? 316 28000 ???? 01 57 enemy01_X = var23 317 28000 ???? 318 28000 ???? 01 56 enemy_shotSlowdown = var22 319 28000 ???? 320 28000 ???? 01 55 bulletSlowdown = var21 321 28000 ???? 322 28000 ???? 01 54 power_upSlowdown = var20 323 28000 ???? 324 28000 ???? 01 53 rMovement2 = var19 325 28000 ???? 326 28000 ???? 01 52 power_upFlag = var18 327 28000 ???? 328 28000 ???? 01 51 power_upY = var17 329 28000 ???? 330 28000 ???? 01 50 power_upX = var16 331 28000 ???? 332 28000 ???? 01 4f rDirection = var15 333 28000 ???? 334 28000 ???? 01 4e rMovement1 = var14 335 28000 ???? 336 28000 ???? 01 4d playerFlag = var13 337 28000 ???? 338 28000 ???? 01 4c enemy_shotFlag = var12 339 28000 ???? 340 28000 ???? 01 4b enemy_shotY = var11 341 28000 ???? 342 28000 ???? 01 4a enemy_shotX = var10 343 28000 ???? 344 28000 ???? 01 49 bulletY = var9 345 28000 ???? 346 28000 ???? 01 48 bulletX = var8 347 28000 ???? 348 28000 ???? 01 47 joyposright = var7 349 28000 ???? 350 28000 ???? 01 46 joyposleft = var6 351 28000 ???? 352 28000 ???? 01 45 joyposdown = var5 353 28000 ???? 354 28000 ???? 01 44 joyposup = var4 355 28000 ???? 356 28000 ???? 01 43 fire_debounce = var3 357 28000 ???? 358 28000 ???? 01 42 playerY = var2 359 28000 ???? 360 28000 ???? 01 41 playerX = var1 361 28000 ???? 362 28000 ???? 01 40 frameCounter = var0 363 28000 ???? 364 28000 ???? 00 01 collisionwrap = 1 365 28000 ???? 00 01 NTSC = 1 366 28000 ???? 00 c0 SCREENHEIGHT = 192 367 28000 ???? 00 01 CHECKOVERWRITE = 1 368 28000 ???? 00 08 ZONEHEIGHT = 8 369 28000 ???? 00 01 SGRAM = 1 370 28000 ???? 00 08 bankswitchmode = 8 371 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 ifnconst CANARYOFF 538 U01c1 00 canary DS 1 ; $1ED 539 U01c2 endif 540 U01c2 541 U01c2 - ifnconst bankswitchmode 542 U01c2 - echo " stack allowance:",[($1FF - .)/2]d,"nested subroutines." 543 U01c2 else stack allowance: 20 nested subroutines. 544 U01c2 echo " stack allowance:",[($1FF - .)/3]d,"nested subroutines." 545 U01c2 endif 546 U01c2 ifnconst CANARYOFF the canary is situated at: $1c1 547 U01c2 echo " the canary is situated at:",[canary] 548 U01c2 - else 549 U01c2 - echo " the canary is disabled." 550 U01c2 endif 551 U01c2 552 U01c2 ; $1EE - $1FF reserved for stack 553 U01c2 554 28000 ???? SEG "GAME" 555 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 = .skipL0341-sfx_explosion 100 28000 ???? 101 28000 ???? 00 30 sfx_plainlaser_length = .skipL0340-sfx_plainlaser 102 28000 ???? 103 28000 ???? 00 54 sfx_pulsecannon_length = .skipL0339-sfx_pulsecannon 104 28000 ???? 105 28000 ???? 00 36 sfx_bling_length = .skipL0338-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 ???? 01 77 enemy01_Slowdown = var55 237 28000 ???? 238 28000 ???? 01 9c mob_X = var92 239 28000 ???? 01 9e mob_Y = var94 240 28000 ???? 01 a0 mob_speedX = var96 241 28000 ???? 01 a2 mob_speedY = var98 242 28000 ???? 01 73 temp_speedY = temp_YSu 243 28000 ???? 01 74 temp_YSf = var52 244 28000 ???? 245 28000 ???? 01 73 temp_YSu = var51 246 28000 ???? 247 28000 ???? 01 71 temp_speedX = temp_XSu 248 28000 ???? 01 72 temp_XSf = var50 249 28000 ???? 250 28000 ???? 01 71 temp_XSu = var49 251 28000 ???? 252 28000 ???? 01 6f total_speedY = total_YSu 253 28000 ???? 01 70 total_YSf = var48 254 28000 ???? 255 28000 ???? 01 6f total_YSu = var47 256 28000 ???? 257 28000 ???? 01 6d total_speedX = total_XSu 258 28000 ???? 01 6e total_XSf = var46 259 28000 ???? 260 28000 ???? 01 6d total_XSu = var45 261 28000 ???? 262 28000 ???? 22 50 enemy_shotSYf = $2250 263 28000 ???? 264 28000 ???? 22 40 enemy_shotSXf = $2240 265 28000 ???? 266 28000 ???? 22 30 enemy_shotSY = $2230 267 28000 ???? 268 28000 ???? 22 20 enemy_shotSX = $2220 269 28000 ???? 270 28000 ???? 22 10 enemy_shotYf = $2210 271 28000 ???? 272 28000 ???? 22 00 enemy_shotXf = $2200 273 28000 ???? 274 28000 ???? 01 6c enemy_shotDirection = var44 275 28000 ???? 276 28000 ???? 01 6b timer = var43 277 28000 ???? 278 28000 ???? 01 6a isDead_flag = var42 279 28000 ???? 280 28000 ???? 01 69 continue_flag = var41 281 28000 ???? 282 28000 ???? 01 68 twinlaser_Slowdown = var40 283 28000 ???? 284 28000 ???? 01 67 twinlaser_flag = var39 285 28000 ???? 286 28000 ???? 01 66 twinlaserY = var38 287 28000 ???? 288 28000 ???? 01 65 twinlaserX = var37 289 28000 ???? 290 28000 ???? 01 64 lives = var36 291 28000 ???? 292 28000 ???? 01 63 explosion_aniframe = var35 293 28000 ???? 294 28000 ???? 01 62 extra_shipFlag = var34 295 28000 ???? 296 28000 ???? 01 61 extra_shipY = var33 297 28000 ???? 298 28000 ???? 01 60 extra_shipX = var32 299 28000 ???? 300 28000 ???? 01 5f gameover_flag = var31 301 28000 ???? 302 28000 ???? 01 5e enemy01_speed = var30 303 28000 ???? 304 28000 ???? 01 5d rMovement6 = var29 305 28000 ???? 306 28000 ???? 01 5c rMovement5 = var28 307 28000 ???? 308 28000 ???? 01 5b rMovement4 = var27 309 28000 ???? 310 28000 ???? 01 5a rMovement3 = var26 311 28000 ???? 312 28000 ???? 01 59 enemy01_Flag = var25 313 28000 ???? 314 28000 ???? 01 58 enemy01_Y = var24 315 28000 ???? 316 28000 ???? 01 57 enemy01_X = var23 317 28000 ???? 318 28000 ???? 01 56 enemy_shotSlowdown = var22 319 28000 ???? 320 28000 ???? 01 55 bulletSlowdown = var21 321 28000 ???? 322 28000 ???? 01 54 power_upSlowdown = var20 323 28000 ???? 324 28000 ???? 01 53 rMovement2 = var19 325 28000 ???? 326 28000 ???? 01 52 power_upFlag = var18 327 28000 ???? 328 28000 ???? 01 51 power_upY = var17 329 28000 ???? 330 28000 ???? 01 50 power_upX = var16 331 28000 ???? 332 28000 ???? 01 4f rDirection = var15 333 28000 ???? 334 28000 ???? 01 4e rMovement1 = var14 335 28000 ???? 336 28000 ???? 01 4d playerFlag = var13 337 28000 ???? 338 28000 ???? 01 4c enemy_shotFlag = var12 339 28000 ???? 340 28000 ???? 01 4b enemy_shotY = var11 341 28000 ???? 342 28000 ???? 01 4a enemy_shotX = var10 343 28000 ???? 344 28000 ???? 01 49 bulletY = var9 345 28000 ???? 346 28000 ???? 01 48 bulletX = var8 347 28000 ???? 348 28000 ???? 01 47 joyposright = var7 349 28000 ???? 350 28000 ???? 01 46 joyposleft = var6 351 28000 ???? 352 28000 ???? 01 45 joyposdown = var5 353 28000 ???? 354 28000 ???? 01 44 joyposup = var4 355 28000 ???? 356 28000 ???? 01 43 fire_debounce = var3 357 28000 ???? 358 28000 ???? 01 42 playerY = var2 359 28000 ???? 360 28000 ???? 01 41 playerX = var1 361 28000 ???? 362 28000 ???? 01 40 frameCounter = var0 363 28000 ???? 364 28000 ???? 00 01 collisionwrap = 1 365 28000 ???? 00 01 NTSC = 1 366 28000 ???? 00 c0 SCREENHEIGHT = 192 367 28000 ???? 00 01 CHECKOVERWRITE = 1 368 28000 ???? 00 08 ZONEHEIGHT = 8 369 28000 ???? 00 01 SGRAM = 1 370 28000 ???? 00 08 bankswitchmode = 8 371 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 ROM16K 574 28000 ???? - ;BEADHEADER = 1 575 28000 ???? endif 576 28000 ???? - ifconst ROM32K 577 28000 ???? -BEADHEADER = 1 578 28000 ???? endif 579 28000 ???? - ifconst ROM48K 580 28000 ???? -BEADHEADER = 1 581 28000 ???? endif 582 28000 ???? 583 28000 ???? - ifconst BEADHEADER 584 28000 ???? -BEADHARDWARE SET 0 585 28000 ???? - ifconst ROM16K 586 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD16K) 587 28000 ???? - endif 588 28000 ???? - ifconst ROM32K 589 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD32K) 590 28000 ???? - endif 591 28000 ???? - ifconst ROM48K 592 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD48K) 593 28000 ???? - endif 594 28000 ???? - ifconst pokeysupport 595 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDPOKEY) 596 28000 ???? - endif 597 28000 ???? - ifconst HSSUPPORT 598 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDHSC) 599 28000 ???? - endif 600 28000 ???? endif 601 28000 ???? 602 28000 ???? ;start address of cart... 603 28000 ???? - ifconst ROM48K 604 28000 ???? - ORG $4000,0 605 28000 ???? - ifconst BEADHEADER 606 28000 ???? - .byte $BE,$AD,BEADHARDWARE 607 28000 ???? - ifconst GAMEDESCRIPTIONSET 608 28000 ???? - CLC 609 28000 ???? - BCC _SKIPDESCRIPTION 610 28000 ???? - .byte GAMEDESCRIPTION,0 611 28000 ???? -_SKIPDESCRIPTION 612 28000 ???? - endif 613 28000 ???? - jmp ($FFFC) 614 28000 ???? - endif 615 28000 ???? else 616 28000 ???? ifconst bankswitchmode 617 28000 ???? - ifconst ROMAT4K 618 28000 ???? - ORG $4000,0 619 28000 ???? - RORG $4000 620 28000 ???? else 621 8000 ORG $8000,0 622 8000 RORG $8000 623 8000 endif 624 8000 - else ; not bankswitchmode 625 8000 - ifconst ROM16K 626 8000 - ORG $C000,0 627 8000 - ifconst BEADHEADER 628 8000 - .byte $BE,$AD,BEADHARDWARE 629 8000 - ifconst GAMEDESCRIPTION 630 8000 - CLC 631 8000 - BCC _SKIPDESCRIPTION 632 8000 - .byte GAMEDESCRIPTION,0 633 8000 -_SKIPDESCRIPTION 634 8000 - endif 635 8000 - jmp ($FFFC) 636 8000 - endif 637 8000 - else 638 8000 - ifconst ROM8K 639 8000 - ORG $E000,0 640 8000 - else 641 8000 - ORG $8000,0 642 8000 - ifconst BEADHEADER 643 8000 - .byte $BE,$AD,BEADHARDWARE 644 8000 - ifconst GAMEDESCRIPTION 645 8000 - CLC 646 8000 - BCC _SKIPDESCRIPTION 647 8000 - .byte GAMEDESCRIPTION,0 648 8000 -_SKIPDESCRIPTION 649 8000 - endif 650 8000 - jmp ($FFFC) 651 8000 - endif 652 8000 - endif 653 8000 - endif 654 8000 endif 655 8000 endif 656 8000 657 8000 ;7800basic v0.17 Feb 14 2021 21:38:55 658 8000 SPACEOVERFLOW SET 0 659 8000 game 660 8000 . 661 8000 ;; 662 8000 663 8000 . 664 8000 ;; 665 8000 666 8000 .L00 ;; set romsize 128kRAM 667 8000 668 8000 .L01 ;; set zoneheight 8 669 8000 670 8000 .L02 ;; set zoneprotection on 671 8000 672 8000 .L03 ;; set tallsprite on 673 8000 674 8000 .L04 ;; set screenheight 192 675 8000 676 8000 .L05 ;; set basepath gfx 677 8000 678 8000 .L06 ;; set tv ntsc 679 8000 680 8000 .L07 ;; set collisionwrap on 681 8000 682 8000 .L08 ;; set doublewide off 683 8000 684 8000 .L09 ;; displaymode 160A 685 8000 686 8000 a9 40 lda #%01000000 ;Enable DMA, mode=160x2/160x4 687 8002 85 3c sta CTRL 688 8004 689 8004 8d 07 21 sta sCTRL 690 8007 691 8007 . 692 8007 ;; 693 8007 694 8007 .L010 ;; dim frameCounter = var0 695 8007 696 8007 .L011 ;; dim playerX = var1 697 8007 698 8007 .L012 ;; dim playerY = var2 699 8007 700 8007 .L013 ;; dim fire_debounce = var3 701 8007 702 8007 .L014 ;; dim joyposup = var4 703 8007 704 8007 .L015 ;; dim joyposdown = var5 705 8007 706 8007 .L016 ;; dim joyposleft = var6 707 8007 708 8007 .L017 ;; dim joyposright = var7 709 8007 710 8007 .L018 ;; dim bulletX = var8 711 8007 712 8007 .L019 ;; dim bulletY = var9 713 8007 714 8007 .L020 ;; dim enemy_shotX = var10 715 8007 716 8007 .L021 ;; dim enemy_shotY = var11 717 8007 718 8007 .L022 ;; dim enemy_shotFlag = var12 719 8007 720 8007 .L023 ;; dim playerFlag = var13 721 8007 722 8007 .L024 ;; dim rMovement1 = var14 723 8007 724 8007 .L025 ;; dim rDirection = var15 725 8007 726 8007 .L026 ;; dim power_upX = var16 727 8007 728 8007 .L027 ;; dim power_upY = var17 729 8007 730 8007 .L028 ;; dim power_upFlag = var18 731 8007 732 8007 .L029 ;; dim rMovement2 = var19 733 8007 734 8007 .L030 ;; dim power_upSlowdown = var20 735 8007 736 8007 .L031 ;; dim bulletSlowdown = var21 737 8007 738 8007 .L032 ;; dim enemy_shotSlowdown = var22 739 8007 740 8007 .L033 ;; dim enemy01_X = var23 741 8007 742 8007 .L034 ;; dim enemy01_Y = var24 743 8007 744 8007 .L035 ;; dim enemy01_Flag = var25 745 8007 746 8007 .L036 ;; dim rMovement3 = var26 747 8007 748 8007 .L037 ;; dim rMovement4 = var27 749 8007 750 8007 .L038 ;; dim rMovement5 = var28 751 8007 752 8007 .L039 ;; dim rMovement6 = var29 753 8007 754 8007 .L040 ;; dim enemy01_speed = var30 755 8007 756 8007 .L041 ;; dim gameover_flag = var31 757 8007 758 8007 .L042 ;; dim extra_shipX = var32 759 8007 760 8007 .L043 ;; dim extra_shipY = var33 761 8007 762 8007 .L044 ;; dim extra_shipFlag = var34 763 8007 764 8007 .L045 ;; dim explosion_aniframe = var35 765 8007 766 8007 .L046 ;; dim lives = var36 767 8007 768 8007 .L047 ;; dim twinlaserX = var37 769 8007 770 8007 .L048 ;; dim twinlaserY = var38 771 8007 772 8007 .L049 ;; dim twinlaser_flag = var39 773 8007 774 8007 .L050 ;; dim twinlaser_Slowdown = var40 775 8007 776 8007 .L051 ;; dim continue_flag = var41 777 8007 778 8007 .L052 ;; dim isDead_flag = var42 779 8007 780 8007 .L053 ;; dim timer = var43 781 8007 782 8007 .L054 ;; dim enemy_shotDirection = var44 783 8007 784 8007 .L055 ;; dim enemy_shotXf = $2200 785 8007 786 8007 .L056 ;; dim enemy_shotYf = $2210 787 8007 788 8007 .L057 ;; dim enemy_shotSX = $2220 789 8007 790 8007 .L058 ;; dim enemy_shotSY = $2230 791 8007 792 8007 .L059 ;; dim enemy_shotSXf = $2240 793 8007 794 8007 .L060 ;; dim enemy_shotSYf = $2250 795 8007 796 8007 .L061 ;; dim total_XSu = var45 797 8007 798 8007 .L062 ;; dim total_XSf = var46 799 8007 800 8007 .L063 ;; dim total_speedX = total_XSu.total_XSf 801 8007 802 8007 .L064 ;; dim total_YSu = var47 803 8007 804 8007 .L065 ;; dim total_YSf = var48 805 8007 806 8007 .L066 ;; dim total_speedY = total_YSu.total_YSf 807 8007 808 8007 .L067 ;; dim temp_XSu = var49 809 8007 810 8007 .L068 ;; dim temp_XSf = var50 811 8007 812 8007 .L069 ;; dim temp_speedX = temp_XSu.temp_XSf 813 8007 814 8007 .L070 ;; dim temp_YSu = var51 815 8007 816 8007 .L071 ;; dim temp_YSf = var52 817 8007 818 8007 .L072 ;; dim temp_speedY = temp_YSu.temp_YSf 819 8007 820 8007 .L073 ;; dim mob_speedY = var98.var99 821 8007 822 8007 .L074 ;; dim mob_speedX = var96.var97 823 8007 824 8007 .L075 ;; dim mob_Y = var94.var95 825 8007 826 8007 .L076 ;; dim mob_X = var92.var93 827 8007 828 8007 .L077 ;; dim enemy01_Slowdown = var55 829 8007 830 8007 . 831 8007 ;; 832 8007 833 8007 .L078 ;; characterset vertical_shooting_font 834 8007 835 8007 a9 b0 lda #>vertical_shooting_font 836 8009 8d 0b 21 sta sCHARBASE 837 800c 838 800c 85 34 sta CHARBASE 839 800e a9 60 lda #(vertical_shooting_font_mode | %01100000) 840 8010 8d 06 21 sta charactermode 841 8013 842 8013 .L079 ;; alphachars ' 0123456789abcdefghijklmnopqrstuvwxyz.,?!:;`"' 843 8013 844 8013 . 845 8013 ;; 846 8013 847 8013 .import 848 8013 ;; import 849 8013 850 8013 .L080 ;; incgraphic vertical_shooting_font.png 160A 851 8013 852 8013 .L081 ;; incgraphic vertical_shooting_ship.png 160A 853 8013 854 8013 .L082 ;; incgraphic vertical_shooting_bullet.png 160A 855 8013 856 8013 .L083 ;; incgraphic vertical_shooting_enemyshot.png 160A 857 8013 858 8013 .L084 ;; incgraphic vertical_shooting_powerup.png 160A 859 8013 860 8013 .L085 ;; incgraphic vertical_shooting_enemy01.png 160A 861 8013 862 8013 . 863 8013 ;; 864 8013 865 8013 .L086 ;; incgraphic vertical_shooting_1up.png 160A 866 8013 867 8013 .L087 ;; incgraphic vertical_shooting_explosion_01.png 160A 868 8013 869 8013 .L088 ;; incgraphic vertical_shooting_explosion_02.png 160A 870 8013 871 8013 .L089 ;; incgraphic vertical_shooting_explosion_03.png 160A 872 8013 873 8013 .L090 ;; incgraphic vertical_shooting_explosion_04.png 160A 874 8013 875 8013 .L091 ;; incgraphic vertical_shooting_explosion_05.png 160A 876 8013 877 8013 .L092 ;; incgraphic vertical_shooting_explosion_06.png 160A 878 8013 879 8013 .L093 ;; incgraphic vertical_shooting_explosion_07.png 160A 880 8013 881 8013 .L094 ;; incgraphic vertical_shooting_explosion_08.png 160A 882 8013 883 8013 .L095 ;; incgraphic vertical_shooting_explosion_09.png 160A 884 8013 885 8013 .L096 ;; incgraphic vertical_shooting_explosion_10.png 160A 886 8013 887 8013 .L097 ;; incgraphic vertical_shooting_laser.png 160A 888 8013 889 8013 . 890 8013 ;; 891 8013 892 8013 . 893 8013 ;; 894 8013 895 8013 . 896 8013 ;; 897 8013 898 8013 . 899 8013 ;; 900 8013 901 8013 .L098 ;; const firing_rate = 15 902 8013 903 8013 . 904 8013 ;; 905 8013 906 8013 .L099 ;; const TRUE = 1 907 8013 908 8013 .L0100 ;; const FALSE = 0 909 8013 910 8013 . 911 8013 ;; 912 8013 913 8013 . 914 8013 ;; 915 8013 916 8013 . 917 8013 ;; 918 8013 919 8013 .palettes 920 8013 ;; palettes 921 8013 922 8013 .L0101 ;; P0C1 = $0F : P0C2 = $05 : P0C3 = $32 923 8013 924 8013 a9 0f LDA #$0F 925 8015 85 21 STA P0C1 926 8017 a9 05 LDA #$05 927 8019 85 22 STA P0C2 928 801b a9 32 LDA #$32 929 801d 85 23 STA P0C3 930 801f .L0102 ;; P1C1 = $0F : P1C2 = $EE : P1C3 = $E7 931 801f 932 801f a9 0f LDA #$0F 933 8021 85 25 STA P1C1 934 8023 a9 ee LDA #$EE 935 8025 85 26 STA P1C2 936 8027 a9 e7 LDA #$E7 937 8029 85 27 STA P1C3 938 802b .L0103 ;; P2C1 = $9D : P2C2 = $73 : P2C3 = $88 939 802b 940 802b a9 9d LDA #$9D 941 802d 85 29 STA P2C1 942 802f a9 73 LDA #$73 943 8031 85 2a STA P2C2 944 8033 a9 88 LDA #$88 945 8035 85 2b STA P2C3 946 8037 .L0104 ;; P3C1 = $FB : P3C2 = $F2 : P3C3 = $25 947 8037 948 8037 a9 fb LDA #$FB 949 8039 85 2d STA P3C1 950 803b a9 f2 LDA #$F2 951 803d 85 2e STA P3C2 952 803f a9 25 LDA #$25 953 8041 85 2f STA P3C3 954 8043 . 955 8043 ;; 956 8043 957 8043 .plot 958 8043 ;; plot 959 8043 960 8043 .L0105 ;; playerX = 80 : playerY = 144 : playerFlag = 0 961 8043 962 8043 a9 50 LDA #80 963 8045 8d 41 01 STA playerX 964 8048 a9 90 LDA #144 965 804a 8d 42 01 STA playerY 966 804d a9 00 LDA #0 967 804f 8d 4d 01 STA playerFlag 968 8052 .L0106 ;; isDead_flag = 0 : gameover_flag = 0 969 8052 970 8052 a9 00 LDA #0 971 8054 8d 6a 01 STA isDead_flag 972 8057 8d 5f 01 STA gameover_flag 973 805a .L0107 ;; bulletX = 0 : bulletY = 0 : bulletSlowdown = 0 974 805a 975 805a a9 00 LDA #0 976 805c 8d 48 01 STA bulletX 977 805f 8d 49 01 STA bulletY 978 8062 8d 55 01 STA bulletSlowdown 979 8065 .L0108 ;; frameCounter = 0 980 8065 981 8065 a9 00 LDA #0 982 8067 8d 40 01 STA frameCounter 983 806a .L0109 ;; rMovement1 = 1 : rMovement2 = 1 : rMovement3 = 1 : rMovement4 = 1 984 806a 985 806a a9 01 LDA #1 986 806c 8d 4e 01 STA rMovement1 987 806f 8d 53 01 STA rMovement2 988 8072 8d 5a 01 STA rMovement3 989 8075 8d 5b 01 STA rMovement4 990 8078 .L0110 ;; rMovement5 = 1 : rMovement6 = 1 : rDirection = 1 991 8078 992 8078 a9 01 LDA #1 993 807a 8d 5c 01 STA rMovement5 994 807d 8d 5d 01 STA rMovement6 995 8080 8d 4f 01 STA rDirection 996 8083 .L0111 ;; power_upX = 5 : power_upY = 32 : power_upFlag = 0 : power_upSlowdown = 0 997 8083 998 8083 a9 05 LDA #5 999 8085 8d 50 01 STA power_upX 1000 8088 a9 20 LDA #32 1001 808a 8d 51 01 STA power_upY 1002 808d a9 00 LDA #0 1003 808f 8d 52 01 STA power_upFlag 1004 8092 8d 54 01 STA power_upSlowdown 1005 8095 .L0112 ;; twinlaserX = 0 : twinlaserY = 0 : twinlaser_flag = 0 : twinlaser_Slowdown = 0 1006 8095 1007 8095 a9 00 LDA #0 1008 8097 8d 65 01 STA twinlaserX 1009 809a 8d 66 01 STA twinlaserY 1010 809d 8d 67 01 STA twinlaser_flag 1011 80a0 8d 68 01 STA twinlaser_Slowdown 1012 80a3 .L0113 ;; enemy_shotX = 0 : enemy_shotY = 0 : enemy_shotFlag = 0 : enemy_shotSlowdown = 0 1013 80a3 1014 80a3 a9 00 LDA #0 1015 80a5 8d 4a 01 STA enemy_shotX 1016 80a8 8d 4b 01 STA enemy_shotY 1017 80ab 8d 4c 01 STA enemy_shotFlag 1018 80ae 8d 56 01 STA enemy_shotSlowdown 1019 80b1 .L0114 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 : enemy01_speed = 3 : enemy01_Slowdown = 0 1020 80b1 1021 80b1 a9 00 LDA #0 1022 80b3 8d 57 01 STA enemy01_X 1023 80b6 8d 58 01 STA enemy01_Y 1024 80b9 8d 59 01 STA enemy01_Flag 1025 80bc a9 03 LDA #3 1026 80be 8d 5e 01 STA enemy01_speed 1027 80c1 a9 00 LDA #0 1028 80c3 8d 77 01 STA enemy01_Slowdown 1029 80c6 .L0115 ;; extra_shipX = 0 : extra_shipY = 0 : extra_shipFlag = 0 1030 80c6 1031 80c6 a9 00 LDA #0 1032 80c8 8d 60 01 STA extra_shipX 1033 80cb 8d 61 01 STA extra_shipY 1034 80ce 8d 62 01 STA extra_shipFlag 1035 80d1 .L0116 ;; joyposleft = 0 : joyposright = 0 : joyposup = 0 : joyposdown = 0 1036 80d1 1037 80d1 a9 00 LDA #0 1038 80d3 8d 46 01 STA joyposleft 1039 80d6 8d 47 01 STA joyposright 1040 80d9 8d 44 01 STA joyposup 1041 80dc 8d 45 01 STA joyposdown 1042 80df . 1043 80df ;; 1044 80df 1045 80df .L0117 ;; gosub titlescreen 1046 80df 1047 80df 20 5c 92 jsr .titlescreen 1048 80e2 1049 80e2 . 1050 80e2 ;; 1051 80e2 1052 80e2 .L0118 ;; gosub initialise_gamescreen 1053 80e2 1054 80e2 20 69 93 jsr .initialise_gamescreen 1055 80e5 1056 80e5 .L0119 ;; timer = firing_rate 1057 80e5 1058 80e5 a9 0f LDA #firing_rate 1059 80e7 8d 6b 01 STA timer 1060 80ea . 1061 80ea ;; 1062 80ea 1063 80ea .main 1064 80ea ;; main 1065 80ea 1066 80ea .L0120 ;; frameCounter = frameCounter + 1 1067 80ea 1068 80ea ad 40 01 LDA frameCounter 1069 80ed 18 CLC 1070 80ee 69 01 ADC #1 1071 80f0 8d 40 01 STA frameCounter 1072 80f3 .L0121 ;; if frameCounter > 10 then frameCounter = 0 1073 80f3 1074 80f3 a9 0a LDA #10 1075 80f5 cd 40 01 CMP frameCounter 1076 80f8 b0 05 BCS .skipL0121 1077 80fa .condpart0 1078 80fa a9 00 LDA #0 1079 80fc 8d 40 01 STA frameCounter 1080 80ff .skipL0121 1081 80ff .L0122 ;; timer = timer - 1 1082 80ff 1083 80ff ad 6b 01 LDA timer 1084 8102 38 SEC 1085 8103 e9 01 SBC #1 1086 8105 8d 6b 01 STA timer 1087 8108 .L0123 ;; if timer = 0 then gosub fire_enemybullet : timer = firing_rate 1088 8108 1089 8108 ad 6b 01 LDA timer 1090 810b c9 00 CMP #0 1091 810d d0 08 BNE .skipL0123 1092 810f .condpart1 1093 810f 20 68 89 jsr .fire_enemybullet 1094 8112 a9 0f LDA #firing_rate 1095 8114 8d 6b 01 STA timer 1096 8117 .skipL0123 1097 8117 .mainloop 1098 8117 ;; mainloop 1099 8117 1100 8117 . 1101 8117 ;; 1102 8117 1103 8117 .L0124 ;; rMovement1 = ( rand & 7 ) - 2 1104 8117 1105 8117 ; complex statement detected 1106 8117 20 f8 f3 jsr randomize 1107 811a 29 07 AND #7 1108 811c 38 SEC 1109 811d e9 02 SBC #2 1110 811f 8d 4e 01 STA rMovement1 1111 8122 .L0125 ;; rMovement2 = ( rand & 6 ) 1112 8122 1113 8122 ; complex statement detected 1114 8122 20 f8 f3 jsr randomize 1115 8125 29 06 AND #6 1116 8127 8d 53 01 STA rMovement2 1117 812a .L0126 ;; rMovement3 = ( rand & 3 ) + 1 1118 812a 1119 812a ; complex statement detected 1120 812a 20 f8 f3 jsr randomize 1121 812d 29 03 AND #3 1122 812f 18 CLC 1123 8130 69 01 ADC #1 1124 8132 8d 5a 01 STA rMovement3 1125 8135 .L0127 ;; rMovement4 = ( rand & 5 ) + 2 1126 8135 1127 8135 ; complex statement detected 1128 8135 20 f8 f3 jsr randomize 1129 8138 29 05 AND #5 1130 813a 18 CLC 1131 813b 69 02 ADC #2 1132 813d 8d 5b 01 STA rMovement4 1133 8140 .L0128 ;; rMovement5 = ( rand & 5 ) + 1 1134 8140 1135 8140 ; complex statement detected 1136 8140 20 f8 f3 jsr randomize 1137 8143 29 05 AND #5 1138 8145 18 CLC 1139 8146 69 01 ADC #1 1140 8148 8d 5c 01 STA rMovement5 1141 814b .L0129 ;; rMovement6 = ( rand & 6 ) - 1 1142 814b 1143 814b ; complex statement detected 1144 814b 20 f8 f3 jsr randomize 1145 814e 29 06 AND #6 1146 8150 38 SEC 1147 8151 e9 01 SBC #1 1148 8153 8d 5d 01 STA rMovement6 1149 8156 .L0130 ;; rDirection = ( rand & 4 ) 1150 8156 1151 8156 ; complex statement detected 1152 8156 20 f8 f3 jsr randomize 1153 8159 29 04 AND #4 1154 815b 8d 4f 01 STA rDirection 1155 815e .L0131 ;; if switchreset then reboot 1156 815e 1157 815e 20 8d f4 jsr checkresetswitch 1158 8161 d0 03 BNE .skipL0131 1159 8163 .condpart2 1160 8163 4c 7a f5 JMP START 1161 8166 .skipL0131 1162 8166 . 1163 8166 ;; 1164 8166 1165 8166 .L0132 ;; if joy0up && joyposup = - 2 then gosub SetBulletHome 1166 8166 1167 8166 a9 10 lda #$10 1168 8168 2c 80 02 bit SWCHA 1169 816b d0 10 BNE .skipL0132 1170 816d .condpart3 1171 816d ; complex condition detected 1172 816d a9 fe LDA #254 1173 816f 48 PHA 1174 8170 ba TSX 1175 8171 68 PLA 1176 8172 ad 44 01 LDA joyposup 1177 8175 dd 01 01 CMP $101,x 1178 8178 d0 03 BNE .skip3then 1179 817a .condpart4 1180 817a 20 fe 90 jsr .SetBulletHome 1181 817d 1182 817d .skip3then 1183 817d .skipL0132 1184 817d .L0133 ;; if joy0down && joyposdown = - 2 then gosub SetBulletHome 1185 817d 1186 817d a9 20 lda #$20 1187 817f 2c 80 02 bit SWCHA 1188 8182 d0 10 BNE .skipL0133 1189 8184 .condpart5 1190 8184 ; complex condition detected 1191 8184 a9 fe LDA #254 1192 8186 48 PHA 1193 8187 ba TSX 1194 8188 68 PLA 1195 8189 ad 45 01 LDA joyposdown 1196 818c dd 01 01 CMP $101,x 1197 818f d0 03 BNE .skip5then 1198 8191 .condpart6 1199 8191 20 fe 90 jsr .SetBulletHome 1200 8194 1201 8194 .skip5then 1202 8194 .skipL0133 1203 8194 .L0134 ;; if joy0up && joyposleft = - 2 then gosub SetBulletHome 1204 8194 1205 8194 a9 10 lda #$10 1206 8196 2c 80 02 bit SWCHA 1207 8199 d0 10 BNE .skipL0134 1208 819b .condpart7 1209 819b ; complex condition detected 1210 819b a9 fe LDA #254 1211 819d 48 PHA 1212 819e ba TSX 1213 819f 68 PLA 1214 81a0 ad 46 01 LDA joyposleft 1215 81a3 dd 01 01 CMP $101,x 1216 81a6 d0 03 BNE .skip7then 1217 81a8 .condpart8 1218 81a8 20 fe 90 jsr .SetBulletHome 1219 81ab 1220 81ab .skip7then 1221 81ab .skipL0134 1222 81ab .L0135 ;; if joy0down && joyposright = - 2 then gosub SetBulletHome 1223 81ab 1224 81ab a9 20 lda #$20 1225 81ad 2c 80 02 bit SWCHA 1226 81b0 d0 10 BNE .skipL0135 1227 81b2 .condpart9 1228 81b2 ; complex condition detected 1229 81b2 a9 fe LDA #254 1230 81b4 48 PHA 1231 81b5 ba TSX 1232 81b6 68 PLA 1233 81b7 ad 47 01 LDA joyposright 1234 81ba dd 01 01 CMP $101,x 1235 81bd d0 03 BNE .skip9then 1236 81bf .condpart10 1237 81bf 20 fe 90 jsr .SetBulletHome 1238 81c2 1239 81c2 .skip9then 1240 81c2 .skipL0135 1241 81c2 .L0136 ;; if joy0up && joyposup = - 2 then gosub SetLaserHome 1242 81c2 1243 81c2 a9 10 lda #$10 1244 81c4 2c 80 02 bit SWCHA 1245 81c7 d0 10 BNE .skipL0136 1246 81c9 .condpart11 1247 81c9 ; complex condition detected 1248 81c9 a9 fe LDA #254 1249 81cb 48 PHA 1250 81cc ba TSX 1251 81cd 68 PLA 1252 81ce ad 44 01 LDA joyposup 1253 81d1 dd 01 01 CMP $101,x 1254 81d4 d0 03 BNE .skip11then 1255 81d6 .condpart12 1256 81d6 20 1a 91 jsr .SetLaserHome 1257 81d9 1258 81d9 .skip11then 1259 81d9 .skipL0136 1260 81d9 .L0137 ;; if joy0down && joyposdown = - 2 then gosub SetLaserHome 1261 81d9 1262 81d9 a9 20 lda #$20 1263 81db 2c 80 02 bit SWCHA 1264 81de d0 10 BNE .skipL0137 1265 81e0 .condpart13 1266 81e0 ; complex condition detected 1267 81e0 a9 fe LDA #254 1268 81e2 48 PHA 1269 81e3 ba TSX 1270 81e4 68 PLA 1271 81e5 ad 45 01 LDA joyposdown 1272 81e8 dd 01 01 CMP $101,x 1273 81eb d0 03 BNE .skip13then 1274 81ed .condpart14 1275 81ed 20 1a 91 jsr .SetLaserHome 1276 81f0 1277 81f0 .skip13then 1278 81f0 .skipL0137 1279 81f0 .L0138 ;; if joy0up && joyposleft = - 2 then gosub SetLaserHome 1280 81f0 1281 81f0 a9 10 lda #$10 1282 81f2 2c 80 02 bit SWCHA 1283 81f5 d0 10 BNE .skipL0138 1284 81f7 .condpart15 1285 81f7 ; complex condition detected 1286 81f7 a9 fe LDA #254 1287 81f9 48 PHA 1288 81fa ba TSX 1289 81fb 68 PLA 1290 81fc ad 46 01 LDA joyposleft 1291 81ff dd 01 01 CMP $101,x 1292 8202 d0 03 BNE .skip15then 1293 8204 .condpart16 1294 8204 20 1a 91 jsr .SetLaserHome 1295 8207 1296 8207 .skip15then 1297 8207 .skipL0138 1298 8207 .L0139 ;; if joy0down && joyposright = - 2 then gosub SetLaserHome 1299 8207 1300 8207 a9 20 lda #$20 1301 8209 2c 80 02 bit SWCHA 1302 820c d0 10 BNE .skipL0139 1303 820e .condpart17 1304 820e ; complex condition detected 1305 820e a9 fe LDA #254 1306 8210 48 PHA 1307 8211 ba TSX 1308 8212 68 PLA 1309 8213 ad 47 01 LDA joyposright 1310 8216 dd 01 01 CMP $101,x 1311 8219 d0 03 BNE .skip17then 1312 821b .condpart18 1313 821b 20 1a 91 jsr .SetLaserHome 1314 821e 1315 821e .skip17then 1316 821e .skipL0139 1317 821e .L0140 ;; if joy0up then playerY = playerY - 1 : joyposup = 1 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 1318 821e 1319 821e a9 10 lda #$10 1320 8220 2c 80 02 bit SWCHA 1321 8223 d0 19 BNE .skipL0140 1322 8225 .condpart19 1323 8225 ad 42 01 LDA playerY 1324 8228 38 SEC 1325 8229 e9 01 SBC #1 1326 822b 8d 42 01 STA playerY 1327 822e a9 01 LDA #1 1328 8230 8d 44 01 STA joyposup 1329 8233 a9 00 LDA #0 1330 8235 8d 45 01 STA joyposdown 1331 8238 8d 46 01 STA joyposleft 1332 823b 8d 47 01 STA joyposright 1333 823e .skipL0140 1334 823e .L0141 ;; if joy0down then playerY = playerY + 1 : joyposup = 0 : joyposdown = 1 : joyposleft = 0 : joyposright = 0 1335 823e 1336 823e a9 20 lda #$20 1337 8240 2c 80 02 bit SWCHA 1338 8243 d0 1b BNE .skipL0141 1339 8245 .condpart20 1340 8245 ad 42 01 LDA playerY 1341 8248 18 CLC 1342 8249 69 01 ADC #1 1343 824b 8d 42 01 STA playerY 1344 824e a9 00 LDA #0 1345 8250 8d 44 01 STA joyposup 1346 8253 a9 01 LDA #1 1347 8255 8d 45 01 STA joyposdown 1348 8258 a9 00 LDA #0 1349 825a 8d 46 01 STA joyposleft 1350 825d 8d 47 01 STA joyposright 1351 8260 .skipL0141 1352 8260 .L0142 ;; if joy0left then playerX = playerX - 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 1 : joyposright = 0 1353 8260 1354 8260 2c 80 02 bit SWCHA 1355 8263 70 1b BVS .skipL0142 1356 8265 .condpart21 1357 8265 ad 41 01 LDA playerX 1358 8268 38 SEC 1359 8269 e9 01 SBC #1 1360 826b 8d 41 01 STA playerX 1361 826e a9 00 LDA #0 1362 8270 8d 44 01 STA joyposup 1363 8273 8d 45 01 STA joyposdown 1364 8276 a9 01 LDA #1 1365 8278 8d 46 01 STA joyposleft 1366 827b a9 00 LDA #0 1367 827d 8d 47 01 STA joyposright 1368 8280 .skipL0142 1369 8280 .L0143 ;; if joy0right then playerX = playerX + 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 1 1370 8280 1371 8280 2c 80 02 bit SWCHA 1372 8283 30 19 BMI .skipL0143 1373 8285 .condpart22 1374 8285 ad 41 01 LDA playerX 1375 8288 18 CLC 1376 8289 69 01 ADC #1 1377 828b 8d 41 01 STA playerX 1378 828e a9 00 LDA #0 1379 8290 8d 44 01 STA joyposup 1380 8293 8d 45 01 STA joyposdown 1381 8296 8d 46 01 STA joyposleft 1382 8299 a9 01 LDA #1 1383 829b 8d 47 01 STA joyposright 1384 829e .skipL0143 1385 829e .L0144 ;; if joy0fire && joyposup = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1386 829e 1387 829e 2c 02 21 bit sINPT1 1388 82a1 10 29 BPL .skipL0144 1389 82a3 .condpart23 1390 82a3 ad 44 01 LDA joyposup 1391 82a6 c9 01 CMP #1 1392 82a8 d0 22 BNE .skip23then 1393 82aa .condpart24 1394 82aa ad 49 01 LDA bulletY 1395 82ad 38 SEC 1396 82ae e9 05 SBC #5 1397 82b0 8d 49 01 STA bulletY 1398 82b3 ifnconst NOTIALOCKMUTE 1399 82b3 a9 01 lda #1 1400 82b5 85 de sta sfxschedulelock 1401 82b7 a9 b9 lda #sfx_pulsecannon 1404 82bd 85 e1 sta sfxinstrumenthi 1405 82bf a9 00 lda #0 1406 82c1 85 e2 sta sfxpitchoffset ; no pitch modification 1407 82c3 85 e3 sta sfxnoteindex ; not a musical note 1408 82c5 20 53 f2 jsr schedulesfx 1409 82c8 a9 00 lda #0 1410 82ca 85 de sta sfxschedulelock 1411 82cc endif ; NOTIALOCKMUTE 1412 82cc .skip23then 1413 82cc .skipL0144 1414 82cc .L0145 ;; if joy0fire && joyposdown = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1415 82cc 1416 82cc 2c 02 21 bit sINPT1 1417 82cf 10 29 BPL .skipL0145 1418 82d1 .condpart25 1419 82d1 ad 45 01 LDA joyposdown 1420 82d4 c9 01 CMP #1 1421 82d6 d0 22 BNE .skip25then 1422 82d8 .condpart26 1423 82d8 ad 49 01 LDA bulletY 1424 82db 38 SEC 1425 82dc e9 05 SBC #5 1426 82de 8d 49 01 STA bulletY 1427 82e1 ifnconst NOTIALOCKMUTE 1428 82e1 a9 01 lda #1 1429 82e3 85 de sta sfxschedulelock 1430 82e5 a9 b9 lda #sfx_pulsecannon 1433 82eb 85 e1 sta sfxinstrumenthi 1434 82ed a9 00 lda #0 1435 82ef 85 e2 sta sfxpitchoffset ; no pitch modification 1436 82f1 85 e3 sta sfxnoteindex ; not a musical note 1437 82f3 20 53 f2 jsr schedulesfx 1438 82f6 a9 00 lda #0 1439 82f8 85 de sta sfxschedulelock 1440 82fa endif ; NOTIALOCKMUTE 1441 82fa .skip25then 1442 82fa .skipL0145 1443 82fa .L0146 ;; if joy0fire && joyposleft = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1444 82fa 1445 82fa 2c 02 21 bit sINPT1 1446 82fd 10 29 BPL .skipL0146 1447 82ff .condpart27 1448 82ff ad 46 01 LDA joyposleft 1449 8302 c9 01 CMP #1 1450 8304 d0 22 BNE .skip27then 1451 8306 .condpart28 1452 8306 ad 49 01 LDA bulletY 1453 8309 38 SEC 1454 830a e9 05 SBC #5 1455 830c 8d 49 01 STA bulletY 1456 830f ifnconst NOTIALOCKMUTE 1457 830f a9 01 lda #1 1458 8311 85 de sta sfxschedulelock 1459 8313 a9 b9 lda #sfx_pulsecannon 1462 8319 85 e1 sta sfxinstrumenthi 1463 831b a9 00 lda #0 1464 831d 85 e2 sta sfxpitchoffset ; no pitch modification 1465 831f 85 e3 sta sfxnoteindex ; not a musical note 1466 8321 20 53 f2 jsr schedulesfx 1467 8324 a9 00 lda #0 1468 8326 85 de sta sfxschedulelock 1469 8328 endif ; NOTIALOCKMUTE 1470 8328 .skip27then 1471 8328 .skipL0146 1472 8328 .L0147 ;; if joy0fire && joyposright = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1473 8328 1474 8328 2c 02 21 bit sINPT1 1475 832b 10 29 BPL .skipL0147 1476 832d .condpart29 1477 832d ad 47 01 LDA joyposright 1478 8330 c9 01 CMP #1 1479 8332 d0 22 BNE .skip29then 1480 8334 .condpart30 1481 8334 ad 49 01 LDA bulletY 1482 8337 38 SEC 1483 8338 e9 05 SBC #5 1484 833a 8d 49 01 STA bulletY 1485 833d ifnconst NOTIALOCKMUTE 1486 833d a9 01 lda #1 1487 833f 85 de sta sfxschedulelock 1488 8341 a9 b9 lda #sfx_pulsecannon 1491 8347 85 e1 sta sfxinstrumenthi 1492 8349 a9 00 lda #0 1493 834b 85 e2 sta sfxpitchoffset ; no pitch modification 1494 834d 85 e3 sta sfxnoteindex ; not a musical note 1495 834f 20 53 f2 jsr schedulesfx 1496 8352 a9 00 lda #0 1497 8354 85 de sta sfxschedulelock 1498 8356 endif ; NOTIALOCKMUTE 1499 8356 .skip29then 1500 8356 .skipL0147 1501 8356 .L0148 ;; if !joy0fire then bulletX = playerX + 2 : bulletY = playerY - 8 1502 8356 1503 8356 2c 02 21 bit sINPT1 1504 8359 30 12 BMI .skipL0148 1505 835b .condpart31 1506 835b ad 41 01 LDA playerX 1507 835e 18 CLC 1508 835f 69 02 ADC #2 1509 8361 8d 48 01 STA bulletX 1510 8364 ad 42 01 LDA playerY 1511 8367 38 SEC 1512 8368 e9 08 SBC #8 1513 836a 8d 49 01 STA bulletY 1514 836d .skipL0148 1515 836d . 1516 836d ;; 1517 836d 1518 836d .L0149 ;; enemy_shotSlowdown = enemy_shotSlowdown + 1 1519 836d 1520 836d ad 56 01 LDA enemy_shotSlowdown 1521 8370 18 CLC 1522 8371 69 01 ADC #1 1523 8373 8d 56 01 STA enemy_shotSlowdown 1524 8376 .L0150 ;; if enemy_shotSlowdown > 8 then enemy_shotSlowdown = 0 1525 8376 1526 8376 a9 08 LDA #8 1527 8378 cd 56 01 CMP enemy_shotSlowdown 1528 837b b0 05 BCS .skipL0150 1529 837d .condpart32 1530 837d a9 00 LDA #0 1531 837f 8d 56 01 STA enemy_shotSlowdown 1532 8382 .skipL0150 1533 8382 . 1534 8382 ;; 1535 8382 1536 8382 .L0151 ;; enemy01_Slowdown = enemy01_Slowdown + 1 1537 8382 1538 8382 ad 77 01 LDA enemy01_Slowdown 1539 8385 18 CLC 1540 8386 69 01 ADC #1 1541 8388 8d 77 01 STA enemy01_Slowdown 1542 838b .L0152 ;; if enemy01_Slowdown > 8 then enemy01_Slowdown = 0 1543 838b 1544 838b a9 08 LDA #8 1545 838d cd 77 01 CMP enemy01_Slowdown 1546 8390 b0 05 BCS .skipL0152 1547 8392 .condpart33 1548 8392 a9 00 LDA #0 1549 8394 8d 77 01 STA enemy01_Slowdown 1550 8397 .skipL0152 1551 8397 . 1552 8397 ;; 1553 8397 1554 8397 .L0153 ;; bulletSlowdown = bulletSlowdown + 1 1555 8397 1556 8397 ad 55 01 LDA bulletSlowdown 1557 839a 18 CLC 1558 839b 69 01 ADC #1 1559 839d 8d 55 01 STA bulletSlowdown 1560 83a0 .L0154 ;; if bulletSlowdown > 6 then bulletSlowdown = 0 1561 83a0 1562 83a0 a9 06 LDA #6 1563 83a2 cd 55 01 CMP bulletSlowdown 1564 83a5 b0 05 BCS .skipL0154 1565 83a7 .condpart34 1566 83a7 a9 00 LDA #0 1567 83a9 8d 55 01 STA bulletSlowdown 1568 83ac .skipL0154 1569 83ac . 1570 83ac ;; 1571 83ac 1572 83ac .L0155 ;; power_upSlowdown = power_upSlowdown + 1 1573 83ac 1574 83ac ad 54 01 LDA power_upSlowdown 1575 83af 18 CLC 1576 83b0 69 01 ADC #1 1577 83b2 8d 54 01 STA power_upSlowdown 1578 83b5 .L0156 ;; if power_upSlowdown > 7 then power_upSlowdown = 0 1579 83b5 1580 83b5 a9 07 LDA #7 1581 83b7 cd 54 01 CMP power_upSlowdown 1582 83ba b0 05 BCS .skipL0156 1583 83bc .condpart35 1584 83bc a9 00 LDA #0 1585 83be 8d 54 01 STA power_upSlowdown 1586 83c1 .skipL0156 1587 83c1 . 1588 83c1 ;; 1589 83c1 1590 83c1 .L0157 ;; twinlaser_Slowdown = twinlaser_Slowdown + 1 1591 83c1 1592 83c1 ad 68 01 LDA twinlaser_Slowdown 1593 83c4 18 CLC 1594 83c5 69 01 ADC #1 1595 83c7 8d 68 01 STA twinlaser_Slowdown 1596 83ca .L0158 ;; if twinlaser_Slowdown > 5 then twinlaser_Slowdown = 0 1597 83ca 1598 83ca a9 05 LDA #5 1599 83cc cd 68 01 CMP twinlaser_Slowdown 1600 83cf b0 05 BCS .skipL0158 1601 83d1 .condpart36 1602 83d1 a9 00 LDA #0 1603 83d3 8d 68 01 STA twinlaser_Slowdown 1604 83d6 .skipL0158 1605 83d6 . 1606 83d6 ;; 1607 83d6 1608 83d6 .L0159 ;; if playerX > 152 then playerX = playerX - 1 1609 83d6 1610 83d6 a9 98 LDA #152 1611 83d8 cd 41 01 CMP playerX 1612 83db b0 09 BCS .skipL0159 1613 83dd .condpart37 1614 83dd ad 41 01 LDA playerX 1615 83e0 38 SEC 1616 83e1 e9 01 SBC #1 1617 83e3 8d 41 01 STA playerX 1618 83e6 .skipL0159 1619 83e6 .L0160 ;; if playerX < 1 then playerX = playerX + 1 1620 83e6 1621 83e6 ad 41 01 LDA playerX 1622 83e9 c9 01 CMP #1 1623 83eb b0 09 BCS .skipL0160 1624 83ed .condpart38 1625 83ed ad 41 01 LDA playerX 1626 83f0 18 CLC 1627 83f1 69 01 ADC #1 1628 83f3 8d 41 01 STA playerX 1629 83f6 .skipL0160 1630 83f6 .L0161 ;; if playerY > 177 then playerY = playerY - 1 1631 83f6 1632 83f6 a9 b1 LDA #177 1633 83f8 cd 42 01 CMP playerY 1634 83fb b0 09 BCS .skipL0161 1635 83fd .condpart39 1636 83fd ad 42 01 LDA playerY 1637 8400 38 SEC 1638 8401 e9 01 SBC #1 1639 8403 8d 42 01 STA playerY 1640 8406 .skipL0161 1641 8406 .L0162 ;; if playerY < 1 then playerY = playerY + 1 1642 8406 1643 8406 ad 42 01 LDA playerY 1644 8409 c9 01 CMP #1 1645 840b b0 09 BCS .skipL0162 1646 840d .condpart40 1647 840d ad 42 01 LDA playerY 1648 8410 18 CLC 1649 8411 69 01 ADC #1 1650 8413 8d 42 01 STA playerY 1651 8416 .skipL0162 1652 8416 .L0163 ;; if bulletY > 183 then bulletY = bulletY - 1 1653 8416 1654 8416 a9 b7 LDA #183 1655 8418 cd 49 01 CMP bulletY 1656 841b b0 09 BCS .skipL0163 1657 841d .condpart41 1658 841d ad 49 01 LDA bulletY 1659 8420 38 SEC 1660 8421 e9 01 SBC #1 1661 8423 8d 49 01 STA bulletY 1662 8426 .skipL0163 1663 8426 .L0164 ;; if bulletY < 1 then bulletY = bulletY + 1 1664 8426 1665 8426 ad 49 01 LDA bulletY 1666 8429 c9 01 CMP #1 1667 842b b0 09 BCS .skipL0164 1668 842d .condpart42 1669 842d ad 49 01 LDA bulletY 1670 8430 18 CLC 1671 8431 69 01 ADC #1 1672 8433 8d 49 01 STA bulletY 1673 8436 .skipL0164 1674 8436 .L0165 ;; if twinlaserY > 183 then twinlaserY = twinlaserY - 1 1675 8436 1676 8436 a9 b7 LDA #183 1677 8438 cd 66 01 CMP twinlaserY 1678 843b b0 09 BCS .skipL0165 1679 843d .condpart43 1680 843d ad 66 01 LDA twinlaserY 1681 8440 38 SEC 1682 8441 e9 01 SBC #1 1683 8443 8d 66 01 STA twinlaserY 1684 8446 .skipL0165 1685 8446 .L0166 ;; if twinlaserY < 1 then twinlaserY = twinlaserY + 1 1686 8446 1687 8446 ad 66 01 LDA twinlaserY 1688 8449 c9 01 CMP #1 1689 844b b0 09 BCS .skipL0166 1690 844d .condpart44 1691 844d ad 66 01 LDA twinlaserY 1692 8450 18 CLC 1693 8451 69 01 ADC #1 1694 8453 8d 66 01 STA twinlaserY 1695 8456 .skipL0166 1696 8456 . 1697 8456 ;; 1698 8456 1699 8456 .L0167 ;; gosub check_collisions 1700 8456 1701 8456 20 3d 8c jsr .check_collisions 1702 8459 1703 8459 .L0168 ;; if isDead_flag then goto lose_a_life 1704 8459 1705 8459 ad 6a 01 LDA isDead_flag 1706 845c f0 03 BEQ .skipL0168 1707 845e .condpart45 1708 845e 4c 36 91 jmp .lose_a_life 1709 8461 1710 8461 .skipL0168 1711 8461 . 1712 8461 ;; 1713 8461 1714 8461 .L0169 ;; if enemy_shotX > 160 then enemy_shotX = enemy_shotX - 1 1715 8461 1716 8461 a9 a0 LDA #160 1717 8463 cd 4a 01 CMP enemy_shotX 1718 8466 b0 09 BCS .skipL0169 1719 8468 .condpart46 1720 8468 ad 4a 01 LDA enemy_shotX 1721 846b 38 SEC 1722 846c e9 01 SBC #1 1723 846e 8d 4a 01 STA enemy_shotX 1724 8471 .skipL0169 1725 8471 .L0170 ;; if enemy_shotX < 1 then enemy_shotX = enemy_shotX + 1 1726 8471 1727 8471 ad 4a 01 LDA enemy_shotX 1728 8474 c9 01 CMP #1 1729 8476 b0 09 BCS .skipL0170 1730 8478 .condpart47 1731 8478 ad 4a 01 LDA enemy_shotX 1732 847b 18 CLC 1733 847c 69 01 ADC #1 1734 847e 8d 4a 01 STA enemy_shotX 1735 8481 .skipL0170 1736 8481 .L0171 ;; if enemy_shotY > 191 then enemy_shotY = enemy_shotY - 1 1737 8481 1738 8481 a9 bf LDA #191 1739 8483 cd 4b 01 CMP enemy_shotY 1740 8486 b0 09 BCS .skipL0171 1741 8488 .condpart48 1742 8488 ad 4b 01 LDA enemy_shotY 1743 848b 38 SEC 1744 848c e9 01 SBC #1 1745 848e 8d 4b 01 STA enemy_shotY 1746 8491 .skipL0171 1747 8491 .L0172 ;; if enemy_shotY < 1 then enemy_shotY = enemy_shotY + 1 1748 8491 1749 8491 ad 4b 01 LDA enemy_shotY 1750 8494 c9 01 CMP #1 1751 8496 b0 09 BCS .skipL0172 1752 8498 .condpart49 1753 8498 ad 4b 01 LDA enemy_shotY 1754 849b 18 CLC 1755 849c 69 01 ADC #1 1756 849e 8d 4b 01 STA enemy_shotY 1757 84a1 .skipL0172 1758 84a1 .L0173 ;; if power_upX > 155 then power_upX = power_upX - 5 1759 84a1 1760 84a1 a9 9b LDA #155 1761 84a3 cd 50 01 CMP power_upX 1762 84a6 b0 09 BCS .skipL0173 1763 84a8 .condpart50 1764 84a8 ad 50 01 LDA power_upX 1765 84ab 38 SEC 1766 84ac e9 05 SBC #5 1767 84ae 8d 50 01 STA power_upX 1768 84b1 .skipL0173 1769 84b1 .L0174 ;; if power_upX < 1 then power_upX = power_upX + 5 1770 84b1 1771 84b1 ad 50 01 LDA power_upX 1772 84b4 c9 01 CMP #1 1773 84b6 b0 09 BCS .skipL0174 1774 84b8 .condpart51 1775 84b8 ad 50 01 LDA power_upX 1776 84bb 18 CLC 1777 84bc 69 05 ADC #5 1778 84be 8d 50 01 STA power_upX 1779 84c1 .skipL0174 1780 84c1 .L0175 ;; if power_upY > 191 then power_upY = power_upY - 5 1781 84c1 1782 84c1 a9 bf LDA #191 1783 84c3 cd 51 01 CMP power_upY 1784 84c6 b0 09 BCS .skipL0175 1785 84c8 .condpart52 1786 84c8 ad 51 01 LDA power_upY 1787 84cb 38 SEC 1788 84cc e9 05 SBC #5 1789 84ce 8d 51 01 STA power_upY 1790 84d1 .skipL0175 1791 84d1 .L0176 ;; if power_upY < 1 then power_upY = power_upY + 5 1792 84d1 1793 84d1 ad 51 01 LDA power_upY 1794 84d4 c9 01 CMP #1 1795 84d6 b0 09 BCS .skipL0176 1796 84d8 .condpart53 1797 84d8 ad 51 01 LDA power_upY 1798 84db 18 CLC 1799 84dc 69 05 ADC #5 1800 84de 8d 51 01 STA power_upY 1801 84e1 .skipL0176 1802 84e1 .L0177 ;; if enemy01_X > 160 then enemy01_X = enemy01_X - 1 1803 84e1 1804 84e1 a9 a0 LDA #160 1805 84e3 cd 57 01 CMP enemy01_X 1806 84e6 b0 09 BCS .skipL0177 1807 84e8 .condpart54 1808 84e8 ad 57 01 LDA enemy01_X 1809 84eb 38 SEC 1810 84ec e9 01 SBC #1 1811 84ee 8d 57 01 STA enemy01_X 1812 84f1 .skipL0177 1813 84f1 .L0178 ;; if enemy01_X < 1 then enemy01_X = enemy01_X + 1 1814 84f1 1815 84f1 ad 57 01 LDA enemy01_X 1816 84f4 c9 01 CMP #1 1817 84f6 b0 09 BCS .skipL0178 1818 84f8 .condpart55 1819 84f8 ad 57 01 LDA enemy01_X 1820 84fb 18 CLC 1821 84fc 69 01 ADC #1 1822 84fe 8d 57 01 STA enemy01_X 1823 8501 .skipL0178 1824 8501 .L0179 ;; if enemy01_Y > 220 then enemy01_Y = enemy01_Y - 1 1825 8501 1826 8501 a9 dc LDA #220 1827 8503 cd 58 01 CMP enemy01_Y 1828 8506 b0 09 BCS .skipL0179 1829 8508 .condpart56 1830 8508 ad 58 01 LDA enemy01_Y 1831 850b 38 SEC 1832 850c e9 01 SBC #1 1833 850e 8d 58 01 STA enemy01_Y 1834 8511 .skipL0179 1835 8511 .L0180 ;; if enemy01_Y < - 16 then enemy01_Y = enemy01_Y + 1 1836 8511 1837 8511 ; complex condition detected 1838 8511 a9 f0 LDA #240 1839 8513 48 PHA 1840 8514 ba TSX 1841 8515 68 PLA 1842 8516 ad 58 01 LDA enemy01_Y 1843 8519 dd 01 01 CMP $101,x 1844 851c b0 09 BCS .skipL0180 1845 851e .condpart57 1846 851e ad 58 01 LDA enemy01_Y 1847 8521 18 CLC 1848 8522 69 01 ADC #1 1849 8524 8d 58 01 STA enemy01_Y 1850 8527 .skipL0180 1851 8527 .L0181 ;; if extra_shipX > 160 then extra_shipX = extra_shipX - 1 1852 8527 1853 8527 a9 a0 LDA #160 1854 8529 cd 60 01 CMP extra_shipX 1855 852c b0 09 BCS .skipL0181 1856 852e .condpart58 1857 852e ad 60 01 LDA extra_shipX 1858 8531 38 SEC 1859 8532 e9 01 SBC #1 1860 8534 8d 60 01 STA extra_shipX 1861 8537 .skipL0181 1862 8537 .L0182 ;; if extra_shipX < 1 then extra_shipX = extra_shipX + 1 1863 8537 1864 8537 ad 60 01 LDA extra_shipX 1865 853a c9 01 CMP #1 1866 853c b0 09 BCS .skipL0182 1867 853e .condpart59 1868 853e ad 60 01 LDA extra_shipX 1869 8541 18 CLC 1870 8542 69 01 ADC #1 1871 8544 8d 60 01 STA extra_shipX 1872 8547 .skipL0182 1873 8547 .L0183 ;; if extra_shipY > 191 then extra_shipY = extra_shipY - 1 1874 8547 1875 8547 a9 bf LDA #191 1876 8549 cd 61 01 CMP extra_shipY 1877 854c b0 09 BCS .skipL0183 1878 854e .condpart60 1879 854e ad 61 01 LDA extra_shipY 1880 8551 38 SEC 1881 8552 e9 01 SBC #1 1882 8554 8d 61 01 STA extra_shipY 1883 8557 .skipL0183 1884 8557 .L0184 ;; if extra_shipY < 1 then extra_shipY = extra_shipY + 1 1885 8557 1886 8557 ad 61 01 LDA extra_shipY 1887 855a c9 01 CMP #1 1888 855c b0 09 BCS .skipL0184 1889 855e .condpart61 1890 855e ad 61 01 LDA extra_shipY 1891 8561 18 CLC 1892 8562 69 01 ADC #1 1893 8564 8d 61 01 STA extra_shipY 1894 8567 .skipL0184 1895 8567 . 1896 8567 ;; 1897 8567 1898 8567 .L0185 ;; z = 15 1899 8567 1900 8567 a9 0f LDA #15 1901 8569 85 ff STA z 1902 856b .despawn_Check 1903 856b ;; despawn_Check 1904 856b 1905 856b .L0186 ;; if enemy_shotX[z] > 160 || enemy_shotY[z] > 191 then enemy_shotFlag[z] = FALSE 1906 856b 1907 856b a9 a0 LDA #160 1908 856d a6 ff LDX z 1909 856f dd 4a 01 CMP enemy_shotX,x 1910 8572 b0 03 BCS .skipL0186 1911 8574 .condpart62 1912 8574 4c 80 85 jmp .condpart63 1913 8577 .skipL0186 1914 8577 a9 bf LDA #191 1915 8579 a6 ff LDX z 1916 857b dd 4b 01 CMP enemy_shotY,x 1917 857e b0 07 BCS .skip12OR 1918 8580 .condpart63 1919 8580 a9 00 LDA #FALSE 1920 8582 a6 ff LDX z 1921 8584 9d 4c 01 STA enemy_shotFlag,x 1922 8587 .skip12OR 1923 8587 .L0187 ;; z = z - 1 1924 8587 1925 8587 a5 ff LDA z 1926 8589 38 SEC 1927 858a e9 01 SBC #1 1928 858c 85 ff STA z 1929 858e .L0188 ;; if z < 15 then goto despawn_Check 1930 858e 1931 858e a5 ff LDA z 1932 8590 c9 0f CMP #15 1933 8592 b0 03 BCS .skipL0188 1934 8594 .condpart64 1935 8594 4c 6b 85 jmp .despawn_Check 1936 8597 1937 8597 .skipL0188 1938 8597 .L0189 ;; gosub move_enemyshot 1939 8597 1940 8597 20 57 8b jsr .move_enemyshot 1941 859a 1942 859a . 1943 859a ;; 1944 859a 1945 859a .L0190 ;; z = 15 1946 859a 1947 859a a9 0f LDA #15 1948 859c 85 ff STA z 1949 859e .draw_enemyshot 1950 859e ;; draw_enemyshot 1951 859e 1952 859e .L0191 ;; x = enemy_shotX[z] : y = enemy_shotY[z] 1953 859e 1954 859e a6 ff LDX z 1955 85a0 bd 4a 01 LDA enemy_shotX,x 1956 85a3 85 fd STA x 1957 85a5 a6 ff LDX z 1958 85a7 bd 4b 01 LDA enemy_shotY,x 1959 85aa 85 fe STA y 1960 85ac .L0192 ;; if enemy_shotFlag[z] = TRUE then plotsprite vertical_shooting_enemyshot 2 x y 1961 85ac 1962 85ac a6 ff LDX z 1963 85ae bd 4c 01 LDA enemy_shotFlag,x 1964 85b1 c9 01 CMP #TRUE 1965 85b3 d0 1b BNE .skipL0192 1966 85b5 .condpart65 1967 85b5 a9 32 lda #vertical_shooting_enemyshot 1971 85bb 85 43 sta temp2 1972 85bd 1973 85bd a9 5f lda #(64|vertical_shooting_enemyshot_width_twoscompliment) 1974 85bf 85 44 sta temp3 1975 85c1 1976 85c1 a5 fd lda x 1977 85c3 85 45 sta temp4 1978 85c5 1979 85c5 a5 fe lda y 1980 85c7 1981 85c7 85 46 sta temp5 1982 85c9 1983 85c9 a9 40 lda #(vertical_shooting_enemyshot_mode|%01000000) 1984 85cb 85 47 sta temp6 1985 85cd 1986 85cd 20 9b f2 jsr plotsprite 1987 85d0 .skipL0192 1988 85d0 .L0193 ;; z = z - 1 1989 85d0 1990 85d0 a5 ff LDA z 1991 85d2 38 SEC 1992 85d3 e9 01 SBC #1 1993 85d5 85 ff STA z 1994 85d7 .L0194 ;; if z < 15 then goto draw_enemyshot 1995 85d7 1996 85d7 a5 ff LDA z 1997 85d9 c9 0f CMP #15 1998 85db b0 03 BCS .skipL0194 1999 85dd .condpart66 2000 85dd 4c 9e 85 jmp .draw_enemyshot 2001 85e0 2002 85e0 .skipL0194 2003 85e0 . 2004 85e0 ;; 2005 85e0 2006 85e0 . 2007 85e0 ;; 2008 85e0 2009 85e0 .L0195 ;; if rDirection = 0 then power_upX = power_upX + rMovement5 : power_upY = power_upY + rMovement2 2010 85e0 2011 85e0 ad 4f 01 LDA rDirection 2012 85e3 c9 00 CMP #0 2013 85e5 d0 14 BNE .skipL0195 2014 85e7 .condpart67 2015 85e7 ad 50 01 LDA power_upX 2016 85ea 18 CLC 2017 85eb 6d 5c 01 ADC rMovement5 2018 85ee 8d 50 01 STA power_upX 2019 85f1 ad 51 01 LDA power_upY 2020 85f4 18 CLC 2021 85f5 6d 53 01 ADC rMovement2 2022 85f8 8d 51 01 STA power_upY 2023 85fb .skipL0195 2024 85fb .L0196 ;; if rDirection = 1 then power_upX = power_upX + rMovement3 : power_upY = power_upY + rMovement4 2025 85fb 2026 85fb ad 4f 01 LDA rDirection 2027 85fe c9 01 CMP #1 2028 8600 d0 14 BNE .skipL0196 2029 8602 .condpart68 2030 8602 ad 50 01 LDA power_upX 2031 8605 18 CLC 2032 8606 6d 5a 01 ADC rMovement3 2033 8609 8d 50 01 STA power_upX 2034 860c ad 51 01 LDA power_upY 2035 860f 18 CLC 2036 8610 6d 5b 01 ADC rMovement4 2037 8613 8d 51 01 STA power_upY 2038 8616 .skipL0196 2039 8616 .L0197 ;; if rDirection = 2 then power_upX = power_upX + rMovement1 : power_upY = power_upY + rMovement6 2040 8616 2041 8616 ad 4f 01 LDA rDirection 2042 8619 c9 02 CMP #2 2043 861b d0 14 BNE .skipL0197 2044 861d .condpart69 2045 861d ad 50 01 LDA power_upX 2046 8620 18 CLC 2047 8621 6d 4e 01 ADC rMovement1 2048 8624 8d 50 01 STA power_upX 2049 8627 ad 51 01 LDA power_upY 2050 862a 18 CLC 2051 862b 6d 5d 01 ADC rMovement6 2052 862e 8d 51 01 STA power_upY 2053 8631 .skipL0197 2054 8631 . 2055 8631 ;; 2056 8631 2057 8631 .L0198 ;; if rDirection = 0 then enemy01_X = enemy01_X + rMovement4 : enemy01_Y = enemy01_Y + rMovement2 2058 8631 2059 8631 ad 4f 01 LDA rDirection 2060 8634 c9 00 CMP #0 2061 8636 d0 14 BNE .skipL0198 2062 8638 .condpart70 2063 8638 ad 57 01 LDA enemy01_X 2064 863b 18 CLC 2065 863c 6d 5b 01 ADC rMovement4 2066 863f 8d 57 01 STA enemy01_X 2067 8642 ad 58 01 LDA enemy01_Y 2068 8645 18 CLC 2069 8646 6d 53 01 ADC rMovement2 2070 8649 8d 58 01 STA enemy01_Y 2071 864c .skipL0198 2072 864c .L0199 ;; if rDirection = 1 then enemy01_X = enemy01_X + rMovement3 : enemy01_Y = enemy01_Y + rMovement4 2073 864c 2074 864c ad 4f 01 LDA rDirection 2075 864f c9 01 CMP #1 2076 8651 d0 14 BNE .skipL0199 2077 8653 .condpart71 2078 8653 ad 57 01 LDA enemy01_X 2079 8656 18 CLC 2080 8657 6d 5a 01 ADC rMovement3 2081 865a 8d 57 01 STA enemy01_X 2082 865d ad 58 01 LDA enemy01_Y 2083 8660 18 CLC 2084 8661 6d 5b 01 ADC rMovement4 2085 8664 8d 58 01 STA enemy01_Y 2086 8667 .skipL0199 2087 8667 .L0200 ;; if rDirection = 2 then enemy01_X = enemy01_X + rMovement6 : enemy01_Y = enemy01_Y + rMovement6 2088 8667 2089 8667 ad 4f 01 LDA rDirection 2090 866a c9 02 CMP #2 2091 866c d0 14 BNE .skipL0200 2092 866e .condpart72 2093 866e ad 57 01 LDA enemy01_X 2094 8671 18 CLC 2095 8672 6d 5d 01 ADC rMovement6 2096 8675 8d 57 01 STA enemy01_X 2097 8678 ad 58 01 LDA enemy01_Y 2098 867b 18 CLC 2099 867c 6d 5d 01 ADC rMovement6 2100 867f 8d 58 01 STA enemy01_Y 2101 8682 .skipL0200 2102 8682 . 2103 8682 ;; 2104 8682 2105 8682 .L0201 ;; if rDirection = 0 then extra_shipX = extra_shipX + rMovement5 : extra_shipY = extra_shipY + rMovement2 2106 8682 2107 8682 ad 4f 01 LDA rDirection 2108 8685 c9 00 CMP #0 2109 8687 d0 14 BNE .skipL0201 2110 8689 .condpart73 2111 8689 ad 60 01 LDA extra_shipX 2112 868c 18 CLC 2113 868d 6d 5c 01 ADC rMovement5 2114 8690 8d 60 01 STA extra_shipX 2115 8693 ad 61 01 LDA extra_shipY 2116 8696 18 CLC 2117 8697 6d 53 01 ADC rMovement2 2118 869a 8d 61 01 STA extra_shipY 2119 869d .skipL0201 2120 869d . 2121 869d ;; 2122 869d 2123 869d .L0202 ;; if playerFlag = 1 && explosion_aniframe = 1 then playsfx sfx_explosion 2124 869d 2125 869d ad 4d 01 LDA playerFlag 2126 86a0 c9 01 CMP #1 2127 86a2 d0 20 BNE .skipL0202 2128 86a4 .condpart74 2129 86a4 ad 63 01 LDA explosion_aniframe 2130 86a7 c9 01 CMP #1 2131 86a9 d0 19 BNE .skip74then 2132 86ab .condpart75 2133 86ab ifnconst NOTIALOCKMUTE 2134 86ab a9 01 lda #1 2135 86ad 85 de sta sfxschedulelock 2136 86af a9 43 lda #sfx_explosion 2139 86b5 85 e1 sta sfxinstrumenthi 2140 86b7 a9 00 lda #0 2141 86b9 85 e2 sta sfxpitchoffset ; no pitch modification 2142 86bb 85 e3 sta sfxnoteindex ; not a musical note 2143 86bd 20 53 f2 jsr schedulesfx 2144 86c0 a9 00 lda #0 2145 86c2 85 de sta sfxschedulelock 2146 86c4 endif ; NOTIALOCKMUTE 2147 86c4 .skip74then 2148 86c4 .skipL0202 2149 86c4 .L0203 ;; if playerFlag = 1 then enemy_shotSlowdown = enemy_shotSlowdown + 1 2150 86c4 2151 86c4 ad 4d 01 LDA playerFlag 2152 86c7 c9 01 CMP #1 2153 86c9 d0 09 BNE .skipL0203 2154 86cb .condpart76 2155 86cb ad 56 01 LDA enemy_shotSlowdown 2156 86ce 18 CLC 2157 86cf 69 01 ADC #1 2158 86d1 8d 56 01 STA enemy_shotSlowdown 2159 86d4 .skipL0203 2160 86d4 .L0204 ;; if playerFlag = 1 && enemy_shotSlowdown = 8 then enemy_shotSlowdown = 0 2161 86d4 2162 86d4 ad 4d 01 LDA playerFlag 2163 86d7 c9 01 CMP #1 2164 86d9 d0 0c BNE .skipL0204 2165 86db .condpart77 2166 86db ad 56 01 LDA enemy_shotSlowdown 2167 86de c9 08 CMP #8 2168 86e0 d0 05 BNE .skip77then 2169 86e2 .condpart78 2170 86e2 a9 00 LDA #0 2171 86e4 8d 56 01 STA enemy_shotSlowdown 2172 86e7 .skip77then 2173 86e7 .skipL0204 2174 86e7 .L0205 ;; if playerFlag = 1 && enemy_shotSlowdown = 2 then explosion_aniframe = explosion_aniframe + 1 2175 86e7 2176 86e7 ad 4d 01 LDA playerFlag 2177 86ea c9 01 CMP #1 2178 86ec d0 10 BNE .skipL0205 2179 86ee .condpart79 2180 86ee ad 56 01 LDA enemy_shotSlowdown 2181 86f1 c9 02 CMP #2 2182 86f3 d0 09 BNE .skip79then 2183 86f5 .condpart80 2184 86f5 ad 63 01 LDA explosion_aniframe 2185 86f8 18 CLC 2186 86f9 69 01 ADC #1 2187 86fb 8d 63 01 STA explosion_aniframe 2188 86fe .skip79then 2189 86fe .skipL0205 2190 86fe .L0206 ;; if playerFlag = 1 && explosion_aniframe > 11 then explosion_aniframe = 200 2191 86fe 2192 86fe ad 4d 01 LDA playerFlag 2193 8701 c9 01 CMP #1 2194 8703 d0 0c BNE .skipL0206 2195 8705 .condpart81 2196 8705 a9 0b LDA #11 2197 8707 cd 63 01 CMP explosion_aniframe 2198 870a b0 05 BCS .skip81then 2199 870c .condpart82 2200 870c a9 c8 LDA #200 2201 870e 8d 63 01 STA explosion_aniframe 2202 8711 .skip81then 2203 8711 .skipL0206 2204 8711 . 2205 8711 ;; 2206 8711 2207 8711 ._mainLoopSkipJoystickCheck 2208 8711 ;; _mainLoopSkipJoystickCheck 2209 8711 2210 8711 .L0207 ;; restorescreen 2211 8711 2212 8711 20 99 f0 jsr restorescreen 2213 8714 .L0208 ;; gosub draw_scores 2214 8714 2215 8714 20 f6 88 jsr .draw_scores 2216 8717 2217 8717 .L0209 ;; gosub draw_sprites 2218 8717 2219 8717 20 20 87 jsr .draw_sprites 2220 871a 2221 871a .L0210 ;; drawscreen 2222 871a 2223 871a 20 bb f0 jsr drawscreen 2224 871d . 2225 871d ;; 2226 871d 2227 871d .L0211 ;; goto mainloop 2228 871d 2229 871d 4c 17 81 jmp .mainloop 2230 8720 2231 8720 . 2232 8720 ;; 2233 8720 2234 8720 . 2235 8720 ;; 2236 8720 2237 8720 .draw_sprites 2238 8720 ;; draw_sprites 2239 8720 2240 8720 .L0212 ;; plotsprite vertical_shooting_ship 0 playerX playerY 2241 8720 2242 8720 a9 2d lda #vertical_shooting_ship 2246 8726 85 43 sta temp2 2247 8728 2248 8728 a9 1e lda #(0|vertical_shooting_ship_width_twoscompliment) 2249 872a 85 44 sta temp3 2250 872c 2251 872c ad 41 01 lda playerX 2252 872f 85 45 sta temp4 2253 8731 2254 8731 ad 42 01 lda playerY 2255 8734 2256 8734 85 46 sta temp5 2257 8736 2258 8736 a9 40 lda #(vertical_shooting_ship_mode|%01000000) 2259 8738 85 47 sta temp6 2260 873a 2261 873a 20 9b f2 jsr plotsprite 2262 873d ; +tall sprite replot 2263 873d 18 clc 2264 873e a5 42 lda temp1 2265 8740 69 02 adc #vertical_shooting_ship_width 2266 8742 85 42 sta temp1 2267 8744 a5 46 lda temp5 2268 8746 69 08 adc #WZONEHEIGHT 2269 8748 85 46 sta temp5 2270 874a 20 9b f2 jsr plotsprite 2271 874d .L0213 ;; plotsprite vertical_shooting_bullet 1 bulletX bulletY 2272 874d 2273 874d a9 31 lda #vertical_shooting_bullet 2277 8753 85 43 sta temp2 2278 8755 2279 8755 a9 3f lda #(32|vertical_shooting_bullet_width_twoscompliment) 2280 8757 85 44 sta temp3 2281 8759 2282 8759 ad 48 01 lda bulletX 2283 875c 85 45 sta temp4 2284 875e 2285 875e ad 49 01 lda bulletY 2286 8761 2287 8761 85 46 sta temp5 2288 8763 2289 8763 a9 40 lda #(vertical_shooting_bullet_mode|%01000000) 2290 8765 85 47 sta temp6 2291 8767 2292 8767 20 9b f2 jsr plotsprite 2293 876a . 2294 876a ;; 2295 876a 2296 876a .L0214 ;; plotsprite vertical_shooting_powerup 3 power_upX power_upY 2297 876a 2298 876a a9 33 lda #vertical_shooting_powerup 2302 8770 85 43 sta temp2 2303 8772 2304 8772 a9 7e lda #(96|vertical_shooting_powerup_width_twoscompliment) 2305 8774 85 44 sta temp3 2306 8776 2307 8776 ad 50 01 lda power_upX 2308 8779 85 45 sta temp4 2309 877b 2310 877b ad 51 01 lda power_upY 2311 877e 2312 877e 85 46 sta temp5 2313 8780 2314 8780 a9 40 lda #(vertical_shooting_powerup_mode|%01000000) 2315 8782 85 47 sta temp6 2316 8784 2317 8784 20 9b f2 jsr plotsprite 2318 8787 .L0215 ;; plotsprite vertical_shooting_enemy01 2 enemy01_X enemy01_Y 2319 8787 2320 8787 a9 35 lda #vertical_shooting_enemy01 2324 878d 85 43 sta temp2 2325 878f 2326 878f a9 5e lda #(64|vertical_shooting_enemy01_width_twoscompliment) 2327 8791 85 44 sta temp3 2328 8793 2329 8793 ad 57 01 lda enemy01_X 2330 8796 85 45 sta temp4 2331 8798 2332 8798 ad 58 01 lda enemy01_Y 2333 879b 2334 879b 85 46 sta temp5 2335 879d 2336 879d a9 40 lda #(vertical_shooting_enemy01_mode|%01000000) 2337 879f 85 47 sta temp6 2338 87a1 2339 87a1 20 9b f2 jsr plotsprite 2340 87a4 ; +tall sprite replot 2341 87a4 18 clc 2342 87a5 a5 42 lda temp1 2343 87a7 69 02 adc #vertical_shooting_enemy01_width 2344 87a9 85 42 sta temp1 2345 87ab a5 46 lda temp5 2346 87ad 69 08 adc #WZONEHEIGHT 2347 87af 85 46 sta temp5 2348 87b1 20 9b f2 jsr plotsprite 2349 87b4 .L0216 ;; plotsprite vertical_shooting_1up 0 extra_shipX extra_shipY 2350 87b4 2351 87b4 a9 39 lda #vertical_shooting_1up 2355 87ba 85 43 sta temp2 2356 87bc 2357 87bc a9 1e lda #(0|vertical_shooting_1up_width_twoscompliment) 2358 87be 85 44 sta temp3 2359 87c0 2360 87c0 ad 60 01 lda extra_shipX 2361 87c3 85 45 sta temp4 2362 87c5 2363 87c5 ad 61 01 lda extra_shipY 2364 87c8 2365 87c8 85 46 sta temp5 2366 87ca 2367 87ca a9 40 lda #(vertical_shooting_1up_mode|%01000000) 2368 87cc 85 47 sta temp6 2369 87ce 2370 87ce 20 9b f2 jsr plotsprite 2371 87d1 .L0217 ;; plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2372 87d1 2373 87d1 a9 3b lda #vertical_shooting_explosion_01 2385 87e2 85 43 sta temp2 2386 87e4 2387 87e4 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2388 87e6 85 44 sta temp3 2389 87e8 2390 87e8 ad 41 01 lda playerX 2391 87eb 85 45 sta temp4 2392 87ed 2393 87ed ad 42 01 lda playerY 2394 87f0 85 46 sta temp5 2395 87f2 2396 87f2 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2397 87f4 85 47 sta temp6 2398 87f6 2399 87f6 20 9b f2 jsr plotsprite 2400 87f9 ; +tall sprite replot 2401 87f9 18 clc 2402 87fa a5 42 lda temp1 2403 87fc 69 02 adc #vertical_shooting_explosion_01_width 2404 87fe 85 42 sta temp1 2405 8800 a5 46 lda temp5 2406 8802 69 08 adc #WZONEHEIGHT 2407 8804 85 46 sta temp5 2408 8806 20 9b f2 jsr plotsprite 2409 8809 .L0218 ;; plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2410 8809 2411 8809 a9 3b lda #vertical_shooting_explosion_01 2423 881a 85 43 sta temp2 2424 881c 2425 881c a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2426 881e 85 44 sta temp3 2427 8820 2428 8820 ad 57 01 lda enemy01_X 2429 8823 85 45 sta temp4 2430 8825 2431 8825 ad 58 01 lda enemy01_Y 2432 8828 85 46 sta temp5 2433 882a 2434 882a a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2435 882c 85 47 sta temp6 2436 882e 2437 882e 20 9b f2 jsr plotsprite 2438 8831 ; +tall sprite replot 2439 8831 18 clc 2440 8832 a5 42 lda temp1 2441 8834 69 02 adc #vertical_shooting_explosion_01_width 2442 8836 85 42 sta temp1 2443 8838 a5 46 lda temp5 2444 883a 69 08 adc #WZONEHEIGHT 2445 883c 85 46 sta temp5 2446 883e 20 9b f2 jsr plotsprite 2447 8841 .L0219 ;; plotsprite vertical_shooting_laser 0 twinlaserX twinlaserY 2448 8841 2449 8841 a9 f3 lda #vertical_shooting_laser 2453 8847 85 43 sta temp2 2454 8849 2455 8849 a9 1f lda #(0|vertical_shooting_laser_width_twoscompliment) 2456 884b 85 44 sta temp3 2457 884d 2458 884d ad 65 01 lda twinlaserX 2459 8850 85 45 sta temp4 2460 8852 2461 8852 ad 66 01 lda twinlaserY 2462 8855 2463 8855 85 46 sta temp5 2464 8857 2465 8857 a9 40 lda #(vertical_shooting_laser_mode|%01000000) 2466 8859 85 47 sta temp6 2467 885b 2468 885b 20 9b f2 jsr plotsprite 2469 885e ; +tall sprite replot 2470 885e 18 clc 2471 885f a5 42 lda temp1 2472 8861 69 01 adc #vertical_shooting_laser_width 2473 8863 85 42 sta temp1 2474 8865 a5 46 lda temp5 2475 8867 69 08 adc #WZONEHEIGHT 2476 8869 85 46 sta temp5 2477 886b 20 9b f2 jsr plotsprite 2478 886e .L0220 ;; if playerFlag = 1 then plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2479 886e 2480 886e ad 4d 01 LDA playerFlag 2481 8871 c9 01 CMP #1 2482 8873 d0 38 BNE .skipL0220 2483 8875 .condpart83 2484 8875 a9 3b lda #vertical_shooting_explosion_01 2496 8886 85 43 sta temp2 2497 8888 2498 8888 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2499 888a 85 44 sta temp3 2500 888c 2501 888c ad 41 01 lda playerX 2502 888f 85 45 sta temp4 2503 8891 2504 8891 ad 42 01 lda playerY 2505 8894 85 46 sta temp5 2506 8896 2507 8896 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2508 8898 85 47 sta temp6 2509 889a 2510 889a 20 9b f2 jsr plotsprite 2511 889d ; +tall sprite replot 2512 889d 18 clc 2513 889e a5 42 lda temp1 2514 88a0 69 02 adc #vertical_shooting_explosion_01_width 2515 88a2 85 42 sta temp1 2516 88a4 a5 46 lda temp5 2517 88a6 69 08 adc #WZONEHEIGHT 2518 88a8 85 46 sta temp5 2519 88aa 20 9b f2 jsr plotsprite 2520 88ad .skipL0220 2521 88ad .L0221 ;; if enemy01_Flag = 1 then plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2522 88ad 2523 88ad ad 59 01 LDA enemy01_Flag 2524 88b0 c9 01 CMP #1 2525 88b2 d0 38 BNE .skipL0221 2526 88b4 .condpart84 2527 88b4 a9 3b lda #vertical_shooting_explosion_01 2539 88c5 85 43 sta temp2 2540 88c7 2541 88c7 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2542 88c9 85 44 sta temp3 2543 88cb 2544 88cb ad 57 01 lda enemy01_X 2545 88ce 85 45 sta temp4 2546 88d0 2547 88d0 ad 58 01 lda enemy01_Y 2548 88d3 85 46 sta temp5 2549 88d5 2550 88d5 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2551 88d7 85 47 sta temp6 2552 88d9 2553 88d9 20 9b f2 jsr plotsprite 2554 88dc ; +tall sprite replot 2555 88dc 18 clc 2556 88dd a5 42 lda temp1 2557 88df 69 02 adc #vertical_shooting_explosion_01_width 2558 88e1 85 42 sta temp1 2559 88e3 a5 46 lda temp5 2560 88e5 69 08 adc #WZONEHEIGHT 2561 88e7 85 46 sta temp5 2562 88e9 20 9b f2 jsr plotsprite 2563 88ec .skipL0221 2564 88ec .L0222 ;; return 2565 88ec 2566 88ec ba tsx 2567 88ed bd 02 01 lda $102,x 2568 88f0 f0 01 beq bankswitchret5 2569 88f2 60 RTS 2570 88f3 bankswitchret5 2571 88f3 4c 7a f4 JMP BS_return 2572 88f6 . 2573 88f6 ;; 2574 88f6 2575 88f6 .draw_scores 2576 88f6 ;; draw_scores 2577 88f6 2578 88f6 .L0223 ;; plotvalue vertical_shooting_font 0 score0 6 25 1 2579 88f6 2580 88f6 a9 00 lda #vertical_shooting_font 2584 88fc 85 43 sta temp2 2585 88fe 2586 88fe ad 06 21 lda charactermode 2587 8901 85 4a sta temp9 2588 8903 a9 60 lda #(vertical_shooting_font_mode | %01100000) 2589 8905 8d 06 21 sta charactermode 2590 8908 a9 1a lda #26 ; width in two's complement 2591 890a 09 00 ora #0 ; palette left shifted 5 bits 2592 890c 85 44 sta temp3 2593 890e a9 19 lda #25 2594 8910 85 45 sta temp4 2595 8912 2596 8912 a9 01 lda #1 2597 8914 85 46 sta temp5 2598 8916 2599 8916 a9 06 lda #6 2600 8918 85 47 sta temp6 2601 891a 2602 891a a9 a6 lda #score0 2606 8920 85 49 sta temp8 2607 8922 2608 8922 20 89 f3 jsr plotvalue 2609 8922 00 01 USED_PLOTVALUE = 1 2610 8925 a5 4a lda temp9 2611 8927 8d 06 21 sta charactermode 2612 892a .L0224 ;; plotvalue vertical_shooting_font 0 lives 1 153 1 2613 892a 2614 892a a9 00 lda #vertical_shooting_font 2618 8930 85 43 sta temp2 2619 8932 2620 8932 ad 06 21 lda charactermode 2621 8935 85 4a sta temp9 2622 8937 a9 60 lda #(vertical_shooting_font_mode | %01100000) 2623 8939 8d 06 21 sta charactermode 2624 893c a9 1f lda #31 ; width in two's complement 2625 893e 09 00 ora #0 ; palette left shifted 5 bits 2626 8940 85 44 sta temp3 2627 8942 a9 99 lda #153 2628 8944 85 45 sta temp4 2629 8946 2630 8946 a9 01 lda #1 2631 8948 85 46 sta temp5 2632 894a 2633 894a a9 01 lda #1 2634 894c 85 47 sta temp6 2635 894e 2636 894e a9 64 lda #lives 2640 8954 85 49 sta temp8 2641 8956 2642 8956 20 89 f3 jsr plotvalue 2643 8956 00 01 USED_PLOTVALUE = 1 2644 8959 a5 4a lda temp9 2645 895b 8d 06 21 sta charactermode 2646 895e .L0225 ;; return 2647 895e 2648 895e ba tsx 2649 895f bd 02 01 lda $102,x 2650 8962 f0 01 beq bankswitchret6 2651 8964 60 RTS 2652 8965 bankswitchret6 2653 8965 4c 7a f4 JMP BS_return 2654 8968 . 2655 8968 ;; 2656 8968 2657 8968 .fire_enemybullet 2658 8968 ;; fire_enemybullet 2659 8968 2660 8968 .L0226 ;; z = 15 2661 8968 2662 8968 a9 0f LDA #15 2663 896a 85 ff STA z 2664 896c .L0227 ;; if enemy_shotFlag[z] = TRUE then goto skip_enemy_shot 2665 896c 2666 896c a6 ff LDX z 2667 896e bd 4c 01 LDA enemy_shotFlag,x 2668 8971 c9 01 CMP #TRUE 2669 8973 d0 03 BNE .skipL0227 2670 8975 .condpart85 2671 8975 4c 3d 8b jmp .skip_enemy_shot 2672 8978 2673 8978 .skipL0227 2674 8978 .L0228 ;; enemy_shotFlag[z] = TRUE 2675 8978 2676 8978 a9 01 LDA #TRUE 2677 897a a6 ff LDX z 2678 897c 9d 4c 01 STA enemy_shotFlag,x 2679 897f .L0229 ;; enemy_shotX[z] = enemy01_X + 2 2680 897f 2681 897f ad 57 01 LDA enemy01_X 2682 8982 18 CLC 2683 8983 69 02 ADC #2 2684 8985 a6 ff LDX z 2685 8987 9d 4a 01 STA enemy_shotX,x 2686 898a .L0230 ;; enemy_shotY[z] = enemy01_Y + 4 2687 898a 2688 898a ad 58 01 LDA enemy01_Y 2689 898d 18 CLC 2690 898e 69 04 ADC #4 2691 8990 a6 ff LDX z 2692 8992 9d 4b 01 STA enemy_shotY,x 2693 8995 . 2694 8995 ;; 2695 8995 2696 8995 .L0231 ;; temp_XSu = 0 : temp_YSu = 0 2697 8995 2698 8995 a9 00 LDA #0 2699 8997 8d 71 01 STA temp_XSu 2700 899a 8d 73 01 STA temp_YSu 2701 899d .L0232 ;; if playerX = enemy_shotX[z] then temp_XSf = 0 2702 899d 2703 899d ad 41 01 LDA playerX 2704 89a0 a6 ff LDX z 2705 89a2 dd 4a 01 CMP enemy_shotX,x 2706 89a5 d0 05 BNE .skipL0232 2707 89a7 .condpart86 2708 89a7 a9 00 LDA #0 2709 89a9 8d 72 01 STA temp_XSf 2710 89ac .skipL0232 2711 89ac .L0233 ;; if playerX > enemy_shotX[z] then temp_XSf = playerX - enemy_shotX[z] 2712 89ac 2713 89ac a6 ff LDX z 2714 89ae bd 4a 01 LDA enemy_shotX,x 2715 89b1 cd 41 01 CMP playerX 2716 89b4 b0 0c BCS .skipL0233 2717 89b6 .condpart87 2718 89b6 ad 41 01 LDA playerX 2719 89b9 a6 ff LDX z 2720 89bb 38 SEC 2721 89bc fd 4a 01 SBC enemy_shotX,x 2722 89bf 8d 72 01 STA temp_XSf 2723 89c2 .skipL0233 2724 89c2 .L0234 ;; if playerX < enemy_shotX[z] then temp_XSf = enemy_shotX[z] - playerX 2725 89c2 2726 89c2 ad 41 01 LDA playerX 2727 89c5 a6 ff LDX z 2728 89c7 dd 4a 01 CMP enemy_shotX,x 2729 89ca b0 0c BCS .skipL0234 2730 89cc .condpart88 2731 89cc a6 ff LDX z 2732 89ce bd 4a 01 LDA enemy_shotX,x 2733 89d1 38 SEC 2734 89d2 ed 41 01 SBC playerX 2735 89d5 8d 72 01 STA temp_XSf 2736 89d8 .skipL0234 2737 89d8 .L0235 ;; if playerY = enemy_shotY[z] then temp_YSf = 0 2738 89d8 2739 89d8 ad 42 01 LDA playerY 2740 89db a6 ff LDX z 2741 89dd dd 4b 01 CMP enemy_shotY,x 2742 89e0 d0 05 BNE .skipL0235 2743 89e2 .condpart89 2744 89e2 a9 00 LDA #0 2745 89e4 8d 74 01 STA temp_YSf 2746 89e7 .skipL0235 2747 89e7 .L0236 ;; if playerY > enemy_shotY[z] then temp_YSf = playerY - enemy_shotY[z] 2748 89e7 2749 89e7 a6 ff LDX z 2750 89e9 bd 4b 01 LDA enemy_shotY,x 2751 89ec cd 42 01 CMP playerY 2752 89ef b0 0c BCS .skipL0236 2753 89f1 .condpart90 2754 89f1 ad 42 01 LDA playerY 2755 89f4 a6 ff LDX z 2756 89f6 38 SEC 2757 89f7 fd 4b 01 SBC enemy_shotY,x 2758 89fa 8d 74 01 STA temp_YSf 2759 89fd .skipL0236 2760 89fd .L0237 ;; if playerY < enemy_shotY[z] then temp_YSf = enemy_shotY[z] - playerY 2761 89fd 2762 89fd ad 42 01 LDA playerY 2763 8a00 a6 ff LDX z 2764 8a02 dd 4b 01 CMP enemy_shotY,x 2765 8a05 b0 0c BCS .skipL0237 2766 8a07 .condpart91 2767 8a07 a6 ff LDX z 2768 8a09 bd 4b 01 LDA enemy_shotY,x 2769 8a0c 38 SEC 2770 8a0d ed 42 01 SBC playerY 2771 8a10 8d 74 01 STA temp_YSf 2772 8a13 .skipL0237 2773 8a13 .L0238 ;; w = ( rand / 16 ) 2774 8a13 2775 8a13 ; complex statement detected 2776 8a13 20 f8 f3 jsr randomize 2777 8a16 4a lsr 2778 8a17 4a lsr 2779 8a18 4a lsr 2780 8a19 4a lsr 2781 8a1a 85 fc STA w 2782 8a1c .L0239 ;; if temp_XSf > 8 then temp_XSf = temp_XSf + w - 8 else temp_XSf = temp_XSf + w 2783 8a1c 2784 8a1c a9 08 LDA #8 2785 8a1e cd 72 01 CMP temp_XSf 2786 8a21 b0 0f BCS .skipL0239 2787 8a23 .condpart92 2788 8a23 ; complex statement detected 2789 8a23 ad 72 01 LDA temp_XSf 2790 8a26 18 CLC 2791 8a27 65 fc ADC w 2792 8a29 38 SEC 2793 8a2a e9 08 SBC #8 2794 8a2c 8d 72 01 STA temp_XSf 2795 8a2f 4c 3b 8a jmp .skipelse0 2796 8a32 .skipL0239 2797 8a32 ad 72 01 LDA temp_XSf 2798 8a35 18 CLC 2799 8a36 65 fc ADC w 2800 8a38 8d 72 01 STA temp_XSf 2801 8a3b .skipelse0 2802 8a3b .L0240 ;; w = ( rand / 16 ) 2803 8a3b 2804 8a3b ; complex statement detected 2805 8a3b 20 f8 f3 jsr randomize 2806 8a3e 4a lsr 2807 8a3f 4a lsr 2808 8a40 4a lsr 2809 8a41 4a lsr 2810 8a42 85 fc STA w 2811 8a44 .L0241 ;; if temp_YSf > 8 then temp_YSf = temp_YSf + w - 8 else temp_YSf = temp_YSf + w 2812 8a44 2813 8a44 a9 08 LDA #8 2814 8a46 cd 74 01 CMP temp_YSf 2815 8a49 b0 0f BCS .skipL0241 2816 8a4b .condpart93 2817 8a4b ; complex statement detected 2818 8a4b ad 74 01 LDA temp_YSf 2819 8a4e 18 CLC 2820 8a4f 65 fc ADC w 2821 8a51 38 SEC 2822 8a52 e9 08 SBC #8 2823 8a54 8d 74 01 STA temp_YSf 2824 8a57 4c 63 8a jmp .skipelse1 2825 8a5a .skipL0241 2826 8a5a ad 74 01 LDA temp_YSf 2827 8a5d 18 CLC 2828 8a5e 65 fc ADC w 2829 8a60 8d 74 01 STA temp_YSf 2830 8a63 .skipelse1 2831 8a63 . 2832 8a63 ;; 2833 8a63 2834 8a63 .L0242 ;; if temp_YSf = 0 && temp_XSf = 0 then enemy_shotFlag[z] = FALSE : return 2835 8a63 2836 8a63 ad 74 01 LDA temp_YSf 2837 8a66 c9 00 CMP #0 2838 8a68 d0 18 BNE .skipL0242 2839 8a6a .condpart94 2840 8a6a ad 72 01 LDA temp_XSf 2841 8a6d c9 00 CMP #0 2842 8a6f d0 11 BNE .skip94then 2843 8a71 .condpart95 2844 8a71 a9 00 LDA #FALSE 2845 8a73 a6 ff LDX z 2846 8a75 9d 4c 01 STA enemy_shotFlag,x 2847 8a78 ba tsx 2848 8a79 bd 02 01 lda $102,x 2849 8a7c f0 01 beq bankswitchret7 2850 8a7e 60 RTS 2851 8a7f bankswitchret7 2852 8a7f 4c 7a f4 JMP BS_return 2853 8a82 .skip94then 2854 8a82 .skipL0242 2855 8a82 . 2856 8a82 ;; 2857 8a82 2858 8a82 .L0243 ;; if playerX <= enemy_shotX[z] then enemy_shotDirection[z] = enemy_shotDirection[z] | %00000010 else enemy_shotDirection[z] = enemy_shotDirection & %11111101 2859 8a82 2860 8a82 a6 ff LDX z 2861 8a84 bd 4a 01 LDA enemy_shotX,x 2862 8a87 cd 41 01 CMP playerX 2863 8a8a 90 0f BCC .skipL0243 2864 8a8c .condpart96 2865 8a8c a6 ff LDX z 2866 8a8e bd 6c 01 LDA enemy_shotDirection,x 2867 8a91 09 02 ORA #%00000010 2868 8a93 a6 ff LDX z 2869 8a95 9d 6c 01 STA enemy_shotDirection,x 2870 8a98 4c a5 8a jmp .skipelse2 2871 8a9b .skipL0243 2872 8a9b ad 6c 01 LDA enemy_shotDirection 2873 8a9e 29 fd AND #%11111101 2874 8aa0 a6 ff LDX z 2875 8aa2 9d 6c 01 STA enemy_shotDirection,x 2876 8aa5 .skipelse2 2877 8aa5 .L0244 ;; if playerY <= enemy_shotY[z] then enemy_shotDirection[z] = enemy_shotDirection[z] | %00000001 else enemy_shotDirection[z] = enemy_shotDirection & %11111110 2878 8aa5 2879 8aa5 a6 ff LDX z 2880 8aa7 bd 4b 01 LDA enemy_shotY,x 2881 8aaa cd 42 01 CMP playerY 2882 8aad 90 0f BCC .skipL0244 2883 8aaf .condpart97 2884 8aaf a6 ff LDX z 2885 8ab1 bd 6c 01 LDA enemy_shotDirection,x 2886 8ab4 09 01 ORA #%00000001 2887 8ab6 a6 ff LDX z 2888 8ab8 9d 6c 01 STA enemy_shotDirection,x 2889 8abb 4c c8 8a jmp .skipelse3 2890 8abe .skipL0244 2891 8abe ad 6c 01 LDA enemy_shotDirection 2892 8ac1 29 fe AND #%11111110 2893 8ac3 a6 ff LDX z 2894 8ac5 9d 6c 01 STA enemy_shotDirection,x 2895 8ac8 .skipelse3 2896 8ac8 . 2897 8ac8 ;; 2898 8ac8 2899 8ac8 .L0245 ;; temp_XSu = 0 : temp_YSu = 0 : total_XSu = 0 : total_XSf = 0 : total_YSu = 0 : total_YSf = 0 2900 8ac8 2901 8ac8 a9 00 LDA #0 2902 8aca 8d 71 01 STA temp_XSu 2903 8acd 8d 73 01 STA temp_YSu 2904 8ad0 8d 6d 01 STA total_XSu 2905 8ad3 8d 6e 01 STA total_XSf 2906 8ad6 8d 6f 01 STA total_YSu 2907 8ad9 8d 70 01 STA total_YSf 2908 8adc . 2909 8adc ;; 2910 8adc 2911 8adc .es_SpeedIncrease 2912 8adc ;; es_SpeedIncrease 2913 8adc 2914 8adc .L0246 ;; total_speedX = total_speedX + temp_speedX 2915 8adc 2916 8adc ad 6e 01 LDA total_XSf 2917 8adf 18 CLC 2918 8ae0 6d 72 01 ADC temp_XSf 2919 8ae3 8d 6e 01 STA total_XSf 2920 8ae6 ad 6d 01 LDA total_speedX 2921 8ae9 6d 71 01 ADC temp_speedX 2922 8aec 8d 6d 01 STA total_speedX 2923 8aef .L0247 ;; total_speedY = total_speedY + temp_speedY 2924 8aef 2925 8aef ad 70 01 LDA total_YSf 2926 8af2 18 CLC 2927 8af3 6d 74 01 ADC temp_YSf 2928 8af6 8d 70 01 STA total_YSf 2929 8af9 ad 6f 01 LDA total_speedY 2930 8afc 6d 73 01 ADC temp_speedY 2931 8aff 8d 6f 01 STA total_speedY 2932 8b02 .L0248 ;; if total_XSu = 0 && total_YSu = 0 then goto es_SpeedIncrease 2933 8b02 2934 8b02 ad 6d 01 LDA total_XSu 2935 8b05 c9 00 CMP #0 2936 8b07 d0 0a BNE .skipL0248 2937 8b09 .condpart98 2938 8b09 ad 6f 01 LDA total_YSu 2939 8b0c c9 00 CMP #0 2940 8b0e d0 03 BNE .skip98then 2941 8b10 .condpart99 2942 8b10 4c dc 8a jmp .es_SpeedIncrease 2943 8b13 2944 8b13 .skip98then 2945 8b13 .skipL0248 2946 8b13 .L0249 ;; enemy_shotXf[z] = total_XSu 2947 8b13 2948 8b13 ad 6d 01 LDA total_XSu 2949 8b16 a6 ff LDX z 2950 8b18 9d 00 22 STA enemy_shotXf,x 2951 8b1b .L0250 ;; enemy_shotSXf[z] = total_XSf 2952 8b1b 2953 8b1b ad 6e 01 LDA total_XSf 2954 8b1e a6 ff LDX z 2955 8b20 9d 40 22 STA enemy_shotSXf,x 2956 8b23 .L0251 ;; enemy_shotYf[z] = total_YSu 2957 8b23 2958 8b23 ad 6f 01 LDA total_YSu 2959 8b26 a6 ff LDX z 2960 8b28 9d 10 22 STA enemy_shotYf,x 2961 8b2b .L0252 ;; enemy_shotSYf[z] = total_YSf 2962 8b2b 2963 8b2b ad 70 01 LDA total_YSf 2964 8b2e a6 ff LDX z 2965 8b30 9d 50 22 STA enemy_shotSYf,x 2966 8b33 .L0253 ;; return 2967 8b33 2968 8b33 ba tsx 2969 8b34 bd 02 01 lda $102,x 2970 8b37 f0 01 beq bankswitchret8 2971 8b39 60 RTS 2972 8b3a bankswitchret8 2973 8b3a 4c 7a f4 JMP BS_return 2974 8b3d . 2975 8b3d ;; 2976 8b3d 2977 8b3d .skip_enemy_shot 2978 8b3d ;; skip_enemy_shot 2979 8b3d 2980 8b3d .L0254 ;; z = z - 1 2981 8b3d 2982 8b3d a5 ff LDA z 2983 8b3f 38 SEC 2984 8b40 e9 01 SBC #1 2985 8b42 85 ff STA z 2986 8b44 .L0255 ;; if z < 15 then fire_enemybullet 2987 8b44 2988 8b44 a5 ff LDA z 2989 8b46 c9 0f CMP #15 2990 8b48 - if ((* - .fire_enemybullet) < 127) && ((* - .fire_enemybullet) > -128) 2991 8b48 - bcc .fire_enemybullet 2992 8b48 else 2993 8b48 b0 03 bcs .0skipfire_enemybullet 2994 8b4a 4c 68 89 jmp .fire_enemybullet 2995 8b4d .0skipfire_enemybullet 2996 8b4d endif 2997 8b4d .L0256 ;; return 2998 8b4d 2999 8b4d ba tsx 3000 8b4e bd 02 01 lda $102,x 3001 8b51 f0 01 beq bankswitchret9 3002 8b53 60 RTS 3003 8b54 bankswitchret9 3004 8b54 4c 7a f4 JMP BS_return 3005 8b57 . 3006 8b57 ;; 3007 8b57 3008 8b57 .move_enemyshot 3009 8b57 ;; move_enemyshot 3010 8b57 3011 8b57 .L0257 ;; z = 15 3012 8b57 3013 8b57 a9 0f LDA #15 3014 8b59 85 ff STA z 3015 8b5b .update_enemyshot 3016 8b5b ;; update_enemyshot 3017 8b5b 3018 8b5b .L0258 ;; var54 = enemy_shotY[z] 3019 8b5b 3020 8b5b a6 ff LDX z 3021 8b5d bd 4b 01 LDA enemy_shotY,x 3022 8b60 8d 76 01 STA var54 3023 8b63 .L0259 ;; var91 = enemy_shotYf[z] 3024 8b63 3025 8b63 a6 ff LDX z 3026 8b65 bd 10 22 LDA enemy_shotYf,x 3027 8b68 8d 9b 01 STA var91 3028 8b6b .L0260 ;; var53 = enemy_shotX[z] 3029 8b6b 3030 8b6b a6 ff LDX z 3031 8b6d bd 4a 01 LDA enemy_shotX,x 3032 8b70 8d 75 01 STA var53 3033 8b73 .L0261 ;; var93 = enemy_shotXf[z] 3034 8b73 3035 8b73 a6 ff LDX z 3036 8b75 bd 00 22 LDA enemy_shotXf,x 3037 8b78 8d 9d 01 STA var93 3038 8b7b .L0262 ;; var96 = enemy_shotSX[z] 3039 8b7b 3040 8b7b a6 ff LDX z 3041 8b7d bd 20 22 LDA enemy_shotSX,x 3042 8b80 8d a0 01 STA var96 3043 8b83 .L0263 ;; var97 = enemy_shotSXf[z] 3044 8b83 3045 8b83 a6 ff LDX z 3046 8b85 bd 40 22 LDA enemy_shotSXf,x 3047 8b88 8d a1 01 STA var97 3048 8b8b .L0264 ;; var98 = enemy_shotSY[z] 3049 8b8b 3050 8b8b a6 ff LDX z 3051 8b8d bd 30 22 LDA enemy_shotSY,x 3052 8b90 8d a2 01 STA var98 3053 8b93 .L0265 ;; var99 = enemy_shotSYf[z] 3054 8b93 3055 8b93 a6 ff LDX z 3056 8b95 bd 50 22 LDA enemy_shotSYf,x 3057 8b98 8d a3 01 STA var99 3058 8b9b . 3059 8b9b ;; 3060 8b9b 3061 8b9b .L0266 ;; if ( enemy_shotDirection[z] & 1 ) = 1 then mob_Y = mob_Y - mob_speedY else mob_Y = mob_Y + mob_speedY 3062 8b9b 3063 8b9b ; complex condition detected 3064 8b9b ; complex statement detected 3065 8b9b a6 ff LDX z 3066 8b9d bd 6c 01 LDA enemy_shotDirection,x 3067 8ba0 29 01 AND #1 3068 8ba2 c9 01 CMP #1 3069 8ba4 d0 16 BNE .skipL0266 3070 8ba6 .condpart100 3071 8ba6 ad 9f 01 LDA var95 3072 8ba9 38 SEC 3073 8baa ed a3 01 SBC var99 3074 8bad 8d 9f 01 STA var95 3075 8bb0 ad 9e 01 LDA mob_Y 3076 8bb3 ed a2 01 SBC mob_speedY 3077 8bb6 8d 9e 01 STA mob_Y 3078 8bb9 4c cf 8b jmp .skipelse4 3079 8bbc .skipL0266 3080 8bbc ad 9f 01 LDA var95 3081 8bbf 18 CLC 3082 8bc0 6d a3 01 ADC var99 3083 8bc3 8d 9f 01 STA var95 3084 8bc6 ad 9e 01 LDA mob_Y 3085 8bc9 6d a2 01 ADC mob_speedY 3086 8bcc 8d 9e 01 STA mob_Y 3087 8bcf .skipelse4 3088 8bcf .L0267 ;; if ( enemy_shotDirection[z] & 2 ) = 2 then mob_X = mob_X - mob_speedX else mob_X = mob_X + mob_speedX 3089 8bcf 3090 8bcf ; complex condition detected 3091 8bcf ; complex statement detected 3092 8bcf a6 ff LDX z 3093 8bd1 bd 6c 01 LDA enemy_shotDirection,x 3094 8bd4 29 02 AND #2 3095 8bd6 c9 02 CMP #2 3096 8bd8 d0 16 BNE .skipL0267 3097 8bda .condpart101 3098 8bda ad 9d 01 LDA var93 3099 8bdd 38 SEC 3100 8bde ed a1 01 SBC var97 3101 8be1 8d 9d 01 STA var93 3102 8be4 ad 9c 01 LDA mob_X 3103 8be7 ed a0 01 SBC mob_speedX 3104 8bea 8d 9c 01 STA mob_X 3105 8bed 4c 03 8c jmp .skipelse5 3106 8bf0 .skipL0267 3107 8bf0 ad 9d 01 LDA var93 3108 8bf3 18 CLC 3109 8bf4 6d a1 01 ADC var97 3110 8bf7 8d 9d 01 STA var93 3111 8bfa ad 9c 01 LDA mob_X 3112 8bfd 6d a0 01 ADC mob_speedX 3113 8c00 8d 9c 01 STA mob_X 3114 8c03 .skipelse5 3115 8c03 . 3116 8c03 ;; 3117 8c03 3118 8c03 .L0268 ;; enemy_shotY[z] = var54 3119 8c03 3120 8c03 ad 76 01 LDA var54 3121 8c06 a6 ff LDX z 3122 8c08 9d 4b 01 STA enemy_shotY,x 3123 8c0b .L0269 ;; enemy_shotYf[z] = var91 3124 8c0b 3125 8c0b ad 9b 01 LDA var91 3126 8c0e a6 ff LDX z 3127 8c10 9d 10 22 STA enemy_shotYf,x 3128 8c13 .L0270 ;; enemy_shotX[z] = var53 3129 8c13 3130 8c13 ad 75 01 LDA var53 3131 8c16 a6 ff LDX z 3132 8c18 9d 4a 01 STA enemy_shotX,x 3133 8c1b .L0271 ;; enemy_shotXf[z] = var93 3134 8c1b 3135 8c1b ad 9d 01 LDA var93 3136 8c1e a6 ff LDX z 3137 8c20 9d 00 22 STA enemy_shotXf,x 3138 8c23 . 3139 8c23 ;; 3140 8c23 3141 8c23 .L0272 ;; z = z - 1 3142 8c23 3143 8c23 a5 ff LDA z 3144 8c25 38 SEC 3145 8c26 e9 01 SBC #1 3146 8c28 85 ff STA z 3147 8c2a .L0273 ;; if z < 15 then goto update_enemyshot 3148 8c2a 3149 8c2a a5 ff LDA z 3150 8c2c c9 0f CMP #15 3151 8c2e b0 03 BCS .skipL0273 3152 8c30 .condpart102 3153 8c30 4c 5b 8b jmp .update_enemyshot 3154 8c33 3155 8c33 .skipL0273 3156 8c33 .L0274 ;; return 3157 8c33 3158 8c33 ba tsx 3159 8c34 bd 02 01 lda $102,x 3160 8c37 f0 01 beq bankswitchret10 3161 8c39 60 RTS 3162 8c3a bankswitchret10 3163 8c3a 4c 7a f4 JMP BS_return 3164 8c3d . 3165 8c3d ;; 3166 8c3d 3167 8c3d . 3168 8c3d ;; 3169 8c3d 3170 8c3d .check_collisions 3171 8c3d ;; check_collisions 3172 8c3d 3173 8c3d .L0275 ;; 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 3174 8c3d 3175 8c3d 3176 8c3d 18 clc ; one clc only. If we overflow we're screwed anyway. 3177 8c3e a0 07 ldy #(8-1) 3178 8c40 84 44 sty temp3 3179 8c42 a0 0f ldy #(16-1) 3180 8c44 84 45 sty temp4 3181 8c46 ad 4a 01 lda enemy_shotX 3182 8c49 69 30 adc #48 3183 8c4b 85 46 sta temp5 3184 8c4d ad 4b 01 lda enemy_shotY 3185 8c50 69 20 adc #((256-WSCREENHEIGHT)/2) 3186 8c52 85 47 sta temp6 3187 8c54 a0 03 ldy #(4-1) 3188 8c56 84 48 sty temp7 3189 8c58 a0 07 ldy #(8-1) 3190 8c5a 84 49 sty temp8 3191 8c5c ad 42 01 lda playerY 3192 8c5f 69 20 adc #((256-WSCREENHEIGHT)/2) 3193 8c61 a8 tay 3194 8c62 ad 41 01 lda playerX 3195 8c65 69 30 adc #48 3196 8c67 20 d1 f3 jsr boxcollision 3197 8c6a 3198 8c6a 90 37 BCC .skipL0275 3199 8c6c .condpart103 3200 8c6c a9 c8 LDA #200 3201 8c6e 8d 4a 01 STA enemy_shotX 3202 8c71 8d 4b 01 STA enemy_shotY 3203 8c74 a9 01 LDA #1 3204 8c76 8d 4d 01 STA playerFlag 3205 8c79 ad 64 01 LDA lives 3206 8c7c 38 SEC 3207 8c7d e9 00 SBC #0 3208 8c7f 8d 64 01 STA lives 3209 8c82 ifnconst NOTIALOCKMUTE 3210 8c82 a9 01 lda #1 3211 8c84 85 de sta sfxschedulelock 3212 8c86 a9 43 lda #sfx_explosion 3215 8c8c 85 e1 sta sfxinstrumenthi 3216 8c8e a9 00 lda #0 3217 8c90 85 e2 sta sfxpitchoffset ; no pitch modification 3218 8c92 85 e3 sta sfxnoteindex ; not a musical note 3219 8c94 20 53 f2 jsr schedulesfx 3220 8c97 a9 00 lda #0 3221 8c99 85 de sta sfxschedulelock 3222 8c9b endif ; NOTIALOCKMUTE 3223 8c9b a9 01 LDA #1 3224 8c9d 8d 6a 01 STA isDead_flag 3225 8ca0 4c 7b 8f jmp ._checkCollisionsExit 3226 8ca3 3227 8ca3 .skipL0275 3228 8ca3 .L0276 ;; 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 3229 8ca3 3230 8ca3 3231 8ca3 18 clc ; one clc only. If we overflow we're screwed anyway. 3232 8ca4 a0 07 ldy #(8-1) 3233 8ca6 84 44 sty temp3 3234 8ca8 a0 0f ldy #(16-1) 3235 8caa 84 45 sty temp4 3236 8cac ad 50 01 lda power_upX 3237 8caf 69 30 adc #48 3238 8cb1 85 46 sta temp5 3239 8cb3 ad 51 01 lda power_upY 3240 8cb6 69 20 adc #((256-WSCREENHEIGHT)/2) 3241 8cb8 85 47 sta temp6 3242 8cba a0 07 ldy #(8-1) 3243 8cbc 84 48 sty temp7 3244 8cbe a0 07 ldy #(8-1) 3245 8cc0 84 49 sty temp8 3246 8cc2 ad 42 01 lda playerY 3247 8cc5 69 20 adc #((256-WSCREENHEIGHT)/2) 3248 8cc7 a8 tay 3249 8cc8 ad 41 01 lda playerX 3250 8ccb 69 30 adc #48 3251 8ccd 20 d1 f3 jsr boxcollision 3252 8cd0 3253 8cd0 90 47 BCC .skipL0276 3254 8cd2 .condpart104 3255 8cd2 a9 d0 LDA #208 3256 8cd4 8d 50 01 STA power_upX 3257 8cd7 8d 51 01 STA power_upY 3258 8cda a9 01 LDA #1 3259 8cdc 8d 4d 01 STA playerFlag 3260 8cdf 8d 52 01 STA power_upFlag 3261 8ce2 ifnconst NOTIALOCKMUTE 3262 8ce2 a9 01 lda #1 3263 8ce4 85 de sta sfxschedulelock 3264 8ce6 a9 80 lda #sfx_bling 3267 8cec 85 e1 sta sfxinstrumenthi 3268 8cee a9 00 lda #0 3269 8cf0 85 e2 sta sfxpitchoffset ; no pitch modification 3270 8cf2 85 e3 sta sfxnoteindex ; not a musical note 3271 8cf4 20 53 f2 jsr schedulesfx 3272 8cf7 a9 00 lda #0 3273 8cf9 85 de sta sfxschedulelock 3274 8cfb endif ; NOTIALOCKMUTE 3275 8cfb f8 SED 3276 8cfc 18 CLC 3277 8cfd ad a8 01 LDA score0+2 3278 8d00 69 01 ADC #$01 3279 8d02 8d a8 01 STA score0+2 3280 8d05 ad a7 01 LDA score0+1 3281 8d08 69 00 ADC #$00 3282 8d0a 8d a7 01 STA score0+1 3283 8d0d ad a6 01 LDA score0 3284 8d10 69 00 ADC #$00 3285 8d12 8d a6 01 STA score0 3286 8d15 d8 CLD 3287 8d16 20 85 8f jsr .power_up_obtained 3288 8d19 3289 8d19 .skipL0276 3290 8d19 .L0277 ;; 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 3291 8d19 3292 8d19 3293 8d19 18 clc ; one clc only. If we overflow we're screwed anyway. 3294 8d1a a0 07 ldy #(8-1) 3295 8d1c 84 44 sty temp3 3296 8d1e a0 0f ldy #(16-1) 3297 8d20 84 45 sty temp4 3298 8d22 ad 57 01 lda enemy01_X 3299 8d25 69 30 adc #48 3300 8d27 85 46 sta temp5 3301 8d29 ad 58 01 lda enemy01_Y 3302 8d2c 69 20 adc #((256-WSCREENHEIGHT)/2) 3303 8d2e 85 47 sta temp6 3304 8d30 a0 07 ldy #(8-1) 3305 8d32 84 48 sty temp7 3306 8d34 a0 0f ldy #(16-1) 3307 8d36 84 49 sty temp8 3308 8d38 ad 42 01 lda playerY 3309 8d3b 69 20 adc #((256-WSCREENHEIGHT)/2) 3310 8d3d a8 tay 3311 8d3e ad 41 01 lda playerX 3312 8d41 69 30 adc #48 3313 8d43 20 d1 f3 jsr boxcollision 3314 8d46 3315 8d46 90 37 BCC .skipL0277 3316 8d48 .condpart105 3317 8d48 a9 c8 LDA #200 3318 8d4a 8d 57 01 STA enemy01_X 3319 8d4d 8d 58 01 STA enemy01_Y 3320 8d50 a9 01 LDA #1 3321 8d52 8d 4d 01 STA playerFlag 3322 8d55 ad 64 01 LDA lives 3323 8d58 38 SEC 3324 8d59 e9 00 SBC #0 3325 8d5b 8d 64 01 STA lives 3326 8d5e ifnconst NOTIALOCKMUTE 3327 8d5e a9 01 lda #1 3328 8d60 85 de sta sfxschedulelock 3329 8d62 a9 43 lda #sfx_explosion 3332 8d68 85 e1 sta sfxinstrumenthi 3333 8d6a a9 00 lda #0 3334 8d6c 85 e2 sta sfxpitchoffset ; no pitch modification 3335 8d6e 85 e3 sta sfxnoteindex ; not a musical note 3336 8d70 20 53 f2 jsr schedulesfx 3337 8d73 a9 00 lda #0 3338 8d75 85 de sta sfxschedulelock 3339 8d77 endif ; NOTIALOCKMUTE 3340 8d77 a9 01 LDA #1 3341 8d79 8d 6a 01 STA isDead_flag 3342 8d7c 4c 7b 8f jmp ._checkCollisionsExit 3343 8d7f 3344 8d7f .skipL0277 3345 8d7f .L0278 ;; 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 3346 8d7f 3347 8d7f 3348 8d7f 18 clc ; one clc only. If we overflow we're screwed anyway. 3349 8d80 a0 07 ldy #(8-1) 3350 8d82 84 44 sty temp3 3351 8d84 a0 0f ldy #(16-1) 3352 8d86 84 45 sty temp4 3353 8d88 ad 60 01 lda extra_shipX 3354 8d8b 69 30 adc #48 3355 8d8d 85 46 sta temp5 3356 8d8f ad 61 01 lda extra_shipY 3357 8d92 69 20 adc #((256-WSCREENHEIGHT)/2) 3358 8d94 85 47 sta temp6 3359 8d96 a0 07 ldy #(8-1) 3360 8d98 84 48 sty temp7 3361 8d9a a0 07 ldy #(8-1) 3362 8d9c 84 49 sty temp8 3363 8d9e ad 42 01 lda playerY 3364 8da1 69 20 adc #((256-WSCREENHEIGHT)/2) 3365 8da3 a8 tay 3366 8da4 ad 41 01 lda playerX 3367 8da7 69 30 adc #48 3368 8da9 20 d1 f3 jsr boxcollision 3369 8dac 3370 8dac 90 2f BCC .skipL0278 3371 8dae .condpart106 3372 8dae a9 c8 LDA #200 3373 8db0 8d 60 01 STA extra_shipX 3374 8db3 8d 61 01 STA extra_shipY 3375 8db6 a9 01 LDA #1 3376 8db8 8d 62 01 STA extra_shipFlag 3377 8dbb ad 64 01 LDA lives 3378 8dbe 18 CLC 3379 8dbf 69 01 ADC #1 3380 8dc1 8d 64 01 STA lives 3381 8dc4 ifnconst NOTIALOCKMUTE 3382 8dc4 a9 01 lda #1 3383 8dc6 85 de sta sfxschedulelock 3384 8dc8 a9 80 lda #sfx_bling 3387 8dce 85 e1 sta sfxinstrumenthi 3388 8dd0 a9 00 lda #0 3389 8dd2 85 e2 sta sfxpitchoffset ; no pitch modification 3390 8dd4 85 e3 sta sfxnoteindex ; not a musical note 3391 8dd6 20 53 f2 jsr schedulesfx 3392 8dd9 a9 00 lda #0 3393 8ddb 85 de sta sfxschedulelock 3394 8ddd endif ; NOTIALOCKMUTE 3395 8ddd .skipL0278 3396 8ddd .L0279 ;; 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 3397 8ddd 3398 8ddd 3399 8ddd 18 clc ; one clc only. If we overflow we're screwed anyway. 3400 8dde a0 03 ldy #(4-1) 3401 8de0 84 44 sty temp3 3402 8de2 a0 07 ldy #(8-1) 3403 8de4 84 45 sty temp4 3404 8de6 ad 57 01 lda enemy01_X 3405 8de9 69 30 adc #48 3406 8deb 85 46 sta temp5 3407 8ded ad 58 01 lda enemy01_Y 3408 8df0 69 20 adc #((256-WSCREENHEIGHT)/2) 3409 8df2 85 47 sta temp6 3410 8df4 a0 07 ldy #(8-1) 3411 8df6 84 48 sty temp7 3412 8df8 a0 0f ldy #(16-1) 3413 8dfa 84 49 sty temp8 3414 8dfc ad 49 01 lda bulletY 3415 8dff 69 20 adc #((256-WSCREENHEIGHT)/2) 3416 8e01 a8 tay 3417 8e02 ad 48 01 lda bulletX 3418 8e05 69 30 adc #48 3419 8e07 20 d1 f3 jsr boxcollision 3420 8e0a 3421 8e0a 90 32 BCC .skipL0279 3422 8e0c .condpart107 3423 8e0c a9 f8 LDA #248 3424 8e0e 8d 48 01 STA bulletX 3425 8e11 a9 00 LDA #0 3426 8e13 8d 49 01 STA bulletY 3427 8e16 a9 d0 LDA #208 3428 8e18 8d 57 01 STA enemy01_X 3429 8e1b a9 c8 LDA #200 3430 8e1d 8d 58 01 STA enemy01_Y 3431 8e20 a9 01 LDA #1 3432 8e22 8d 59 01 STA enemy01_Flag 3433 8e25 ifnconst NOTIALOCKMUTE 3434 8e25 a9 01 lda #1 3435 8e27 85 de sta sfxschedulelock 3436 8e29 a9 43 lda #sfx_explosion 3439 8e2f 85 e1 sta sfxinstrumenthi 3440 8e31 a9 00 lda #0 3441 8e33 85 e2 sta sfxpitchoffset ; no pitch modification 3442 8e35 85 e3 sta sfxnoteindex ; not a musical note 3443 8e37 20 53 f2 jsr schedulesfx 3444 8e3a a9 00 lda #0 3445 8e3c 85 de sta sfxschedulelock 3446 8e3e endif ; NOTIALOCKMUTE 3447 8e3e .skipL0279 3448 8e3e .L0280 ;; 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 3449 8e3e 3450 8e3e 3451 8e3e 18 clc ; one clc only. If we overflow we're screwed anyway. 3452 8e3f a0 03 ldy #(4-1) 3453 8e41 84 44 sty temp3 3454 8e43 a0 0f ldy #(16-1) 3455 8e45 84 45 sty temp4 3456 8e47 ad 57 01 lda enemy01_X 3457 8e4a 69 30 adc #48 3458 8e4c 85 46 sta temp5 3459 8e4e ad 58 01 lda enemy01_Y 3460 8e51 69 20 adc #((256-WSCREENHEIGHT)/2) 3461 8e53 85 47 sta temp6 3462 8e55 a0 07 ldy #(8-1) 3463 8e57 84 48 sty temp7 3464 8e59 a0 0f ldy #(16-1) 3465 8e5b 84 49 sty temp8 3466 8e5d ad 66 01 lda twinlaserY 3467 8e60 69 20 adc #((256-WSCREENHEIGHT)/2) 3468 8e62 a8 tay 3469 8e63 ad 65 01 lda twinlaserX 3470 8e66 69 30 adc #48 3471 8e68 20 d1 f3 jsr boxcollision 3472 8e6b 3473 8e6b 90 32 BCC .skipL0280 3474 8e6d .condpart108 3475 8e6d a9 f8 LDA #248 3476 8e6f 8d 65 01 STA twinlaserX 3477 8e72 a9 00 LDA #0 3478 8e74 8d 66 01 STA twinlaserY 3479 8e77 a9 d0 LDA #208 3480 8e79 8d 57 01 STA enemy01_X 3481 8e7c a9 c8 LDA #200 3482 8e7e 8d 58 01 STA enemy01_Y 3483 8e81 a9 01 LDA #1 3484 8e83 8d 59 01 STA enemy01_Flag 3485 8e86 ifnconst NOTIALOCKMUTE 3486 8e86 a9 01 lda #1 3487 8e88 85 de sta sfxschedulelock 3488 8e8a a9 43 lda #sfx_explosion 3491 8e90 85 e1 sta sfxinstrumenthi 3492 8e92 a9 00 lda #0 3493 8e94 85 e2 sta sfxpitchoffset ; no pitch modification 3494 8e96 85 e3 sta sfxnoteindex ; not a musical note 3495 8e98 20 53 f2 jsr schedulesfx 3496 8e9b a9 00 lda #0 3497 8e9d 85 de sta sfxschedulelock 3498 8e9f endif ; NOTIALOCKMUTE 3499 8e9f .skipL0280 3500 8e9f .L0281 ;; 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 3501 8e9f 3502 8e9f ad 57 01 LDA enemy01_X 3503 8ea2 cd 48 01 CMP bulletX 3504 8ea5 b0 66 BCS .skipL0281 3505 8ea7 .condpart109 3506 8ea7 ; complex condition detected 3507 8ea7 ; complex statement detected 3508 8ea7 ad 57 01 LDA enemy01_X 3509 8eaa 18 CLC 3510 8eab 69 10 ADC #16 3511 8ead 48 PHA 3512 8eae ba TSX 3513 8eaf 68 PLA 3514 8eb0 ad 48 01 LDA bulletX 3515 8eb3 dd 01 01 CMP $101,x 3516 8eb6 b0 55 BCS .skip109then 3517 8eb8 .condpart110 3518 8eb8 ad 58 01 LDA enemy01_Y 3519 8ebb cd 49 01 CMP bulletY 3520 8ebe b0 4d BCS .skip110then 3521 8ec0 .condpart111 3522 8ec0 ; complex condition detected 3523 8ec0 ; complex statement detected 3524 8ec0 ad 58 01 LDA enemy01_Y 3525 8ec3 18 CLC 3526 8ec4 69 10 ADC #16 3527 8ec6 48 PHA 3528 8ec7 ba TSX 3529 8ec8 68 PLA 3530 8ec9 ad 49 01 LDA bulletY 3531 8ecc dd 01 01 CMP $101,x 3532 8ecf b0 3c BCS .skip111then 3533 8ed1 .condpart112 3534 8ed1 a9 01 LDA #1 3535 8ed3 8d 59 01 STA enemy01_Flag 3536 8ed6 8d 63 01 STA explosion_aniframe 3537 8ed9 f8 SED 3538 8eda 18 CLC 3539 8edb ad a8 01 LDA score0+2 3540 8ede 69 01 ADC #$01 3541 8ee0 8d a8 01 STA score0+2 3542 8ee3 ad a7 01 LDA score0+1 3543 8ee6 69 00 ADC #$00 3544 8ee8 8d a7 01 STA score0+1 3545 8eeb ad a6 01 LDA score0 3546 8eee 69 00 ADC #$00 3547 8ef0 8d a6 01 STA score0 3548 8ef3 d8 CLD 3549 8ef4 ifnconst NOTIALOCKMUTE 3550 8ef4 a9 01 lda #1 3551 8ef6 85 de sta sfxschedulelock 3552 8ef8 a9 43 lda #sfx_explosion 3555 8efe 85 e1 sta sfxinstrumenthi 3556 8f00 a9 00 lda #0 3557 8f02 85 e2 sta sfxpitchoffset ; no pitch modification 3558 8f04 85 e3 sta sfxnoteindex ; not a musical note 3559 8f06 20 53 f2 jsr schedulesfx 3560 8f09 a9 00 lda #0 3561 8f0b 85 de sta sfxschedulelock 3562 8f0d endif ; NOTIALOCKMUTE 3563 8f0d .skip111then 3564 8f0d .skip110then 3565 8f0d .skip109then 3566 8f0d .skipL0281 3567 8f0d .L0282 ;; 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 3568 8f0d 3569 8f0d ad 57 01 LDA enemy01_X 3570 8f10 cd 65 01 CMP twinlaserX 3571 8f13 b0 66 BCS .skipL0282 3572 8f15 .condpart113 3573 8f15 ; complex condition detected 3574 8f15 ; complex statement detected 3575 8f15 ad 57 01 LDA enemy01_X 3576 8f18 18 CLC 3577 8f19 69 10 ADC #16 3578 8f1b 48 PHA 3579 8f1c ba TSX 3580 8f1d 68 PLA 3581 8f1e ad 65 01 LDA twinlaserX 3582 8f21 dd 01 01 CMP $101,x 3583 8f24 b0 55 BCS .skip113then 3584 8f26 .condpart114 3585 8f26 ad 58 01 LDA enemy01_Y 3586 8f29 cd 66 01 CMP twinlaserY 3587 8f2c b0 4d BCS .skip114then 3588 8f2e .condpart115 3589 8f2e ; complex condition detected 3590 8f2e ; complex statement detected 3591 8f2e ad 58 01 LDA enemy01_Y 3592 8f31 18 CLC 3593 8f32 69 10 ADC #16 3594 8f34 48 PHA 3595 8f35 ba TSX 3596 8f36 68 PLA 3597 8f37 ad 66 01 LDA twinlaserY 3598 8f3a dd 01 01 CMP $101,x 3599 8f3d b0 3c BCS .skip115then 3600 8f3f .condpart116 3601 8f3f a9 01 LDA #1 3602 8f41 8d 59 01 STA enemy01_Flag 3603 8f44 8d 63 01 STA explosion_aniframe 3604 8f47 f8 SED 3605 8f48 18 CLC 3606 8f49 ad a8 01 LDA score0+2 3607 8f4c 69 01 ADC #$01 3608 8f4e 8d a8 01 STA score0+2 3609 8f51 ad a7 01 LDA score0+1 3610 8f54 69 00 ADC #$00 3611 8f56 8d a7 01 STA score0+1 3612 8f59 ad a6 01 LDA score0 3613 8f5c 69 00 ADC #$00 3614 8f5e 8d a6 01 STA score0 3615 8f61 d8 CLD 3616 8f62 ifnconst NOTIALOCKMUTE 3617 8f62 a9 01 lda #1 3618 8f64 85 de sta sfxschedulelock 3619 8f66 a9 43 lda #sfx_explosion 3622 8f6c 85 e1 sta sfxinstrumenthi 3623 8f6e a9 00 lda #0 3624 8f70 85 e2 sta sfxpitchoffset ; no pitch modification 3625 8f72 85 e3 sta sfxnoteindex ; not a musical note 3626 8f74 20 53 f2 jsr schedulesfx 3627 8f77 a9 00 lda #0 3628 8f79 85 de sta sfxschedulelock 3629 8f7b endif ; NOTIALOCKMUTE 3630 8f7b .skip115then 3631 8f7b .skip114then 3632 8f7b .skip113then 3633 8f7b .skipL0282 3634 8f7b . 3635 8f7b ;; 3636 8f7b 3637 8f7b ._checkCollisionsExit 3638 8f7b ;; _checkCollisionsExit 3639 8f7b 3640 8f7b .L0283 ;; return 3641 8f7b 3642 8f7b ba tsx 3643 8f7c bd 02 01 lda $102,x 3644 8f7f f0 01 beq bankswitchret11 3645 8f81 60 RTS 3646 8f82 bankswitchret11 3647 8f82 4c 7a f4 JMP BS_return 3648 8f85 . 3649 8f85 ;; 3650 8f85 3651 8f85 .power_up_obtained 3652 8f85 ;; power_up_obtained 3653 8f85 3654 8f85 .L0284 ;; if power_upFlag = 1 then twinlaser_flag = 1 3655 8f85 3656 8f85 ad 52 01 LDA power_upFlag 3657 8f88 c9 01 CMP #1 3658 8f8a d0 05 BNE .skipL0284 3659 8f8c .condpart117 3660 8f8c a9 01 LDA #1 3661 8f8e 8d 67 01 STA twinlaser_flag 3662 8f91 .skipL0284 3663 8f91 .L0285 ;; if joy0up && twinlaser_flag = 1 && joyposup = - 2 then gosub SetLaserHome 3664 8f91 3665 8f91 a9 10 lda #$10 3666 8f93 2c 80 02 bit SWCHA 3667 8f96 d0 17 BNE .skipL0285 3668 8f98 .condpart118 3669 8f98 ad 67 01 LDA twinlaser_flag 3670 8f9b c9 01 CMP #1 3671 8f9d d0 10 BNE .skip118then 3672 8f9f .condpart119 3673 8f9f ; complex condition detected 3674 8f9f a9 fe LDA #254 3675 8fa1 48 PHA 3676 8fa2 ba TSX 3677 8fa3 68 PLA 3678 8fa4 ad 44 01 LDA joyposup 3679 8fa7 dd 01 01 CMP $101,x 3680 8faa d0 03 BNE .skip119then 3681 8fac .condpart120 3682 8fac 20 1a 91 jsr .SetLaserHome 3683 8faf 3684 8faf .skip119then 3685 8faf .skip118then 3686 8faf .skipL0285 3687 8faf .L0286 ;; if joy0down && twinlaser_flag = 1 && joyposdown = - 2 then gosub SetLaserHome 3688 8faf 3689 8faf a9 20 lda #$20 3690 8fb1 2c 80 02 bit SWCHA 3691 8fb4 d0 17 BNE .skipL0286 3692 8fb6 .condpart121 3693 8fb6 ad 67 01 LDA twinlaser_flag 3694 8fb9 c9 01 CMP #1 3695 8fbb d0 10 BNE .skip121then 3696 8fbd .condpart122 3697 8fbd ; complex condition detected 3698 8fbd a9 fe LDA #254 3699 8fbf 48 PHA 3700 8fc0 ba TSX 3701 8fc1 68 PLA 3702 8fc2 ad 45 01 LDA joyposdown 3703 8fc5 dd 01 01 CMP $101,x 3704 8fc8 d0 03 BNE .skip122then 3705 8fca .condpart123 3706 8fca 20 1a 91 jsr .SetLaserHome 3707 8fcd 3708 8fcd .skip122then 3709 8fcd .skip121then 3710 8fcd .skipL0286 3711 8fcd .L0287 ;; if joy0up && twinlaser_flag = 1 && joyposleft = - 2 then gosub SetLaserHome 3712 8fcd 3713 8fcd a9 10 lda #$10 3714 8fcf 2c 80 02 bit SWCHA 3715 8fd2 d0 17 BNE .skipL0287 3716 8fd4 .condpart124 3717 8fd4 ad 67 01 LDA twinlaser_flag 3718 8fd7 c9 01 CMP #1 3719 8fd9 d0 10 BNE .skip124then 3720 8fdb .condpart125 3721 8fdb ; complex condition detected 3722 8fdb a9 fe LDA #254 3723 8fdd 48 PHA 3724 8fde ba TSX 3725 8fdf 68 PLA 3726 8fe0 ad 46 01 LDA joyposleft 3727 8fe3 dd 01 01 CMP $101,x 3728 8fe6 d0 03 BNE .skip125then 3729 8fe8 .condpart126 3730 8fe8 20 1a 91 jsr .SetLaserHome 3731 8feb 3732 8feb .skip125then 3733 8feb .skip124then 3734 8feb .skipL0287 3735 8feb .L0288 ;; if joy0down && twinlaser_flag = 1 && joyposright = - 2 then gosub SetLaserHome 3736 8feb 3737 8feb a9 20 lda #$20 3738 8fed 2c 80 02 bit SWCHA 3739 8ff0 d0 17 BNE .skipL0288 3740 8ff2 .condpart127 3741 8ff2 ad 67 01 LDA twinlaser_flag 3742 8ff5 c9 01 CMP #1 3743 8ff7 d0 10 BNE .skip127then 3744 8ff9 .condpart128 3745 8ff9 ; complex condition detected 3746 8ff9 a9 fe LDA #254 3747 8ffb 48 PHA 3748 8ffc ba TSX 3749 8ffd 68 PLA 3750 8ffe ad 47 01 LDA joyposright 3751 9001 dd 01 01 CMP $101,x 3752 9004 d0 03 BNE .skip128then 3753 9006 .condpart129 3754 9006 20 1a 91 jsr .SetLaserHome 3755 9009 3756 9009 .skip128then 3757 9009 .skip127then 3758 9009 .skipL0288 3759 9009 .L0289 ;; if joy0fire && twinlaser_flag = 1 && joyposup = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3760 9009 3761 9009 2c 02 21 bit sINPT1 3762 900c 10 30 BPL .skipL0289 3763 900e .condpart130 3764 900e ad 67 01 LDA twinlaser_flag 3765 9011 c9 01 CMP #1 3766 9013 d0 29 BNE .skip130then 3767 9015 .condpart131 3768 9015 ad 44 01 LDA joyposup 3769 9018 c9 01 CMP #1 3770 901a d0 22 BNE .skip131then 3771 901c .condpart132 3772 901c ad 66 01 LDA twinlaserY 3773 901f 38 SEC 3774 9020 e9 0a SBC #10 3775 9022 8d 66 01 STA twinlaserY 3776 9025 ifnconst NOTIALOCKMUTE 3777 9025 a9 01 lda #1 3778 9027 85 de sta sfxschedulelock 3779 9029 a9 10 lda #sfx_plainlaser 3782 902f 85 e1 sta sfxinstrumenthi 3783 9031 a9 00 lda #0 3784 9033 85 e2 sta sfxpitchoffset ; no pitch modification 3785 9035 85 e3 sta sfxnoteindex ; not a musical note 3786 9037 20 53 f2 jsr schedulesfx 3787 903a a9 00 lda #0 3788 903c 85 de sta sfxschedulelock 3789 903e endif ; NOTIALOCKMUTE 3790 903e .skip131then 3791 903e .skip130then 3792 903e .skipL0289 3793 903e .L0290 ;; if joy0fire && twinlaser_flag = 1 && joyposdown = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3794 903e 3795 903e 2c 02 21 bit sINPT1 3796 9041 10 30 BPL .skipL0290 3797 9043 .condpart133 3798 9043 ad 67 01 LDA twinlaser_flag 3799 9046 c9 01 CMP #1 3800 9048 d0 29 BNE .skip133then 3801 904a .condpart134 3802 904a ad 45 01 LDA joyposdown 3803 904d c9 01 CMP #1 3804 904f d0 22 BNE .skip134then 3805 9051 .condpart135 3806 9051 ad 66 01 LDA twinlaserY 3807 9054 38 SEC 3808 9055 e9 0a SBC #10 3809 9057 8d 66 01 STA twinlaserY 3810 905a ifnconst NOTIALOCKMUTE 3811 905a a9 01 lda #1 3812 905c 85 de sta sfxschedulelock 3813 905e a9 10 lda #sfx_plainlaser 3816 9064 85 e1 sta sfxinstrumenthi 3817 9066 a9 00 lda #0 3818 9068 85 e2 sta sfxpitchoffset ; no pitch modification 3819 906a 85 e3 sta sfxnoteindex ; not a musical note 3820 906c 20 53 f2 jsr schedulesfx 3821 906f a9 00 lda #0 3822 9071 85 de sta sfxschedulelock 3823 9073 endif ; NOTIALOCKMUTE 3824 9073 .skip134then 3825 9073 .skip133then 3826 9073 .skipL0290 3827 9073 .L0291 ;; if joy0fire && twinlaser_flag = 1 && joyposleft = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3828 9073 3829 9073 2c 02 21 bit sINPT1 3830 9076 10 30 BPL .skipL0291 3831 9078 .condpart136 3832 9078 ad 67 01 LDA twinlaser_flag 3833 907b c9 01 CMP #1 3834 907d d0 29 BNE .skip136then 3835 907f .condpart137 3836 907f ad 46 01 LDA joyposleft 3837 9082 c9 01 CMP #1 3838 9084 d0 22 BNE .skip137then 3839 9086 .condpart138 3840 9086 ad 66 01 LDA twinlaserY 3841 9089 38 SEC 3842 908a e9 0a SBC #10 3843 908c 8d 66 01 STA twinlaserY 3844 908f ifnconst NOTIALOCKMUTE 3845 908f a9 01 lda #1 3846 9091 85 de sta sfxschedulelock 3847 9093 a9 10 lda #sfx_plainlaser 3850 9099 85 e1 sta sfxinstrumenthi 3851 909b a9 00 lda #0 3852 909d 85 e2 sta sfxpitchoffset ; no pitch modification 3853 909f 85 e3 sta sfxnoteindex ; not a musical note 3854 90a1 20 53 f2 jsr schedulesfx 3855 90a4 a9 00 lda #0 3856 90a6 85 de sta sfxschedulelock 3857 90a8 endif ; NOTIALOCKMUTE 3858 90a8 .skip137then 3859 90a8 .skip136then 3860 90a8 .skipL0291 3861 90a8 .L0292 ;; if joy0fire && twinlaser_flag = 1 && joyposright = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3862 90a8 3863 90a8 2c 02 21 bit sINPT1 3864 90ab 10 30 BPL .skipL0292 3865 90ad .condpart139 3866 90ad ad 67 01 LDA twinlaser_flag 3867 90b0 c9 01 CMP #1 3868 90b2 d0 29 BNE .skip139then 3869 90b4 .condpart140 3870 90b4 ad 47 01 LDA joyposright 3871 90b7 c9 01 CMP #1 3872 90b9 d0 22 BNE .skip140then 3873 90bb .condpart141 3874 90bb ad 66 01 LDA twinlaserY 3875 90be 38 SEC 3876 90bf e9 0a SBC #10 3877 90c1 8d 66 01 STA twinlaserY 3878 90c4 ifnconst NOTIALOCKMUTE 3879 90c4 a9 01 lda #1 3880 90c6 85 de sta sfxschedulelock 3881 90c8 a9 10 lda #sfx_plainlaser 3884 90ce 85 e1 sta sfxinstrumenthi 3885 90d0 a9 00 lda #0 3886 90d2 85 e2 sta sfxpitchoffset ; no pitch modification 3887 90d4 85 e3 sta sfxnoteindex ; not a musical note 3888 90d6 20 53 f2 jsr schedulesfx 3889 90d9 a9 00 lda #0 3890 90db 85 de sta sfxschedulelock 3891 90dd endif ; NOTIALOCKMUTE 3892 90dd .skip140then 3893 90dd .skip139then 3894 90dd .skipL0292 3895 90dd .L0293 ;; if !joy0fire then twinlaserX = playerX + 2 : twinlaserY = playerY - 8 3896 90dd 3897 90dd 2c 02 21 bit sINPT1 3898 90e0 30 12 BMI .skipL0293 3899 90e2 .condpart142 3900 90e2 ad 41 01 LDA playerX 3901 90e5 18 CLC 3902 90e6 69 02 ADC #2 3903 90e8 8d 65 01 STA twinlaserX 3904 90eb ad 42 01 LDA playerY 3905 90ee 38 SEC 3906 90ef e9 08 SBC #8 3907 90f1 8d 66 01 STA twinlaserY 3908 90f4 .skipL0293 3909 90f4 .L0294 ;; return 3910 90f4 3911 90f4 ba tsx 3912 90f5 bd 02 01 lda $102,x 3913 90f8 f0 01 beq bankswitchret12 3914 90fa 60 RTS 3915 90fb bankswitchret12 3916 90fb 4c 7a f4 JMP BS_return 3917 90fe . 3918 90fe ;; 3919 90fe 3920 90fe .SetBulletHome 3921 90fe ;; SetBulletHome 3922 90fe 3923 90fe .L0295 ;; bulletX = playerX + 4 : bulletY = playerY - 2 3924 90fe 3925 90fe ad 41 01 LDA playerX 3926 9101 18 CLC 3927 9102 69 04 ADC #4 3928 9104 8d 48 01 STA bulletX 3929 9107 ad 42 01 LDA playerY 3930 910a 38 SEC 3931 910b e9 02 SBC #2 3932 910d 8d 49 01 STA bulletY 3933 9110 .L0296 ;; return 3934 9110 3935 9110 ba tsx 3936 9111 bd 02 01 lda $102,x 3937 9114 f0 01 beq bankswitchret13 3938 9116 60 RTS 3939 9117 bankswitchret13 3940 9117 4c 7a f4 JMP BS_return 3941 911a . 3942 911a ;; 3943 911a 3944 911a .SetLaserHome 3945 911a ;; SetLaserHome 3946 911a 3947 911a .L0297 ;; twinlaserX = playerX + 4 : twinlaserY = playerY - 2 3948 911a 3949 911a ad 41 01 LDA playerX 3950 911d 18 CLC 3951 911e 69 04 ADC #4 3952 9120 8d 65 01 STA twinlaserX 3953 9123 ad 42 01 LDA playerY 3954 9126 38 SEC 3955 9127 e9 02 SBC #2 3956 9129 8d 66 01 STA twinlaserY 3957 912c .L0298 ;; return 3958 912c 3959 912c ba tsx 3960 912d bd 02 01 lda $102,x 3961 9130 f0 01 beq bankswitchret14 3962 9132 60 RTS 3963 9133 bankswitchret14 3964 9133 4c 7a f4 JMP BS_return 3965 9136 . 3966 9136 ;; 3967 9136 3968 9136 .lose_a_life 3969 9136 ;; lose_a_life 3970 9136 3971 9136 .L0299 ;; lives = lives - 1 : isDead_flag = 0 3972 9136 3973 9136 ad 64 01 LDA lives 3974 9139 38 SEC 3975 913a e9 01 SBC #1 3976 913c 8d 64 01 STA lives 3977 913f a9 00 LDA #0 3978 9141 8d 6a 01 STA isDead_flag 3979 9144 .L0300 ;; if enemy01_Flag <> 1 then enemy01_X = 32 : enemy01_Y = 0 3980 9144 3981 9144 ad 59 01 LDA enemy01_Flag 3982 9147 c9 01 CMP #1 3983 9149 f0 0a BEQ .skipL0300 3984 914b .condpart143 3985 914b a9 20 LDA #32 3986 914d 8d 57 01 STA enemy01_X 3987 9150 a9 00 LDA #0 3988 9152 8d 58 01 STA enemy01_Y 3989 9155 .skipL0300 3990 9155 .L0301 ;; if enemy_shotFlag <> 1 then enemy_shotX = 0 : enemy_shotY = 0 3991 9155 3992 9155 ad 4c 01 LDA enemy_shotFlag 3993 9158 c9 01 CMP #1 3994 915a f0 08 BEQ .skipL0301 3995 915c .condpart144 3996 915c a9 00 LDA #0 3997 915e 8d 4a 01 STA enemy_shotX 3998 9161 8d 4b 01 STA enemy_shotY 3999 9164 .skipL0301 4000 9164 .L0302 ;; if playerFlag = 1 && explosion_aniframe = 200 && lives > 0 then playerX = 80 : playerY = 144 : playerFlag = 0 : explosion_aniframe = 0 : twinlaser_flag = 0 : goto main 4001 9164 4002 9164 ad 4d 01 LDA playerFlag 4003 9167 c9 01 CMP #1 4004 9169 d0 26 BNE .skipL0302 4005 916b .condpart145 4006 916b ad 63 01 LDA explosion_aniframe 4007 916e c9 c8 CMP #200 4008 9170 d0 1f BNE .skip145then 4009 9172 .condpart146 4010 9172 a9 00 LDA #0 4011 9174 cd 64 01 CMP lives 4012 9177 b0 18 BCS .skip146then 4013 9179 .condpart147 4014 9179 a9 50 LDA #80 4015 917b 8d 41 01 STA playerX 4016 917e a9 90 LDA #144 4017 9180 8d 42 01 STA playerY 4018 9183 a9 00 LDA #0 4019 9185 8d 4d 01 STA playerFlag 4020 9188 8d 63 01 STA explosion_aniframe 4021 918b 8d 67 01 STA twinlaser_flag 4022 918e 4c ea 80 jmp .main 4023 9191 4024 9191 .skip146then 4025 9191 .skip145then 4026 9191 .skipL0302 4027 9191 .L0303 ;; joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 4028 9191 4029 9191 a9 00 LDA #0 4030 9193 8d 44 01 STA joyposup 4031 9196 8d 45 01 STA joyposdown 4032 9199 8d 46 01 STA joyposleft 4033 919c 8d 47 01 STA joyposright 4034 919f .L0304 ;; bulletX = 0 : bulletY = 0 4035 919f 4036 919f a9 00 LDA #0 4037 91a1 8d 48 01 STA bulletX 4038 91a4 8d 49 01 STA bulletY 4039 91a7 .L0305 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 4040 91a7 4041 91a7 a9 00 LDA #0 4042 91a9 8d 57 01 STA enemy01_X 4043 91ac 8d 58 01 STA enemy01_Y 4044 91af 8d 59 01 STA enemy01_Flag 4045 91b2 .L0306 ;; playerFlag = 0 : gameover_flag = 0 4046 91b2 4047 91b2 a9 00 LDA #0 4048 91b4 8d 4d 01 STA playerFlag 4049 91b7 8d 5f 01 STA gameover_flag 4050 91ba .L0307 ;; power_upFlag = 0 : twinlaser_flag = 0 4051 91ba 4052 91ba a9 00 LDA #0 4053 91bc 8d 52 01 STA power_upFlag 4054 91bf 8d 67 01 STA twinlaser_flag 4055 91c2 . 4056 91c2 ;; 4057 91c2 4058 91c2 .lose_a_lifeloop 4059 91c2 ;; lose_a_lifeloop 4060 91c2 4061 91c2 .L0308 ;; restorescreen 4062 91c2 4063 91c2 20 99 f0 jsr restorescreen 4064 91c5 .L0309 ;; gosub draw_scores 4065 91c5 4066 91c5 20 f6 88 jsr .draw_scores 4067 91c8 4068 91c8 .L0310 ;; drawscreen 4069 91c8 4070 91c8 20 bb f0 jsr drawscreen 4071 91cb .L0311 ;; if joy0fire then fire_debounce = 2 4072 91cb 4073 91cb 2c 02 21 bit sINPT1 4074 91ce 10 05 BPL .skipL0311 4075 91d0 .condpart148 4076 91d0 a9 02 LDA #2 4077 91d2 8d 43 01 STA fire_debounce 4078 91d5 .skipL0311 4079 91d5 .L0312 ;; if !joy0fire then fire_debounce = 1 4080 91d5 4081 91d5 2c 02 21 bit sINPT1 4082 91d8 30 05 BMI .skipL0312 4083 91da .condpart149 4084 91da a9 01 LDA #1 4085 91dc 8d 43 01 STA fire_debounce 4086 91df .skipL0312 4087 91df .L0313 ;; if fire_debounce = 1 && lives > 0 then clearscreen : goto main 4088 91df 4089 91df ad 43 01 LDA fire_debounce 4090 91e2 c9 01 CMP #1 4091 91e4 d0 0d BNE .skipL0313 4092 91e6 .condpart150 4093 91e6 a9 00 LDA #0 4094 91e8 cd 64 01 CMP lives 4095 91eb b0 06 BCS .skip150then 4096 91ed .condpart151 4097 91ed 20 87 f0 jsr clearscreen 4098 91f0 4c ea 80 jmp .main 4099 91f3 4100 91f3 .skip150then 4101 91f3 .skipL0313 4102 91f3 .L0314 ;; if fire_debounce = 1 && lives < 1 then clearscreen : goto gameover 4103 91f3 4104 91f3 ad 43 01 LDA fire_debounce 4105 91f6 c9 01 CMP #1 4106 91f8 d0 0d BNE .skipL0314 4107 91fa .condpart152 4108 91fa ad 64 01 LDA lives 4109 91fd c9 01 CMP #1 4110 91ff b0 06 BCS .skip152then 4111 9201 .condpart153 4112 9201 20 87 f0 jsr clearscreen 4113 9204 4c 0a 92 jmp .gameover 4114 9207 4115 9207 .skip152then 4116 9207 .skipL0314 4117 9207 .L0315 ;; goto lose_a_lifeloop 4118 9207 4119 9207 4c c2 91 jmp .lose_a_lifeloop 4120 920a 4121 920a . 4122 920a ;; 4123 920a 4124 920a .gameover 4125 920a ;; gameover 4126 920a 4127 920a .L0316 ;; gameover_flag = 0 : fire_debounce = 1 4128 920a 4129 920a a9 00 LDA #0 4130 920c 8d 5f 01 STA gameover_flag 4131 920f a9 01 LDA #1 4132 9211 8d 43 01 STA fire_debounce 4133 9214 . 4134 9214 ;; 4135 9214 4136 9214 .gameover_loop 4137 9214 ;; gameover_loop 4138 9214 4139 9214 .L0317 ;; if lives = 0 then gameover_flag = 1 : clearscreen 4140 9214 4141 9214 ad 64 01 LDA lives 4142 9217 c9 00 CMP #0 4143 9219 d0 08 BNE .skipL0317 4144 921b .condpart154 4145 921b a9 01 LDA #1 4146 921d 8d 5f 01 STA gameover_flag 4147 9220 20 87 f0 jsr clearscreen 4148 9223 .skipL0317 4149 9223 .L0318 ;; plotchars 'game^over!' 0 40 16 4150 9223 4151 9223 4c 30 92 JMP skipalphadata14 4152 9226 alphadata14 4153 9226 11 .byte.b (alphadata14 4168 9236 85 43 sta temp2 4169 9238 4170 9238 a9 16 lda #22 ; width in two's complement 4171 923a 09 00 ora #0 ; palette left shifted 5 bits 4172 923c 85 44 sta temp3 4173 923e a9 28 lda #40 4174 9240 85 45 sta temp4 4175 9242 4176 9242 a9 10 lda #16 4177 9244 4178 9244 85 46 sta temp5 4179 9246 4180 9246 20 54 f3 jsr plotcharacters 4181 9249 .L0319 ;; if joy0fire && !fire_debounce then clearscreen : goto plot 4182 9249 4183 9249 2c 02 21 bit sINPT1 4184 924c 10 0b BPL .skipL0319 4185 924e .condpart155 4186 924e ad 43 01 LDA fire_debounce 4187 9251 d0 06 BNE .skip155then 4188 9253 .condpart156 4189 9253 20 87 f0 jsr clearscreen 4190 9256 4c 43 80 jmp .plot 4191 9259 4192 9259 .skip155then 4193 9259 .skipL0319 4194 9259 .L0320 ;; goto gameover_loop 4195 9259 4196 9259 4c 14 92 jmp .gameover_loop 4197 925c 4198 925c . 4199 925c ;; 4200 925c 4201 925c . 4202 925c ;; 4203 925c 4204 925c . 4205 925c ;; 4206 925c 4207 925c . 4208 925c ;; 4209 925c 4210 925c . 4211 925c ;; 4212 925c 4213 925c . 4214 925c ;; 4215 925c 4216 925c . 4217 925c ;; 4218 925c 4219 925c . 4220 925c ;; 4221 925c 4222 925c . 4223 925c ;; 4224 925c 4225 925c . 4226 925c ;; 4227 925c 4228 925c . 4229 925c ;; 4230 925c 4231 925c . 4232 925c ;; 4233 925c 4234 925c . 4235 925c ;; 4236 925c 4237 925c . 4238 925c ;; 4239 925c 4240 925c . 4241 925c ;; 4242 925c 4243 925c .titlescreen 4244 925c ;; titlescreen 4245 925c 4246 925c .L0321 ;; plotchars 'new^vertical^shooting' 1 38 4 4247 925c 4248 925c 4c 74 92 JMP skipalphadata15 4249 925f alphadata15 4250 925f 18 .byte.b (alphadata15 4276 927a 85 43 sta temp2 4277 927c 4278 927c a9 0b lda #11 ; width in two's complement 4279 927e 09 20 ora #32 ; palette left shifted 5 bits 4280 9280 85 44 sta temp3 4281 9282 a9 26 lda #38 4282 9284 85 45 sta temp4 4283 9286 4284 9286 a9 04 lda #4 4285 9288 4286 9288 85 46 sta temp5 4287 928a 4288 928a 20 54 f3 jsr plotcharacters 4289 928d .L0322 ;; plotchars 'demo' 1 72 5 4290 928d 4291 928d 4c 94 92 JMP skipalphadata16 4292 9290 alphadata16 4293 9290 0e .byte.b (alphadata16 4302 929a 85 43 sta temp2 4303 929c 4304 929c a9 1c lda #28 ; width in two's complement 4305 929e 09 20 ora #32 ; palette left shifted 5 bits 4306 92a0 85 44 sta temp3 4307 92a2 a9 48 lda #72 4308 92a4 85 45 sta temp4 4309 92a6 4310 92a6 a9 05 lda #5 4311 92a8 4312 92a8 85 46 sta temp5 4313 92aa 4314 92aa 20 54 f3 jsr plotcharacters 4315 92ad .L0323 ;; plotchars 'by^shane^skekel.' 1 48 7 4316 92ad 4317 92ad 4c c0 92 JMP skipalphadata17 4318 92b0 alphadata17 4319 92b0 0c .byte.b (alphadata17 4340 92c6 85 43 sta temp2 4341 92c8 4342 92c8 a9 10 lda #16 ; width in two's complement 4343 92ca 09 20 ora #32 ; palette left shifted 5 bits 4344 92cc 85 44 sta temp3 4345 92ce a9 30 lda #48 4346 92d0 85 45 sta temp4 4347 92d2 4348 92d2 a9 07 lda #7 4349 92d4 4350 92d4 85 46 sta temp5 4351 92d6 4352 92d6 20 54 f3 jsr plotcharacters 4353 92d9 .L0324 ;; plotchars 'push^fire^to^begin.' 2 42 16 4354 92d9 4355 92d9 4c ef 92 JMP skipalphadata18 4356 92dc alphadata18 4357 92dc 1a .byte.b (alphadata18 4381 92f5 85 43 sta temp2 4382 92f7 4383 92f7 a9 0d lda #13 ; width in two's complement 4384 92f9 09 40 ora #64 ; palette left shifted 5 bits 4385 92fb 85 44 sta temp3 4386 92fd a9 2a lda #42 4387 92ff 85 45 sta temp4 4388 9301 4389 9301 a9 10 lda #16 4390 9303 4391 9303 85 46 sta temp5 4392 9305 4393 9305 20 54 f3 jsr plotcharacters 4394 9308 .L0325 ;; savescreen 4395 9308 4396 9308 20 ab f0 jsr savescreen 4397 930b .L0326 ;; drawscreen 4398 930b 4399 930b 20 bb f0 jsr drawscreen 4400 930e .L0327 ;; fire_debounce = 1 4401 930e 4402 930e a9 01 LDA #1 4403 9310 8d 43 01 STA fire_debounce 4404 9313 . 4405 9313 ;; 4406 9313 4407 9313 .titlescreenloop 4408 9313 ;; titlescreenloop 4409 9313 4410 9313 .L0328 ;; restorescreen 4411 9313 4412 9313 20 99 f0 jsr restorescreen 4413 9316 .L0329 ;; if switchreset then reboot 4414 9316 4415 9316 20 8d f4 jsr checkresetswitch 4416 9319 d0 03 BNE .skipL0329 4417 931b .condpart157 4418 931b 4c 7a f5 JMP START 4419 931e .skipL0329 4420 931e .L0330 ;; if joy0fire then clearscreen : savescreen : lives = $04 : score0 = 0 : playsfx sfx_bling : goto main 4421 931e 4422 931e 2c 02 21 bit sINPT1 4423 9321 10 36 BPL .skipL0330 4424 9323 .condpart158 4425 9323 20 87 f0 jsr clearscreen 4426 9326 20 ab f0 jsr savescreen 4427 9329 a9 04 LDA #$04 4428 932b 8d 64 01 STA lives 4429 932e a9 00 LDA #$00 4430 9330 8d a8 01 STA score0+2 4431 9333 a9 00 LDA #$00 4432 9335 8d a7 01 STA score0+1 4433 9338 a9 00 LDA #$00 4434 933a 8d a6 01 STA score0 4435 933d ifnconst NOTIALOCKMUTE 4436 933d a9 01 lda #1 4437 933f 85 de sta sfxschedulelock 4438 9341 a9 80 lda #sfx_bling 4441 9347 85 e1 sta sfxinstrumenthi 4442 9349 a9 00 lda #0 4443 934b 85 e2 sta sfxpitchoffset ; no pitch modification 4444 934d 85 e3 sta sfxnoteindex ; not a musical note 4445 934f 20 53 f2 jsr schedulesfx 4446 9352 a9 00 lda #0 4447 9354 85 de sta sfxschedulelock 4448 9356 endif ; NOTIALOCKMUTE 4449 9356 4c ea 80 jmp .main 4450 9359 4451 9359 .skipL0330 4452 9359 .L0331 ;; if !joy0fire then fire_debounce = 0 4453 9359 4454 9359 2c 02 21 bit sINPT1 4455 935c 30 05 BMI .skipL0331 4456 935e .condpart159 4457 935e a9 00 LDA #0 4458 9360 8d 43 01 STA fire_debounce 4459 9363 .skipL0331 4460 9363 .L0332 ;; drawscreen 4461 9363 4462 9363 20 bb f0 jsr drawscreen 4463 9366 .L0333 ;; goto titlescreenloop 4464 9366 4465 9366 4c 13 93 jmp .titlescreenloop 4466 9369 4467 9369 . 4468 9369 ;; 4469 9369 4470 9369 . 4471 9369 ;; 4472 9369 4473 9369 .initialise_gamescreen 4474 9369 ;; initialise_gamescreen 4475 9369 4476 9369 .L0334 ;; clearscreen 4477 9369 4478 9369 20 87 f0 jsr clearscreen 4479 936c .L0335 ;; BACKGRND = $00 4480 936c 4481 936c a9 00 LDA #$00 4482 936e 85 20 STA BACKGRND 4483 9370 . 4484 9370 ;; 4485 9370 4486 9370 .L0336 ;; savescreen 4487 9370 4488 9370 20 ab f0 jsr savescreen 4489 9373 .L0337 ;; return 4490 9373 4491 9373 ba tsx 4492 9374 bd 02 01 lda $102,x 4493 9377 f0 01 beq bankswitchret20 4494 9379 60 RTS 4495 937a bankswitchret20 4496 937a 4c 7a f4 JMP BS_return 4497 937d . 4498 937d ;; 4499 937d 4500 937d . 4501 937d ;; 4502 937d 4503 937d .L0338 ;; data sfx_bling 4504 937d 4505 937d 4c b6 93 JMP .skipL0338 4506 9380 sfx_bling 4507 9380 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4508 9383 4509 9383 1c 04 07 .byte.b $1c,$04,$07 4510 9386 4511 9386 1b 04 07 .byte.b $1b,$04,$07 4512 9389 4513 9389 04 0f 05 .byte.b $04,$0f,$05 4514 938c 4515 938c 15 04 09 .byte.b $15,$04,$09 4516 938f 4517 938f 16 04 07 .byte.b $16,$04,$07 4518 9392 4519 9392 03 0f 04 .byte.b $03,$0f,$04 4520 9395 4521 9395 11 04 08 .byte.b $11,$04,$08 4522 9398 4523 9398 11 04 08 .byte.b $11,$04,$08 4524 939b 4525 939b 11 04 04 .byte.b $11,$04,$04 4526 939e 4527 939e 0e 04 09 .byte.b $0e,$04,$09 4528 93a1 4529 93a1 0e 04 07 .byte.b $0e,$04,$07 4530 93a4 4531 93a4 0e 04 04 .byte.b $0e,$04,$04 4532 93a7 4533 93a7 1c 04 07 .byte.b $1c,$04,$07 4534 93aa 4535 93aa 1b 04 05 .byte.b $1b,$04,$05 4536 93ad 4537 93ad 1c 04 04 .byte.b $1c,$04,$04 4538 93b0 4539 93b0 1b 04 02 .byte.b $1b,$04,$02 4540 93b3 4541 93b3 00 00 00 .byte.b $00,$00,$00 4542 93b6 4543 93b6 .skipL0338 4544 93b6 00 80 sfx_bling_lo = #sfx_bling 4546 93b6 . 4547 93b6 ;; 4548 93b6 4549 93b6 .L0339 ;; data sfx_pulsecannon 4550 93b6 4551 93b6 4c 0d 94 JMP .skipL0339 4552 93b9 sfx_pulsecannon 4553 93b9 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4554 93bc 4555 93bc 1e 0c 0a .byte.b $1e,$0c,$0a ; first chunk of freq,channel,volume 4556 93bf 4557 93bf 07 06 0f .byte.b $07,$06,$0f 4558 93c2 4559 93c2 07 06 0f .byte.b $07,$06,$0f 4560 93c5 4561 93c5 1e 06 0f .byte.b $1e,$06,$0f 4562 93c8 4563 93c8 17 0c 0b .byte.b $17,$0c,$0b 4564 93cb 4565 93cb 1b 0c 0b .byte.b $1b,$0c,$0b 4566 93ce 4567 93ce 1e 0c 0f .byte.b $1e,$0c,$0f 4568 93d1 4569 93d1 07 06 0f .byte.b $07,$06,$0f 4570 93d4 4571 93d4 07 06 0f .byte.b $07,$06,$0f 4572 93d7 4573 93d7 1e 06 08 .byte.b $1e,$06,$08 4574 93da 4575 93da 17 0c 06 .byte.b $17,$0c,$06 4576 93dd 4577 93dd 1b 0c 0f .byte.b $1b,$0c,$0f 4578 93e0 4579 93e0 1e 0c 0f .byte.b $1e,$0c,$0f 4580 93e3 4581 93e3 07 06 0f .byte.b $07,$06,$0f 4582 93e6 4583 93e6 07 06 0f .byte.b $07,$06,$0f 4584 93e9 4585 93e9 0a 06 0a .byte.b $0a,$06,$0a 4586 93ec 4587 93ec 17 0c 0a .byte.b $17,$0c,$0a 4588 93ef 4589 93ef 1e 0c 04 .byte.b $1e,$0c,$04 4590 93f2 4591 93f2 1e 06 09 .byte.b $1e,$06,$09 4592 93f5 4593 93f5 1b 04 05 .byte.b $1b,$04,$05 4594 93f8 4595 93f8 07 06 0f .byte.b $07,$06,$0f 4596 93fb 4597 93fb 0a 06 09 .byte.b $0a,$06,$09 4598 93fe 4599 93fe 17 0c 0d .byte.b $17,$0c,$0d 4600 9401 4601 9401 1b 0c 09 .byte.b $1b,$0c,$09 4602 9404 4603 9404 0a 06 05 .byte.b $0a,$06,$05 4604 9407 4605 9407 17 0c 03 .byte.b $17,$0c,$03 4606 940a 4607 940a 00 00 00 .byte.b $00,$00,$00 4608 940d 4609 940d .skipL0339 4610 940d 00 b9 sfx_pulsecannon_lo = #sfx_pulsecannon 4612 940d . 4613 940d ;; 4614 940d 4615 940d .L0340 ;; data sfx_plainlaser 4616 940d 4617 940d 4c 40 94 JMP .skipL0340 4618 9410 sfx_plainlaser 4619 9410 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4620 9413 4621 9413 10 04 06 .byte.b $10,$04,$06 ; first chunk of freq,channel,volume 4622 9416 4623 9416 13 04 08 .byte.b $13,$04,$08 4624 9419 4625 9419 16 04 08 .byte.b $16,$04,$08 4626 941c 4627 941c 16 04 07 .byte.b $16,$04,$07 4628 941f 4629 941f 1c 04 09 .byte.b $1c,$04,$09 4630 9422 4631 9422 0b 0c 0f .byte.b $0b,$0c,$0f 4632 9425 4633 9425 0d 0c 0f .byte.b $0d,$0c,$0f 4634 9428 4635 9428 0e 0c 0f .byte.b $0e,$0c,$0f 4636 942b 4637 942b 0e 0c 0f .byte.b $0e,$0c,$0f 4638 942e 4639 942e 12 0c 0f .byte.b $12,$0c,$0f 4640 9431 4641 9431 03 06 0d .byte.b $03,$06,$0d 4642 9434 4643 9434 1e 0c 0a .byte.b $1e,$0c,$0a 4644 9437 4645 9437 1e 0c 0c .byte.b $1e,$0c,$0c 4646 943a 4647 943a 0a 06 04 .byte.b $0a,$06,$04 4648 943d 4649 943d 00 00 00 .byte.b $00,$00,$00 4650 9440 4651 9440 .skipL0340 4652 9440 00 10 sfx_plainlaser_lo = #sfx_plainlaser 4654 9440 . 4655 9440 ;; 4656 9440 4657 9440 .L0341 ;; data sfx_explosion 4658 9440 4659 9440 4c d3 94 JMP .skipL0341 4660 9443 sfx_explosion 4661 9443 10 10 00 .byte.b $10,$10,$00 4662 9446 4663 9446 01 08 02 .byte.b $01,$08,$02 4664 9449 4665 9449 0b 0c 05 .byte.b $0b,$0c,$05 4666 944c 4667 944c 04 06 08 .byte.b $04,$06,$08 4668 944f 4669 944f 03 0e 0f .byte.b $03,$0e,$0f 4670 9452 4671 9452 09 06 0f .byte.b $09,$06,$0f 4672 9455 4673 9455 0d 06 0f .byte.b $0d,$06,$0f 4674 9458 4675 9458 04 0e 0f .byte.b $04,$0e,$0f 4676 945b 4677 945b 0f 06 08 .byte.b $0f,$06,$08 4678 945e 4679 945e 09 06 04 .byte.b $09,$06,$04 4680 9461 4681 9461 16 01 03 .byte.b $16,$01,$03 4682 9464 4683 9464 0c 06 04 .byte.b $0c,$06,$04 4684 9467 4685 9467 09 06 05 .byte.b $09,$06,$05 4686 946a 4687 946a 0a 06 03 .byte.b $0a,$06,$03 4688 946d 4689 946d 09 06 05 .byte.b $09,$06,$05 4690 9470 4691 9470 0d 06 08 .byte.b $0d,$06,$08 4692 9473 4693 9473 09 06 04 .byte.b $09,$06,$04 4694 9476 4695 9476 04 0e 06 .byte.b $04,$0e,$06 4696 9479 4697 9479 0f 06 05 .byte.b $0f,$06,$05 4698 947c 4699 947c 0f 06 07 .byte.b $0f,$06,$07 4700 947f 4701 947f 04 0e 07 .byte.b $04,$0e,$07 4702 9482 4703 9482 08 06 06 .byte.b $08,$06,$06 4704 9485 4705 9485 03 0e 08 .byte.b $03,$0e,$08 4706 9488 4707 9488 0f 06 06 .byte.b $0f,$06,$06 4708 948b 4709 948b 09 06 05 .byte.b $09,$06,$05 4710 948e 4711 948e 06 06 05 .byte.b $06,$06,$05 4712 9491 4713 9491 03 0e 05 .byte.b $03,$0e,$05 4714 9494 4715 9494 0e 06 06 .byte.b $0e,$06,$06 4716 9497 4717 9497 02 0e 05 .byte.b $02,$0e,$05 4718 949a 4719 949a 0f 06 03 .byte.b $0f,$06,$03 4720 949d 4721 949d 0e 06 06 .byte.b $0e,$06,$06 4722 94a0 4723 94a0 09 06 05 .byte.b $09,$06,$05 4724 94a3 4725 94a3 0c 06 05 .byte.b $0c,$06,$05 4726 94a6 4727 94a6 0f 06 03 .byte.b $0f,$06,$03 4728 94a9 4729 94a9 04 0e 08 .byte.b $04,$0e,$08 4730 94ac 4731 94ac 0c 06 03 .byte.b $0c,$06,$03 4732 94af 4733 94af 0f 06 03 .byte.b $0f,$06,$03 4734 94b2 4735 94b2 0c 06 06 .byte.b $0c,$06,$06 4736 94b5 4737 94b5 0f 06 04 .byte.b $0f,$06,$04 4738 94b8 4739 94b8 0f 06 05 .byte.b $0f,$06,$05 4740 94bb 4741 94bb 0f 06 03 .byte.b $0f,$06,$03 4742 94be 4743 94be 0a 06 04 .byte.b $0a,$06,$04 4744 94c1 4745 94c1 0f 06 03 .byte.b $0f,$06,$03 4746 94c4 4747 94c4 08 06 03 .byte.b $08,$06,$03 4748 94c7 4749 94c7 0c 06 03 .byte.b $0c,$06,$03 4750 94ca 4751 94ca 0e 06 03 .byte.b $0e,$06,$03 4752 94cd 4753 94cd 08 06 03 .byte.b $08,$06,$03 4754 94d0 4755 94d0 00 00 00 .byte.b $00,$00,$00 4756 94d3 4757 94d3 .skipL0341 4758 94d3 00 43 sfx_explosion_lo = #sfx_explosion 4760 94d3 DMAHOLEEND0 SET . 4761 94d3 gameend 4762 94d3 DMAHOLEEND0 SET . 6957 bytes of ROM space left in the main area of bank 1. 4763 94d3 echo " ",[($B000 - .)]d , "bytes of ROM space left in the main area of bank 1." 4764 94d3 - if ($B000 - .) < 0 4765 94d3 -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 4766 94d3 endif 4767 94d3 4768 b000 ORG $B000,0 ; ************* 4769 b000 4770 b000 RORG $B000 ; ************* 4771 b000 4772 b000 vertical_shooting_font 4773 b000 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4774 b020 00 00 00 00* HEX 00000000000000000000000000 4775 b02d vertical_shooting_ship 4776 b02d 07 d0 HEX 07d0 4777 b02f vertical_shooting_ship_tallsprite_00 4778 b02f 80 02 HEX 8002 4779 b031 vertical_shooting_bullet 4780 b031 28 HEX 28 4781 b032 vertical_shooting_enemyshot 4782 b032 00 HEX 00 4783 b033 vertical_shooting_powerup 4784 b033 28 00 HEX 2800 4785 b035 vertical_shooting_enemy01 4786 b035 09 e0 HEX 09e0 4787 b037 vertical_shooting_enemy01_tallsprite_00 4788 b037 40 03 HEX 4003 4789 b039 vertical_shooting_1up 4790 b039 15 55 HEX 1555 4791 b03b vertical_shooting_explosion_01 4792 b03b 02 80 HEX 0280 4793 b03d vertical_shooting_explosion_01_tallsprite_00 4794 b03d 00 00 HEX 0000 4795 b03f vertical_shooting_explosion_02 4796 b03f 05 50 HEX 0550 4797 b041 vertical_shooting_explosion_02_tallsprite_00 4798 b041 00 00 HEX 0000 4799 b043 vertical_shooting_explosion_03 4800 b043 15 54 HEX 1554 4801 b045 vertical_shooting_explosion_03_tallsprite_00 4802 b045 00 00 HEX 0000 4803 b047 vertical_shooting_explosion_04 4804 b047 07 d0 HEX 07d0 4805 b049 vertical_shooting_explosion_04_tallsprite_00 4806 b049 00 00 HEX 0000 4807 b04b vertical_shooting_explosion_05 4808 b04b 0c 30 HEX 0c30 4809 b04d vertical_shooting_explosion_05_tallsprite_00 4810 b04d 01 40 HEX 0140 4811 b04f vertical_shooting_explosion_06 4812 b04f 00 00 HEX 0000 4813 b051 vertical_shooting_explosion_06_tallsprite_00 4814 b051 01 40 HEX 0140 4815 b053 vertical_shooting_explosion_07 4816 b053 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4817 b067 vertical_shooting_explosion_07_tallsprite_00 4818 b067 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4819 b07b vertical_shooting_explosion_08 4820 b07b 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4821 b08f vertical_shooting_explosion_08_tallsprite_00 4822 b08f 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4823 b0a3 vertical_shooting_explosion_09 4824 b0a3 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4825 b0b7 vertical_shooting_explosion_09_tallsprite_00 4826 b0b7 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4827 b0cb vertical_shooting_explosion_10 4828 b0cb 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4829 b0df vertical_shooting_explosion_10_tallsprite_00 4830 b0df 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4831 b0f3 vertical_shooting_laser 4832 b0f3 88 HEX 88 4833 b0f4 vertical_shooting_laser_tallsprite_00 4834 b0f4 cc HEX cc 4835 b0f5 4836 b100 ORG $B100,0 ; ************* 4837 b100 4838 b100 RORG $B100 ; ************* 4839 b100 4840 b100 ;vertical_shooting_font 4841 b100 00 54 54 54* HEX 0054545454045454045404445054505440544454104454444410401444501014 4842 b120 10 44 44 10* HEX 10444410544040101040400000 4843 b12d ;vertical_shooting_ship 4844 b12d 07 d0 HEX 07d0 4845 b12f ;vertical_shooting_ship_tallsprite_00 4846 b12f 80 02 HEX 8002 4847 b131 ;vertical_shooting_bullet 4848 b131 28 HEX 28 4849 b132 ;vertical_shooting_enemyshot 4850 b132 88 HEX 88 4851 b133 ;vertical_shooting_powerup 4852 b133 78 08 HEX 7808 4853 b135 ;vertical_shooting_enemy01 4854 b135 09 e0 HEX 09e0 4855 b137 ;vertical_shooting_enemy01_tallsprite_00 4856 b137 50 0f HEX 500f 4857 b139 ;vertical_shooting_1up 4858 b139 ea a9 HEX eaa9 4859 b13b ;vertical_shooting_explosion_01 4860 b13b 01 40 HEX 0140 4861 b13d ;vertical_shooting_explosion_01_tallsprite_00 4862 b13d 00 00 HEX 0000 4863 b13f ;vertical_shooting_explosion_02 4864 b13f 09 60 HEX 0960 4865 b141 ;vertical_shooting_explosion_02_tallsprite_00 4866 b141 00 00 HEX 0000 4867 b143 ;vertical_shooting_explosion_03 4868 b143 25 58 HEX 2558 4869 b145 ;vertical_shooting_explosion_03_tallsprite_00 4870 b145 00 00 HEX 0000 4871 b147 ;vertical_shooting_explosion_04 4872 b147 05 50 HEX 0550 4873 b149 ;vertical_shooting_explosion_04_tallsprite_00 4874 b149 02 80 HEX 0280 4875 b14b ;vertical_shooting_explosion_05 4876 b14b 0b e0 HEX 0be0 4877 b14d ;vertical_shooting_explosion_05_tallsprite_00 4878 b14d 01 40 HEX 0140 4879 b14f ;vertical_shooting_explosion_06 4880 b14f 0c 30 HEX 0c30 4881 b151 ;vertical_shooting_explosion_06_tallsprite_00 4882 b151 01 40 HEX 0140 4883 b153 ;vertical_shooting_explosion_07 4884 b153 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4885 b167 ;vertical_shooting_explosion_07_tallsprite_00 4886 b167 00 00 00 00* HEX 0000000000000140014001400140014001400000 4887 b17b ;vertical_shooting_explosion_08 4888 b17b 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4889 b18f ;vertical_shooting_explosion_08_tallsprite_00 4890 b18f 00 00 00 00* HEX 0000000000000140014001400140014001400000 4891 b1a3 ;vertical_shooting_explosion_09 4892 b1a3 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4893 b1b7 ;vertical_shooting_explosion_09_tallsprite_00 4894 b1b7 00 00 00 00* HEX 0000000000000140014001400140014001400000 4895 b1cb ;vertical_shooting_explosion_10 4896 b1cb 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4897 b1df ;vertical_shooting_explosion_10_tallsprite_00 4898 b1df 00 00 00 00* HEX 0000000000000140014001400140014001400000 4899 b1f3 ;vertical_shooting_laser 4900 b1f3 88 HEX 88 4901 b1f4 ;vertical_shooting_laser_tallsprite_00 4902 b1f4 cc HEX cc 4903 b1f5 4904 b200 ORG $B200,0 ; ************* 4905 b200 4906 b200 RORG $B200 ; ************* 4907 b200 4908 b200 ;vertical_shooting_font 4909 b200 00 44 10 40* HEX 0044104004040444044404444440444040444410444440444444404444041044 4910 b220 10 54 44 10* HEX 10544410400010000000100000 4911 b22d ;vertical_shooting_ship 4912 b22d 03 c0 HEX 03c0 4913 b22f ;vertical_shooting_ship_tallsprite_00 4914 b22f a1 4a HEX a14a 4915 b231 ;vertical_shooting_bullet 4916 b231 3c HEX 3c 4917 b232 ;vertical_shooting_enemyshot 4918 b232 10 HEX 10 4919 b233 ;vertical_shooting_powerup 4920 b233 78 1e HEX 781e 4921 b235 ;vertical_shooting_enemy01 4922 b235 19 ec HEX 19ec 4923 b237 ;vertical_shooting_enemy01_tallsprite_00 4924 b237 5a af HEX 5aaf 4925 b239 ;vertical_shooting_1up 4926 b239 d5 58 HEX d558 4927 b23b ;vertical_shooting_explosion_01 4928 b23b 00 00 HEX 0000 4929 b23d ;vertical_shooting_explosion_01_tallsprite_00 4930 b23d 00 00 HEX 0000 4931 b23f ;vertical_shooting_explosion_02 4932 b23f 02 80 HEX 0280 4933 b241 ;vertical_shooting_explosion_02_tallsprite_00 4934 b241 00 00 HEX 0000 4935 b243 ;vertical_shooting_explosion_03 4936 b243 09 60 HEX 0960 4937 b245 ;vertical_shooting_explosion_03_tallsprite_00 4938 b245 00 00 HEX 0000 4939 b247 ;vertical_shooting_explosion_04 4940 b247 05 50 HEX 0550 4941 b249 ;vertical_shooting_explosion_04_tallsprite_00 4942 b249 02 80 HEX 0280 4943 b24b ;vertical_shooting_explosion_05 4944 b24b 0a a0 HEX 0aa0 4945 b24d ;vertical_shooting_explosion_05_tallsprite_00 4946 b24d 05 50 HEX 0550 4947 b24f ;vertical_shooting_explosion_06 4948 b24f 0b e0 HEX 0be0 4949 b251 ;vertical_shooting_explosion_06_tallsprite_00 4950 b251 05 50 HEX 0550 4951 b253 ;vertical_shooting_explosion_07 4952 b253 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4953 b267 ;vertical_shooting_explosion_07_tallsprite_00 4954 b267 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4955 b27b ;vertical_shooting_explosion_08 4956 b27b 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4957 b28f ;vertical_shooting_explosion_08_tallsprite_00 4958 b28f 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4959 b2a3 ;vertical_shooting_explosion_09 4960 b2a3 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4961 b2b7 ;vertical_shooting_explosion_09_tallsprite_00 4962 b2b7 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4963 b2cb ;vertical_shooting_explosion_10 4964 b2cb 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4965 b2df ;vertical_shooting_explosion_10_tallsprite_00 4966 b2df 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4967 b2f3 ;vertical_shooting_laser 4968 b2f3 44 HEX 44 4969 b2f4 ;vertical_shooting_laser_tallsprite_00 4970 b2f4 cc HEX cc 4971 b2f5 4972 b300 ORG $B300,0 ; ************* 4973 b300 4974 b300 RORG $B300 ; ************* 4975 b300 4976 b300 ;vertical_shooting_font 4977 b300 00 44 10 40* HEX 0044104004040444044404444440444040444410044440444444404444041044 4978 b320 54 54 44 10* HEX 54544410100000101000000000 4979 b32d ;vertical_shooting_ship 4980 b32d 01 40 HEX 0140 4981 b32f ;vertical_shooting_ship_tallsprite_00 4982 b32f a5 5a HEX a55a 4983 b331 ;vertical_shooting_bullet 4984 b331 3c HEX 3c 4985 b332 ;vertical_shooting_enemyshot 4986 b332 74 HEX 74 4987 b333 ;vertical_shooting_powerup 4988 b333 7a a4 HEX 7aa4 4989 b335 ;vertical_shooting_enemy01 4990 b335 59 ef HEX 59ef 4991 b337 ;vertical_shooting_enemy01_tallsprite_00 4992 b337 59 ef HEX 59ef 4993 b339 ;vertical_shooting_1up 4994 b339 35 60 HEX 3560 4995 b33b ;vertical_shooting_explosion_01 4996 b33b 00 00 HEX 0000 4997 b33d ;vertical_shooting_explosion_01_tallsprite_00 4998 b33d 00 00 HEX 0000 4999 b33f ;vertical_shooting_explosion_02 5000 b33f 00 00 HEX 0000 5001 b341 ;vertical_shooting_explosion_02_tallsprite_00 5002 b341 00 00 HEX 0000 5003 b343 ;vertical_shooting_explosion_03 5004 b343 02 80 HEX 0280 5005 b345 ;vertical_shooting_explosion_03_tallsprite_00 5006 b345 00 00 HEX 0000 5007 b347 ;vertical_shooting_explosion_04 5008 b347 09 60 HEX 0960 5009 b349 ;vertical_shooting_explosion_04_tallsprite_00 5010 b349 09 60 HEX 0960 5011 b34b ;vertical_shooting_explosion_05 5012 b34b 06 90 HEX 0690 5013 b34d ;vertical_shooting_explosion_05_tallsprite_00 5014 b34d 06 90 HEX 0690 5015 b34f ;vertical_shooting_explosion_06 5016 b34f 06 90 HEX 0690 5017 b351 ;vertical_shooting_explosion_06_tallsprite_00 5018 b351 06 90 HEX 0690 5019 b353 ;vertical_shooting_explosion_07 5020 b353 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5021 b367 ;vertical_shooting_explosion_07_tallsprite_00 5022 b367 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5023 b37b ;vertical_shooting_explosion_08 5024 b37b 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5025 b38f ;vertical_shooting_explosion_08_tallsprite_00 5026 b38f 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5027 b3a3 ;vertical_shooting_explosion_09 5028 b3a3 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5029 b3b7 ;vertical_shooting_explosion_09_tallsprite_00 5030 b3b7 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5031 b3cb ;vertical_shooting_explosion_10 5032 b3cb 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5033 b3df ;vertical_shooting_explosion_10_tallsprite_00 5034 b3df 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5035 b3f3 ;vertical_shooting_laser 5036 b3f3 44 HEX 44 5037 b3f4 ;vertical_shooting_laser_tallsprite_00 5038 b3f4 cc HEX cc 5039 b3f5 5040 b400 ORG $B400,0 ; ************* 5041 b400 5042 b400 RORG $B400 ; ************* 5043 b400 5044 b400 ;vertical_shooting_font 5045 b400 00 44 10 54* HEX 0044105454545454045454545040445454445410045040544444504450101044 5046 b420 44 44 10 10* HEX 44441010100000101000000000 5047 b42d ;vertical_shooting_ship 5048 b42d 01 40 HEX 0140 5049 b42f ;vertical_shooting_ship_tallsprite_00 5050 b42f a5 5a HEX a55a 5051 b431 ;vertical_shooting_bullet 5052 b431 14 HEX 14 5053 b432 ;vertical_shooting_enemyshot 5054 b432 74 HEX 74 5055 b433 ;vertical_shooting_powerup 5056 b433 75 7a HEX 757a 5057 b435 ;vertical_shooting_enemy01 5058 b435 59 6f HEX 596f 5059 b437 ;vertical_shooting_enemy01_tallsprite_00 5060 b437 59 ef HEX 59ef 5061 b439 ;vertical_shooting_1up 5062 b439 35 60 HEX 3560 5063 b43b ;vertical_shooting_explosion_01 5064 b43b 00 00 HEX 0000 5065 b43d ;vertical_shooting_explosion_01_tallsprite_00 5066 b43d 00 00 HEX 0000 5067 b43f ;vertical_shooting_explosion_02 5068 b43f 00 00 HEX 0000 5069 b441 ;vertical_shooting_explosion_02_tallsprite_00 5070 b441 00 00 HEX 0000 5071 b443 ;vertical_shooting_explosion_03 5072 b443 00 00 HEX 0000 5073 b445 ;vertical_shooting_explosion_03_tallsprite_00 5074 b445 02 80 HEX 0280 5075 b447 ;vertical_shooting_explosion_04 5076 b447 09 60 HEX 0960 5077 b449 ;vertical_shooting_explosion_04_tallsprite_00 5078 b449 09 60 HEX 0960 5079 b44b ;vertical_shooting_explosion_05 5080 b44b 06 90 HEX 0690 5081 b44d ;vertical_shooting_explosion_05_tallsprite_00 5082 b44d 06 90 HEX 0690 5083 b44f ;vertical_shooting_explosion_06 5084 b44f 06 90 HEX 0690 5085 b451 ;vertical_shooting_explosion_06_tallsprite_00 5086 b451 06 90 HEX 0690 5087 b453 ;vertical_shooting_explosion_07 5088 b453 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5089 b467 ;vertical_shooting_explosion_07_tallsprite_00 5090 b467 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5091 b47b ;vertical_shooting_explosion_08 5092 b47b 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5093 b48f ;vertical_shooting_explosion_08_tallsprite_00 5094 b48f 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5095 b4a3 ;vertical_shooting_explosion_09 5096 b4a3 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5097 b4b7 ;vertical_shooting_explosion_09_tallsprite_00 5098 b4b7 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5099 b4cb ;vertical_shooting_explosion_10 5100 b4cb 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5101 b4df ;vertical_shooting_explosion_10_tallsprite_00 5102 b4df 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5103 b4f3 ;vertical_shooting_laser 5104 b4f3 44 HEX 44 5105 b4f4 ;vertical_shooting_laser_tallsprite_00 5106 b4f4 cc HEX cc 5107 b4f5 5108 b500 ORG $B500,0 ; ************* 5109 b500 5110 b500 RORG $B500 ; ************* 5111 b500 5112 b500 ;vertical_shooting_font 5113 b500 00 44 10 04* HEX 0044100404444040044444444440444040404410044440544444444444401044 5114 b520 44 44 44 54* HEX 44444454100000041000000000 5115 b52d ;vertical_shooting_ship 5116 b52d 01 40 HEX 0140 5117 b52f ;vertical_shooting_ship_tallsprite_00 5118 b52f a5 5a HEX a55a 5119 b531 ;vertical_shooting_bullet 5120 b531 14 HEX 14 5121 b532 ;vertical_shooting_enemyshot 5122 b532 74 HEX 74 5123 b533 ;vertical_shooting_powerup 5124 b533 78 1e HEX 781e 5125 b535 ;vertical_shooting_enemy01 5126 b535 5a af HEX 5aaf 5127 b537 ;vertical_shooting_enemy01_tallsprite_00 5128 b537 19 ec HEX 19ec 5129 b539 ;vertical_shooting_1up 5130 b539 0d 80 HEX 0d80 5131 b53b ;vertical_shooting_explosion_01 5132 b53b 00 00 HEX 0000 5133 b53d ;vertical_shooting_explosion_01_tallsprite_00 5134 b53d 00 00 HEX 0000 5135 b53f ;vertical_shooting_explosion_02 5136 b53f 00 00 HEX 0000 5137 b541 ;vertical_shooting_explosion_02_tallsprite_00 5138 b541 02 80 HEX 0280 5139 b543 ;vertical_shooting_explosion_03 5140 b543 00 00 HEX 0000 5141 b545 ;vertical_shooting_explosion_03_tallsprite_00 5142 b545 09 60 HEX 0960 5143 b547 ;vertical_shooting_explosion_04 5144 b547 02 80 HEX 0280 5145 b549 ;vertical_shooting_explosion_04_tallsprite_00 5146 b549 05 50 HEX 0550 5147 b54b ;vertical_shooting_explosion_05 5148 b54b 05 50 HEX 0550 5149 b54d ;vertical_shooting_explosion_05_tallsprite_00 5150 b54d 0a a0 HEX 0aa0 5151 b54f ;vertical_shooting_explosion_06 5152 b54f 05 50 HEX 0550 5153 b551 ;vertical_shooting_explosion_06_tallsprite_00 5154 b551 0b e0 HEX 0be0 5155 b553 ;vertical_shooting_explosion_07 5156 b553 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5157 b567 ;vertical_shooting_explosion_07_tallsprite_00 5158 b567 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5159 b57b ;vertical_shooting_explosion_08 5160 b57b 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5161 b58f ;vertical_shooting_explosion_08_tallsprite_00 5162 b58f 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5163 b5a3 ;vertical_shooting_explosion_09 5164 b5a3 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5165 b5b7 ;vertical_shooting_explosion_09_tallsprite_00 5166 b5b7 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5167 b5cb ;vertical_shooting_explosion_10 5168 b5cb 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5169 b5df ;vertical_shooting_explosion_10_tallsprite_00 5170 b5df 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5171 b5f3 ;vertical_shooting_laser 5172 b5f3 44 HEX 44 5173 b5f4 ;vertical_shooting_laser_tallsprite_00 5174 b5f4 88 HEX 88 5175 b5f5 5176 b600 ORG $B600,0 ; ************* 5177 b600 5178 b600 RORG $B600 ; ************* 5179 b600 5180 b600 ;vertical_shooting_font 5181 b600 00 44 50 04* HEX 0044500404444040044444444440444040404410044440544444444444401044 5182 b620 44 44 44 44* HEX 44444444040000441000001044 5183 b62d ;vertical_shooting_ship 5184 b62d 01 40 HEX 0140 5185 b62f ;vertical_shooting_ship_tallsprite_00 5186 b62f a7 da HEX a7da 5187 b631 ;vertical_shooting_bullet 5188 b631 14 HEX 14 5189 b632 ;vertical_shooting_enemyshot 5190 b632 10 HEX 10 5191 b633 ;vertical_shooting_powerup 5192 b633 7a bc HEX 7abc 5193 b635 ;vertical_shooting_enemy01 5194 b635 50 07 HEX 5007 5195 b637 ;vertical_shooting_enemy01_tallsprite_00 5196 b637 09 e0 HEX 09e0 5197 b639 ;vertical_shooting_1up 5198 b639 0d 80 HEX 0d80 5199 b63b ;vertical_shooting_explosion_01 5200 b63b 00 00 HEX 0000 5201 b63d ;vertical_shooting_explosion_01_tallsprite_00 5202 b63d 01 40 HEX 0140 5203 b63f ;vertical_shooting_explosion_02 5204 b63f 00 00 HEX 0000 5205 b641 ;vertical_shooting_explosion_02_tallsprite_00 5206 b641 09 60 HEX 0960 5207 b643 ;vertical_shooting_explosion_03 5208 b643 00 00 HEX 0000 5209 b645 ;vertical_shooting_explosion_03_tallsprite_00 5210 b645 25 58 HEX 2558 5211 b647 ;vertical_shooting_explosion_04 5212 b647 02 80 HEX 0280 5213 b649 ;vertical_shooting_explosion_04_tallsprite_00 5214 b649 05 50 HEX 0550 5215 b64b ;vertical_shooting_explosion_05 5216 b64b 01 40 HEX 0140 5217 b64d ;vertical_shooting_explosion_05_tallsprite_00 5218 b64d 0b e0 HEX 0be0 5219 b64f ;vertical_shooting_explosion_06 5220 b64f 01 40 HEX 0140 5221 b651 ;vertical_shooting_explosion_06_tallsprite_00 5222 b651 0c 30 HEX 0c30 5223 b653 ;vertical_shooting_explosion_07 5224 b653 00 00 00 00* HEX 0000000000000140014001400140014001400000 5225 b667 ;vertical_shooting_explosion_07_tallsprite_00 5226 b667 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5227 b67b ;vertical_shooting_explosion_08 5228 b67b 00 00 00 00* HEX 0000000000000140014001400140014001400000 5229 b68f ;vertical_shooting_explosion_08_tallsprite_00 5230 b68f 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5231 b6a3 ;vertical_shooting_explosion_09 5232 b6a3 00 00 00 00* HEX 0000000000000140014001400140014001400000 5233 b6b7 ;vertical_shooting_explosion_09_tallsprite_00 5234 b6b7 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5235 b6cb ;vertical_shooting_explosion_10 5236 b6cb 00 00 00 00* HEX 0000000000000140014001400140014001400000 5237 b6df ;vertical_shooting_explosion_10_tallsprite_00 5238 b6df 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5239 b6f3 ;vertical_shooting_laser 5240 b6f3 44 HEX 44 5241 b6f4 ;vertical_shooting_laser_tallsprite_00 5242 b6f4 88 HEX 88 5243 b6f5 5244 b700 ORG $B700,0 ; ************* 5245 b700 5246 b700 RORG $B700 ; ************* 5247 b700 5248 b700 ;vertical_shooting_font 5249 b700 00 54 10 54* HEX 0054105454445454545454545054505454544454044440445010501050145444 5250 b720 44 44 44 44* HEX 44444444540000101040401044 5251 b72d ;vertical_shooting_ship 5252 b72d 01 40 HEX 0140 5253 b72f ;vertical_shooting_ship_tallsprite_00 5254 b72f 27 d8 HEX 27d8 5255 b731 ;vertical_shooting_bullet 5256 b731 00 HEX 00 5257 b732 ;vertical_shooting_enemyshot 5258 b732 88 HEX 88 5259 b733 ;vertical_shooting_powerup 5260 b733 55 50 HEX 5550 5261 b735 ;vertical_shooting_enemy01 5262 b735 40 01 HEX 4001 5263 b737 ;vertical_shooting_enemy01_tallsprite_00 5264 b737 09 e0 HEX 09e0 5265 b739 ;vertical_shooting_1up 5266 b739 03 00 HEX 0300 5267 b73b ;vertical_shooting_explosion_01 5268 b73b 00 00 HEX 0000 5269 b73d ;vertical_shooting_explosion_01_tallsprite_00 5270 b73d 02 80 HEX 0280 5271 b73f ;vertical_shooting_explosion_02 5272 b73f 00 00 HEX 0000 5273 b741 ;vertical_shooting_explosion_02_tallsprite_00 5274 b741 05 50 HEX 0550 5275 b743 ;vertical_shooting_explosion_03 5276 b743 00 00 HEX 0000 5277 b745 ;vertical_shooting_explosion_03_tallsprite_00 5278 b745 15 54 HEX 1554 5279 b747 ;vertical_shooting_explosion_04 5280 b747 00 00 HEX 0000 5281 b749 ;vertical_shooting_explosion_04_tallsprite_00 5282 b749 07 d0 HEX 07d0 5283 b74b ;vertical_shooting_explosion_05 5284 b74b 01 40 HEX 0140 5285 b74d ;vertical_shooting_explosion_05_tallsprite_00 5286 b74d 0c 30 HEX 0c30 5287 b74f ;vertical_shooting_explosion_06 5288 b74f 01 40 HEX 0140 5289 b751 ;vertical_shooting_explosion_06_tallsprite_00 5290 b751 00 00 HEX 0000 5291 b753 ;vertical_shooting_explosion_07 5292 b753 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5293 b767 ;vertical_shooting_explosion_07_tallsprite_00 5294 b767 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5295 b77b ;vertical_shooting_explosion_08 5296 b77b 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5297 b78f ;vertical_shooting_explosion_08_tallsprite_00 5298 b78f 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5299 b7a3 ;vertical_shooting_explosion_09 5300 b7a3 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5301 b7b7 ;vertical_shooting_explosion_09_tallsprite_00 5302 b7b7 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5303 b7cb ;vertical_shooting_explosion_10 5304 b7cb 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5305 b7df ;vertical_shooting_explosion_10_tallsprite_00 5306 b7df 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5307 b7f3 ;vertical_shooting_laser 5308 b7f3 44 HEX 44 5309 b7f4 ;vertical_shooting_laser_tallsprite_00 5310 b7f4 88 HEX 88 5311 b7f5 5312 b800 ORG $B800,0 ; ************* 5313 b800 5314 b800 RORG $B800 ; ************* 5315 b800 - if SPACEOVERFLOW > 0 5316 b800 - echo "" 5317 b800 - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 5318 b800 - echo "######## look above for areas with negative ROM space left." 5319 b800 - echo "######## Aborting assembly." 5320 b800 - ERR 5321 b800 endif 5322 b800 5323 b800 5324 b800 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5325 b800 5326 b800 - ifnconst bankswitchmode 5327 b800 - if ( * < $f000 ) 5328 b800 - ORG $F000 5329 b800 - endif 5330 b800 else 5331 b800 ifconst ROM128K 5332 b800 if ( * < $f000 ) 5333 27000 ORG $27000 5334 27000 RORG $F000 5335 27000 endif 5336 27000 endif 5337 27000 - ifconst ROM144K 5338 27000 - if ( * < $f000 ) 5339 27000 - ORG $27000 5340 27000 - RORG $F000 5341 27000 - endif 5342 27000 endif 5343 27000 - ifconst ROM256K 5344 27000 - if ( * < $f000 ) 5345 27000 - ORG $47000 5346 27000 - RORG $F000 5347 27000 - endif 5348 27000 endif 5349 27000 - ifconst ROM272K 5350 27000 - if ( * < $f000 ) 5351 27000 - ORG $47000 5352 27000 - RORG $F000 5353 27000 - endif 5354 27000 endif 5355 27000 - ifconst ROM512K 5356 27000 - if ( * < $f000 ) 5357 27000 - ORG $87000 5358 27000 - RORG $F000 5359 27000 - endif 5360 27000 endif 5361 27000 - ifconst ROM528K 5362 27000 - if ( * < $f000 ) 5363 27000 - ORG $87000 5364 27000 - RORG $F000 5365 27000 - endif 5366 27000 endif 5367 27000 endif 5368 27000 5369 27000 ; all of these "modules" have conditional clauses in them, so even though 5370 27000 ; they're always included here, they don't take up rom unless the user 5371 27000 ; explicitly enables support for the feature. 5372 27000 5373 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 5375 27000 endif 5376 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 5378 27000 endif 5379 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 5381 27000 endif 5382 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 5384 27000 endif 5385 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5386 27000 5387 27000 ;standard routimes needed for pretty much all games 5388 27000 5389 27000 ; some definitions used with "set debug color" 5390 27000 00 91 DEBUGCALC = $91 5391 27000 00 41 DEBUGWASTE = $41 5392 27000 00 c1 DEBUGDRAW = $C1 5393 27000 5394 27000 ;NMI and IRQ handlers 5395 27000 NMI 5396 27000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 5397 27000 48 pha ; save A 5398 27001 a5 4d lda visibleover 5399 27003 49 ff eor #255 5400 27005 85 4d sta visibleover 5401 27007 - ifconst DEBUGINTERRUPT 5402 27007 - and #$93 5403 27007 - sta BACKGRND 5404 27007 endif 5405 27007 ce b2 01 dec interruptindex 5406 2700a d0 03 bne skipreallyoffvisible 5407 2700c 4c 6e f0 jmp reallyoffvisible 5408 2700f skipreallyoffvisible 5409 2700f a5 4d lda visibleover 5410 27011 d0 03 bne carryontopscreenroutine 5411 27013 - ifconst .bottomscreenroutine 5412 27013 - jsr .bottomscreenroutine 5413 27013 endif 5414 27013 5415 27013 4c 60 f0 jmp skiptopscreenroutine 5416 27016 carryontopscreenroutine 5417 27016 8a txa ; save X+Y 5418 27017 48 pha 5419 27018 98 tya 5420 27019 48 pha 5421 2701a d8 cld 5422 2701b - ifconst .topscreenroutine 5423 2701b - jsr .topscreenroutine 5424 2701b endif 5425 2701b ifnconst CANARYOFF 5426 2701b ad c1 01 lda canary 5427 2701e f0 07 beq skipcanarytriggered 5428 27020 a9 45 lda #$45 5429 27022 85 20 sta BACKGRND 5430 27024 4c 66 f0 jmp skipbrkolorset ; common crash dump routine, if available 5431 27027 skipcanarytriggered 5432 27027 endif 5433 27027 5434 27027 ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 5435 2702a 5436 2702a ; ** Other important routines that need to regularly run, and can run onscreen. 5437 2702a ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 5438 2702a 5439 2702a - ifconst LONGCONTROLLERREAD 5440 2702a -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 5441 2702a - ldy port1control 5442 2702a - lda longreadtype,y 5443 2702a - beq LLRET1 5444 2702a - tay 5445 2702a - lda longreadroutinehiP1,y 5446 2702a - sta inttemp4 5447 2702a - lda longreadroutineloP1,y 5448 2702a - sta inttemp3 5449 2702a - jmp (inttemp3) 5450 2702a -LLRET1 5451 2702a - ldy port0control 5452 2702a - lda longreadtype,y 5453 2702a - beq LLRET0 5454 2702a - tay 5455 2702a - lda longreadroutinehiP0,y 5456 2702a - sta inttemp4 5457 2702a - lda longreadroutineloP0,y 5458 2702a - sta inttemp3 5459 2702a - jmp (inttemp3) 5460 2702a -LLRET0 5461 2702a - 5462 2702a - 5463 2702a - ifconst PADDLERANGE 5464 2702a -TIMEVAL = PADDLERANGE 5465 2702a - else 5466 2702a -TIMEVAL = 160 5467 2702a - endif 5468 2702a -TIMEOFFSET = 10 5469 2702a - 5470 2702a endif ; LONGCONTROLLERREAD 5471 2702a 5472 2702a 5473 2702a 20 e0 f1 jsr servicesfxchannels 5474 2702d - ifconst MUSICTRACKER 5475 2702d - jsr servicesong 5476 2702d endif ; MUSICTRACKER 5477 2702d 5478 2702d ee a4 01 inc framecounter 5479 27030 ad a4 01 lda framecounter 5480 27033 29 3f and #63 5481 27035 d0 08 bne skipcountdownseconds 5482 27037 ad a5 01 lda countdownseconds 5483 2703a f0 03 beq skipcountdownseconds 5484 2703c ce a5 01 dec countdownseconds 5485 2703f skipcountdownseconds 5486 2703f 5487 2703f a2 01 ldx #1 5488 27041 buttonreadloop 5489 27041 8a txa 5490 27042 48 pha 5491 27043 bc b7 01 ldy port0control,x 5492 27046 b9 c3 f1 lda buttonhandlerlo,y 5493 27049 85 da sta inttemp3 5494 2704b b9 b8 f1 lda buttonhandlerhi,y 5495 2704e 85 db sta inttemp4 5496 27050 05 da ora inttemp3 5497 27052 f0 03 beq buttonreadloopreturn 5498 27054 6c da 00 jmp (inttemp3) 5499 27057 buttonreadloopreturn 5500 27057 68 pla 5501 27058 aa tax 5502 27059 ca dex 5503 2705a 10 e5 bpl buttonreadloop 5504 2705c 5505 2705c - ifconst KEYPADSUPPORT 5506 2705c - jsr keypadrowselect 5507 2705c endif ; KEYPADSUPPORT 5508 2705c 5509 2705c 5510 2705c - ifconst DOUBLEBUFFER 5511 2705c - lda doublebufferminimumframeindex 5512 2705c - beq skipdoublebufferminimumframeindexadjust 5513 2705c - dec doublebufferminimumframeindex 5514 2705c -skipdoublebufferminimumframeindexadjust 5515 2705c endif 5516 2705c 5517 2705c 68 pla 5518 2705d a8 tay 5519 2705e 68 pla 5520 2705f aa tax 5521 27060 skiptopscreenroutine 5522 27060 68 pla 5523 27061 40 RTI 5524 27062 5525 27062 IRQ ; the only source of non-nmi interrupt should be the BRK opcode. 5526 27062 ifnconst BREAKPROTECTOFF 5527 27062 a9 1a lda #$1A 5528 27064 85 20 sta BACKGRND 5529 27066 skipbrkolorset 5530 27066 skipbrkdetected 5531 27066 a9 60 lda #$60 5532 27068 8d 07 21 sta sCTRL 5533 2706b 85 3c sta CTRL 5534 2706d ifnconst hiscorefont 5535 2706d 02 .byte.b $02 ; KIL/JAM 5536 2706e - else ; hiscorefont is present 5537 2706e - ifconst CRASHDUMP 5538 2706e - bit MSTAT 5539 2706e - bpl skipbrkdetected ; wait for vblank to ensure we're clear of NMI 5540 2706e - 5541 2706e - ifconst dumpbankswitch 5542 2706e - lda dumpbankswitch 5543 2706e - pha 5544 2706e - endif 5545 2706e - 5546 2706e - ; bankswitch if needed, to get to the hiscore font 5547 2706e - ifconst bankswitchmode 5548 2706e - ifconst included.hiscore.asm.bank 5549 2706e - ifconst MCPDEVCART 5550 2706e - lda #($18 | included.hiscore.asm.bank) 5551 2706e - sta $3000 5552 2706e - else 5553 2706e - lda #(included.hiscore.asm.bank) 5554 2706e - sta $8000 5555 2706e - endif 5556 2706e - endif ; included.hiscore.asm.bank 5557 2706e - endif ; bankswitchmode 5558 2706e - 5559 2706e - ifconst DOUBLEBUFFER 5560 2706e - ;turn off double-buffering, if on... 5561 2706e - lda #>DLLMEM 5562 2706e - sta DPPH 5563 2706e - lda #hiscorefont 5607 2706e - sta CHARBASE 5608 2706e - sta sCHARBASE 5609 2706e - lda #%01000011 ;Enable DMA, mode=320A 5610 2706e - sta CTRL 5611 2706e - sta sCTRL 5612 2706e - .byte $02 ; KIL/JAM 5613 2706e -hiscorehexlut 5614 2706e - ; 0 1 2 3 4 5 6 7 8 9 A B C D E F 5615 2706e - .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 5616 2706e -show2700 5617 2706e - ; lo mode hi width=29 x EODL 5618 2706e - .byte $00, %01100000, $27, 3, 20, 0,0,0 5619 2706e - else ; CRASHDUMP 5620 2706e - .byte $02 ; KIL/JAM 5621 2706e - endif ; crashdump 5622 2706e endif ; hiscorefont 5623 2706e - else 5624 2706e - RTI 5625 2706e endif 5626 2706e 5627 2706e - ifconst LONGCONTROLLERREAD 5628 2706e - 5629 2706e -longreadtype 5630 2706e - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 5631 2706e - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 5632 2706e - .byte 3, 3, 0 ; STMOUSE AMOUSE ATARIVOX 5633 2706e - 5634 2706e -longreadroutineloP0 5635 2706e - .byte LLRET0 ; 0 = no routine 5642 2706e - .byte >paddleport0update ; 1 = paddle 5643 2706e - .byte >trakball0update ; 2 = trackball 5644 2706e - .byte >mouse0update ; 3 = mouse 5645 2706e - 5646 2706e -longreadroutineloP1 5647 2706e - .byte LLRET1 ; 0 = no routine 5654 2706e - .byte >paddleport1update ; 1 = paddle 5655 2706e - .byte >trakball1update ; 2 = trackball 5656 2706e - .byte >mouse1update ; 3 = mouse 5657 2706e - 5658 2706e - 5659 2706e -SETTIM64T 5660 2706e - bne skipdefaulttime 5661 2706e - ifnconst PADDLESMOOTHINGOFF 5662 2706e - lda #(TIMEVAL+TIMEOFFSET+1) 5663 2706e - else 5664 2706e - lda #(TIMEVAL+TIMEOFFSET) 5665 2706e - endif 5666 2706e -skipdefaulttime 5667 2706e - tay 5668 2706e - dey 5669 2706e -.setTIM64Tloop 5670 2706e - sta TIM64T 5671 2706e - cpy INTIM 5672 2706e - bne .setTIM64Tloop 5673 2706e - rts 5674 2706e endif ; LONGCONTROLLERREAD 5675 2706e 5676 2706e reallyoffvisible 5677 2706e 85 24 sta WSYNC 5678 27070 5679 27070 a9 00 lda #0 5680 27072 85 4d sta visibleover 5681 27074 - ifconst DEBUGINTERRUPT 5682 27074 - sta BACKGRND 5683 27074 endif 5684 27074 5685 27074 a9 03 lda #3 5686 27076 8d b2 01 sta interruptindex 5687 27079 5688 27079 8a txa 5689 2707a 48 pha 5690 2707b 98 tya 5691 2707c 48 pha 5692 2707d d8 cld 5693 2707e 5694 2707e 5695 2707e 20 5a f1 jsr uninterruptableroutines 5696 27081 5697 27081 - ifconst .userinterrupt 5698 27081 - jsr .userinterrupt 5699 27081 endif 5700 27081 5701 27081 - ifconst KEYPADSUPPORT 5702 27081 - jsr keypadcolumnread 5703 27081 endif 5704 27081 5705 27081 68 pla 5706 27082 a8 tay 5707 27083 68 pla 5708 27084 aa tax 5709 27085 68 pla 5710 27086 40 RTI 5711 27087 5712 27087 clearscreen 5713 27087 a2 17 ldx #(WZONECOUNT-1) 5714 27089 a9 00 lda #0 5715 2708b clearscreenloop 5716 2708b 95 65 sta dlend,x 5717 2708d ca dex 5718 2708e 10 fb bpl clearscreenloop 5719 27090 a9 00 lda #0 5720 27092 8d ad 01 sta valbufend ; clear the bcd value buffer 5721 27095 8d ae 01 sta valbufendsave 5722 27098 60 rts 5723 27099 5724 27099 restorescreen 5725 27099 a2 17 ldx #(WZONECOUNT-1) 5726 2709b a9 00 lda #0 5727 2709d restorescreenloop 5728 2709d b5 82 lda dlendsave,x 5729 2709f 95 65 sta dlend,x 5730 270a1 ca dex 5731 270a2 10 f9 bpl restorescreenloop 5732 270a4 ad ae 01 lda valbufendsave 5733 270a7 8d ad 01 sta valbufend 5734 270aa 60 rts 5735 270ab 5736 270ab savescreen 5737 270ab a2 17 ldx #(WZONECOUNT-1) 5738 270ad savescreenloop 5739 270ad b5 65 lda dlend,x 5740 270af 95 82 sta dlendsave,x 5741 270b1 ca dex 5742 270b2 10 f9 bpl savescreenloop 5743 270b4 ad ad 01 lda valbufend 5744 270b7 8d ae 01 sta valbufendsave 5745 270ba - ifconst DOUBLEBUFFER 5746 270ba - lda doublebufferstate 5747 270ba - beq savescreenrts 5748 270ba - lda #1 5749 270ba - sta doublebufferbufferdirty 5750 270ba -savescreenrts 5751 270ba endif ; DOUBLEBUFFER 5752 270ba 60 rts 5753 270bb 5754 270bb drawscreen 5755 270bb 5756 270bb a9 00 lda #0 5757 270bd 85 42 sta temp1 ; not B&W if we're here... 5758 270bf 5759 270bf drawscreenwait 5760 270bf a5 4d lda visibleover 5761 270c1 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 5762 270c3 5763 270c3 ;restore some registers in case the game changed them mid-screen... 5764 270c3 ad 07 21 lda sCTRL 5765 270c6 05 42 ora temp1 5766 270c8 85 3c sta CTRL 5767 270ca ad 0b 21 lda sCHARBASE 5768 270cd 85 34 sta CHARBASE 5769 270cf 5770 270cf ;ensure all of the display list is terminated... 5771 270cf 20 40 f1 jsr terminatedisplaylist 5772 270d2 5773 270d2 ifnconst pauseroutineoff 5774 270d2 20 dd f0 jsr pauseroutine 5775 270d5 endif ; pauseroutineoff 5776 270d5 5777 270d5 ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 5778 270d5 ; delaying a full frame, but still allowing time for basic calculations. 5779 270d5 visiblescreenstartedwait 5780 270d5 a5 4d lda visibleover 5781 270d7 f0 fc beq visiblescreenstartedwait 5782 270d9 visiblescreenstartedwaitdone 5783 270d9 ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 5784 270dc 60 rts 5785 270dd 5786 270dd ifnconst pauseroutineoff 5787 270dd ; check to see if pause was pressed and released 5788 270dd pauseroutine 5789 270dd ad b3 01 lda pausedisable 5790 270e0 d0 4e bne leavepauseroutine 5791 270e2 a9 08 lda #8 5792 270e4 2c 82 02 bit SWCHB 5793 270e7 f0 29 beq pausepressed 5794 270e9 5795 270e9 ifnconst SOFTRESETASPAUSEOFF 5796 270e9 ifnconst MOUSESUPPORT 5797 270e9 ifnconst TRAKBALLSUPPORT 5798 270e9 ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 5799 270ec 29 70 and #%01110000 ; _LDU 5800 270ee f0 22 beq pausepressed 5801 270f0 endif 5802 270f0 endif 5803 270f0 endif 5804 270f0 5805 270f0 ;pause isn't pressed 5806 270f0 a9 00 lda #0 5807 270f2 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 5808 270f5 5809 270f5 ;check if we're in an already paused state 5810 270f5 ad 00 21 lda pausestate 5811 270f8 f0 36 beq leavepauseroutine ; nope, leave 5812 270fa 5813 270fa c9 01 cmp #1 ; last frame was the start of pausing 5814 270fc f0 2b beq enterpausestate2 ; move from state 1 to 2 5815 270fe 5816 270fe c9 02 cmp #2 5817 27100 f0 34 beq carryonpausing 5818 27102 5819 27102 ;pausestate must be >2, which means we're ending an unpause 5820 27102 a9 00 lda #0 5821 27104 8d ac 01 sta pausebuttonflag 5822 27107 8d 00 21 sta pausestate 5823 2710a ad 07 21 lda sCTRL 5824 2710d 85 3c sta CTRL 5825 2710f 4c 30 f1 jmp leavepauseroutine 5826 27112 5827 27112 pausepressed 5828 27112 ;pause is pressed 5829 27112 ad ac 01 lda pausebuttonflag 5830 27115 c9 ff cmp #$ff 5831 27117 f0 1d beq carryonpausing 5832 27119 5833 27119 ;its a new press, increment the state 5834 27119 ee 00 21 inc pausestate 5835 2711c 5836 2711c ;silence volume at the start and end of pausing 5837 2711c a9 00 lda #0 5838 2711e 85 19 sta AUDV0 5839 27120 85 1a sta AUDV1 5840 27122 5841 27122 - ifconst pokeysupport 5842 27122 - ldy #7 5843 27122 -pausesilencepokeyaudioloop 5844 27122 - sta (pokeybase),y 5845 27122 - dey 5846 27122 - bpl pausesilencepokeyaudioloop 5847 27122 endif ; pokeysupport 5848 27122 5849 27122 a9 ff lda #$ff 5850 27124 8d ac 01 sta pausebuttonflag 5851 27127 d0 0d bne carryonpausing 5852 27129 5853 27129 enterpausestate2 5854 27129 a9 02 lda #2 5855 2712b 8d 00 21 sta pausestate 5856 2712e d0 06 bne carryonpausing 5857 27130 leavepauseroutine 5858 27130 ad 07 21 lda sCTRL 5859 27133 85 3c sta CTRL 5860 27135 60 rts 5861 27136 carryonpausing 5862 27136 - ifconst .pause 5863 27136 - jsr .pause 5864 27136 endif ; .pause 5865 27136 ad 07 21 lda sCTRL 5866 27139 09 80 ora #%10000000 ; turn off colorburst during pause... 5867 2713b 85 3c sta CTRL 5868 2713d 4c dd f0 jmp pauseroutine 5869 27140 endif ; pauseroutineoff 5870 27140 5871 27140 5872 27140 - ifconst DOUBLEBUFFER 5873 27140 -skipterminatedisplaylistreturn 5874 27140 - rts 5875 27140 endif ; DOUBLEBUFFER 5876 27140 terminatedisplaylist 5877 27140 - ifconst DOUBLEBUFFER 5878 27140 - lda doublebufferstate 5879 27140 - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 5880 27140 endif ; DOUBLEBUFFER 5881 27140 terminatedisplaybuffer 5882 27140 ;add DL end entry on each DL 5883 27140 a2 17 ldx #(WZONECOUNT-1) 5884 27142 dlendloop 5885 27142 bd 83 f6 lda DLPOINTL,x 5886 27145 - ifconst DOUBLEBUFFER 5887 27145 - clc 5888 27145 - adc doublebufferdloffset 5889 27145 endif ; DOUBLEBUFFER 5890 27145 85 63 sta dlpnt 5891 27147 bd 6b f6 lda DLPOINTH,x 5892 2714a - ifconst DOUBLEBUFFER 5893 2714a - adc #0 5894 2714a endif ; DOUBLEBUFFER 5895 2714a 85 64 sta dlpnt+1 5896 2714c b4 65 ldy dlend,x 5897 2714e a9 00 lda #$00 5898 27150 dlendmoreloops 5899 27150 c8 iny 5900 27151 91 63 sta (dlpnt),y 5901 27153 - ifconst FRAMESKIPGLITCHFIXWEAK 5902 27153 - cpy #DLLASTOBJ+1 5903 27153 - beq dlendthiszonedone 5904 27153 - iny 5905 27153 - iny 5906 27153 - iny 5907 27153 - iny 5908 27153 - iny 5909 27153 - sta (dlpnt),y 5910 27153 -dlendthiszonedone 5911 27153 endif FRAMESKIPGLITCHFIXWEAK 5912 27153 - ifconst FRAMESKIPGLITCHFIX 5913 27153 - iny 5914 27153 - iny 5915 27153 - iny 5916 27153 - iny 5917 27153 - cpy #DLLASTOBJ-1 5918 27153 - bcc dlendmoreloops 5919 27153 endif ; FRAMESKIPGLITCHFIX 5920 27153 ca dex 5921 27154 10 ec bpl dlendloop 5922 27156 5923 27156 ifnconst pauseroutineoff 5924 27156 20 dd f0 jsr pauseroutine 5925 27159 endif ; pauseroutineoff 5926 27159 60 rts 5927 2715a 5928 2715a uninterruptableroutines 5929 2715a ; this is for routines that must happen off the visible screen, each frame. 5930 2715a 5931 2715a - ifconst AVOXVOICE 5932 2715a - jsr serviceatarivoxqueue 5933 2715a endif 5934 2715a 5935 2715a a9 00 lda #0 5936 2715c 8d b6 01 sta palfastframe 5937 2715f ad 09 21 lda paldetected 5938 27162 f0 10 beq skippalframeadjusting 5939 27164 ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 5940 27164 ae b5 01 ldx palframes 5941 27167 e8 inx 5942 27168 e0 05 cpx #5 5943 2716a d0 05 bne palframeskipdone 5944 2716c ee b6 01 inc palfastframe 5945 2716f a2 00 ldx #0 5946 27171 palframeskipdone 5947 27171 8e b5 01 stx palframes 5948 27174 skippalframeadjusting 5949 27174 5950 27174 - ifconst MUSICTRACKER 5951 27174 - ; We normally run the servicesong routine from the top-screen interrupt, but if it 5952 27174 - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 5953 27174 - ; If that happens, we try again here. Chances are very small we'll run into the same 5954 27174 - ; problem twice, and if we do, we just drop a musical note or two. 5955 27174 - lda sfxschedulemissed 5956 27174 - beq servicesongwasnotmissed 5957 27174 - jsr servicesong 5958 27174 -servicesongwasnotmissed 5959 27174 endif ; MUSICTRACKER 5960 27174 5961 27174 60 rts 5962 27175 5963 27175 serviceatarivoxqueue 5964 27175 - ifconst AVOXVOICE 5965 27175 - lda voxlock 5966 27175 - bne skipvoxprocessing ; the vox is in the middle of speech address update 5967 27175 -skipvoxqueuesizedec 5968 27175 - jmp processavoxvoice 5969 27175 -skipvoxprocessing 5970 27175 - rts 5971 27175 - 5972 27175 -processavoxvoice 5973 27175 - lda avoxenable 5974 27175 - bne avoxfixport 5975 27175 - SPKOUT tempavox 5976 27175 - rts 5977 27175 -avoxfixport 5978 27175 - lda #0 ; restore the port to all bits as inputs... 5979 27175 - sta CTLSWA 5980 27175 - rts 5981 27175 -silenceavoxvoice 5982 27175 - SPEAK avoxsilentdata 5983 27175 - rts 5984 27175 -avoxsilentdata 5985 27175 - .byte 31,255 5986 27175 else 5987 27175 60 rts 5988 27176 endif ; AVOXVOICE 5989 27176 5990 27176 joybuttonhandler 5991 27176 8a txa 5992 27177 0a asl 5993 27178 a8 tay 5994 27179 b9 08 00 lda INPT0,y 5995 2717c 4a lsr 5996 2717d 9d 02 21 sta sINPT1,x 5997 27180 b9 09 00 lda INPT1,y 5998 27183 29 80 and #%10000000 5999 27185 1d 02 21 ora sINPT1,x 6000 27188 9d 02 21 sta sINPT1,x 6001 2718b 6002 2718b b5 0c lda INPT4,x 6003 2718d 30 19 bmi .skip1bjoyfirecheck 6004 2718f ;one button joystick is down 6005 2718f 49 80 eor #%10000000 6006 27191 9d 02 21 sta sINPT1,x 6007 27194 6008 27194 ad b1 01 lda joybuttonmode 6009 27197 3d ab f1 and twobuttonmask,x 6010 2719a f0 0c beq .skip1bjoyfirecheck 6011 2719c ad b1 01 lda joybuttonmode 6012 2719f 1d ab f1 ora twobuttonmask,x 6013 271a2 8d b1 01 sta joybuttonmode 6014 271a5 8d 82 02 sta SWCHB 6015 271a8 .skip1bjoyfirecheck 6016 271a8 4c 57 f0 jmp buttonreadloopreturn 6017 271ab 6018 271ab twobuttonmask 6019 271ab 04 10 .byte.b %00000100,%00010000 6020 271ad 6021 271ad gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 6022 271ad - ifconst LIGHTGUNSUPPORT 6023 271ad - cpx #0 6024 271ad - bne secondportgunhandler 6025 271ad -firstportgunhandler 6026 271ad - lda SWCHA 6027 271ad - asl 6028 271ad - asl 6029 271ad - asl ; shift D4 to D7 6030 271ad - and #%10000000 6031 271ad - eor #%10000000 6032 271ad - sta sINPT1 6033 271ad - jmp buttonreadloopreturn 6034 271ad -secondportgunhandler 6035 271ad - lda SWCHA 6036 271ad - lsr ; shift D0 into carry 6037 271ad - lsr ; shift carry into D7 6038 271ad - and #%10000000 6039 271ad - eor #%10000000 6040 271ad - sta sINPT3 6041 271ad - jmp buttonreadloopreturn 6042 271ad endif ; LIGHTGUNSUPPORT 6043 271ad 6044 271ad controlsusing2buttoncode 6045 271ad 00 .byte.b 0 ; 00=no controller plugged in 6046 271ae 01 .byte.b 1 ; 01=proline joystick 6047 271af 00 .byte.b 0 ; 02=lightgun 6048 271b0 00 .byte.b 0 ; 03=paddle 6049 271b1 01 .byte.b 1 ; 04=trakball 6050 271b2 01 .byte.b 1 ; 05=vcs joystick 6051 271b3 01 .byte.b 1 ; 06=driving control 6052 271b4 00 .byte.b 0 ; 07=keypad control 6053 271b5 00 .byte.b 0 ; 08=st mouse/cx80 6054 271b6 00 .byte.b 0 ; 09=amiga mouse 6055 271b7 01 .byte.b 1 ; 10=atarivox 6056 271b8 6057 271b8 buttonhandlerhi 6058 271b8 00 .byte.b 0 ; 00=no controller plugged in 6059 271b9 f1 .byte.b >joybuttonhandler ; 01=proline joystick 6060 271ba f1 .byte.b >gunbuttonhandler ; 02=lightgun 6061 271bb f5 .byte.b >paddlebuttonhandler ; 03=paddle 6062 271bc f1 .byte.b >joybuttonhandler ; 04=trakball 6063 271bd f1 .byte.b >joybuttonhandler ; 05=vcs joystick 6064 271be f1 .byte.b >joybuttonhandler ; 06=driving control 6065 271bf 00 .byte.b 0 ; 07=keypad 6066 271c0 f5 .byte.b >mousebuttonhandler ; 08=st mouse 6067 271c1 f5 .byte.b >mousebuttonhandler ; 09=amiga mouse 6068 271c2 f1 .byte.b >joybuttonhandler ; 10=atarivox 6069 271c3 buttonhandlerlo 6070 271c3 00 .byte.b 0 ; 00=no controller plugged in 6071 271c4 76 .byte.b $0F means the sound is looped while priority is active 6172 27221 6173 27221 05 d9 ora inttemp2 6174 27223 05 d8 ora inttemp1 ; check if F|C|V=0 6175 27225 f0 23 beq zerosfx ; if so, we're at the end of the sound. 6176 27227 6177 27227 advancesfxpointer 6178 27227 ; advance the pointer to the next sound chunk 6179 27227 c8 iny 6180 27228 84 da sty inttemp3 6181 2722a 18 clc 6182 2722b b5 4e lda sfx1pointlo,x 6183 2722d 65 da adc inttemp3 6184 2722f 95 4e sta sfx1pointlo,x 6185 27231 b5 50 lda sfx1pointhi,x 6186 27233 69 00 adc #0 6187 27235 95 50 sta sfx1pointhi,x 6188 27237 4c e2 f1 jmp servicesfxchannelsloop 6189 2723a 6190 2723a sfxsoundloop 6191 2723a 48 pha 6192 2723b b5 52 lda sfx1priority,x 6193 2723d d0 04 bne sfxsoundloop_carryon 6194 2723f 68 pla ; fix the stack before we go 6195 27240 4c 27 f2 jmp advancesfxpointer 6196 27243 sfxsoundloop_carryon 6197 27243 68 pla 6198 27244 29 f0 and #$F0 6199 27246 4a lsr 6200 27247 4a lsr 6201 27248 4a lsr 6202 27249 4a lsr 6203 2724a 6204 2724a zerosfx 6205 2724a 95 4e sta sfx1pointlo,x 6206 2724c 95 50 sta sfx1pointhi,x 6207 2724e 95 52 sta sfx1priority,x 6208 27250 4c e2 f1 jmp servicesfxchannelsloop 6209 27253 6210 27253 6211 27253 schedulesfx 6212 27253 ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 6213 27253 a0 00 ldy #0 6214 27255 b1 e0 lda (sfxinstrumentlo),y 6215 27257 - ifconst pokeysupport 6216 27257 - cmp #$20 ; POKEY? 6217 27257 - bne scheduletiasfx 6218 27257 - jmp schedulepokeysfx 6219 27257 endif 6220 27257 scheduletiasfx 6221 27257 ;cmp #$10 ; TIA? 6222 27257 ;beq continuescheduletiasfx 6223 27257 ; rts ; unhandled!!! 6224 27257 continuescheduletiasfx 6225 27257 ifnconst TIASFXMONO 6226 27257 a5 4e lda sfx1pointlo 6227 27259 05 50 ora sfx1pointhi 6228 2725b f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 6229 2725d a5 4f lda sfx2pointlo 6230 2725f 05 51 ora sfx2pointhi 6231 27261 f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 6232 27263 ; Both channels are scheduled. 6233 27263 a0 01 ldy #1 6234 27265 b1 e0 lda (sfxinstrumentlo),y 6235 27267 d0 01 bne interruptsfx 6236 27269 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 6237 2726a interruptsfx 6238 2726a ;Compare which active sound has a lower priority. We'll interrupt the lower one. 6239 2726a a5 52 lda sfx1priority 6240 2726c c5 53 cmp sfx2priority 6241 2726e b0 04 bcs schedulesfx2 6242 27270 endif ; !TIASFXMONO 6243 27270 6244 27270 schedulesfx1 6245 27270 a2 00 ldx #0 ; channel 1 6246 27272 ifnconst TIASFXMONO 6247 27272 f0 02 beq skipschedulesfx2 6248 27274 schedulesfx2 6249 27274 a2 01 ldx #1 ; channel 2 6250 27276 skipschedulesfx2 6251 27276 endif ; !TIASFXMONO 6252 27276 6253 27276 - ifconst MUSICTRACKER 6254 27276 - lda sfxnoteindex 6255 27276 - bpl skipdrumkitoverride 6256 27276 - and #$7F ; subtract 128 6257 27276 - sec 6258 27276 - sbc #4 ; drums start at 132, i.e. octave 10 6259 27276 - asl 6260 27276 - tay 6261 27276 - lda tiadrumkitdefinition,y 6262 27276 - sta sfxinstrumentlo 6263 27276 - iny 6264 27276 - lda tiadrumkitdefinition,y 6265 27276 - sta sfxinstrumenthi 6266 27276 - lda #0 6267 27276 - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 6268 27276 -skipdrumkitoverride 6269 27276 endif ; MUSICTRACKER 6270 27276 a0 01 ldy #1 ; get priority and sound-resolution (in frames) 6271 27278 b1 e0 lda (sfxinstrumentlo),y 6272 2727a 95 52 sta sfx1priority,x 6273 2727c c8 iny 6274 2727d b1 e0 lda (sfxinstrumentlo),y 6275 2727f 95 56 sta sfx1frames,x 6276 27281 a5 e0 lda sfxinstrumentlo 6277 27283 18 clc 6278 27284 69 03 adc #3 6279 27286 95 4e sta sfx1pointlo,x 6280 27288 a5 e1 lda sfxinstrumenthi 6281 2728a 69 00 adc #0 6282 2728c 95 50 sta sfx1pointhi,x 6283 2728e a5 e2 lda sfxpitchoffset 6284 27290 95 54 sta sfx1poffset,x 6285 27292 a9 00 lda #0 6286 27294 95 58 sta sfx1tick,x 6287 27296 a5 e3 lda sfxnoteindex 6288 27298 95 cd sta sfx1notedata,x 6289 2729a 60 rts 6290 2729b 6291 2729b plotsprite 6292 2729b ifnconst NODRAWWAIT 6293 2729b - ifconst DOUBLEBUFFER 6294 2729b - lda doublebufferstate 6295 2729b - bne skipplotspritewait 6296 2729b endif ; DOUBLEBUFFER 6297 2729b - ifconst DEBUGWAITCOLOR 6298 2729b - lda #$41 6299 2729b - sta BACKGRND 6300 2729b endif 6301 2729b plotspritewait 6302 2729b a5 4d lda visibleover 6303 2729d d0 fc bne plotspritewait 6304 2729f skipplotspritewait 6305 2729f - ifconst DEBUGWAITCOLOR 6306 2729f - lda #$0 6307 2729f - sta BACKGRND 6308 2729f endif 6309 2729f endif 6310 2729f 6311 2729f ;arguments: 6312 2729f ; temp1=lo graphicdata 6313 2729f ; temp2=hi graphicdata 6314 2729f ; temp3=palette | width byte 6315 2729f ; temp4=x 6316 2729f ; temp5=y 6317 2729f ; temp6=mode 6318 2729f a5 46 lda temp5 ;Y position 6319 272a1 4a lsr ; 2 - Divide by 8 or 16 6320 272a2 4a lsr ; 2 6321 272a3 4a lsr ; 2 6322 272a4 - if WZONEHEIGHT = 16 6323 272a4 - lsr ; 2 6324 272a4 endif 6325 272a4 6326 272a4 aa tax 6327 272a5 6328 272a5 ifnconst NOLIMITCHECKING 6329 272a5 6330 272a5 ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 6331 272a5 6332 272a5 c9 18 cmp #WZONECOUNT 6333 272a7 6334 272a7 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 6335 272a9 ; otherwise, check to see if the bottom half is in zone 0... 6336 272a9 6337 272a9 - if WZONEHEIGHT = 16 6338 272a9 - cmp #15 6339 272a9 else 6340 272a9 c9 1f cmp #31 6341 272ab endif 6342 272ab 6343 272ab d0 05 bne exitplotsprite1 6344 272ad a2 00 ldx #0 6345 272af 4c ec f2 jmp continueplotsprite2 6346 272b2 exitplotsprite1 6347 272b2 60 rts 6348 272b3 6349 272b3 continueplotsprite1 6350 272b3 endif 6351 272b3 6352 272b3 bd 83 f6 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 6353 272b6 - ifconst DOUBLEBUFFER 6354 272b6 - clc 6355 272b6 - adc doublebufferdloffset 6356 272b6 endif ; DOUBLEBUFFER 6357 272b6 85 63 sta dlpnt 6358 272b8 bd 6b f6 lda DLPOINTH,x 6359 272bb - ifconst DOUBLEBUFFER 6360 272bb - adc #0 6361 272bb endif ; DOUBLEBUFFER 6362 272bb 85 64 sta dlpnt+1 6363 272bd 6364 272bd ;Create DL entry for upper part of sprite 6365 272bd 6366 272bd b4 65 ldy dlend,x ;Get the index to the end of this DL 6367 272bf 6368 272bf ifconst CHECKOVERWRITE 6369 272bf c0 4b cpy #DLLASTOBJ 6370 272c1 f0 21 beq checkcontinueplotsprite2 6371 272c3 continueplotsprite1a 6372 272c3 endif 6373 272c3 6374 272c3 a5 42 lda temp1 ; graphic data, lo byte 6375 272c5 91 63 sta (dlpnt),y ;Low byte of data address 6376 272c7 6377 272c7 ifnconst ATOMICSPRITEUPDATE 6378 272c7 c8 iny 6379 272c8 a5 47 lda temp6 6380 272ca 91 63 sta (dlpnt),y 6381 272cc - else 6382 272cc - iny 6383 272cc - sty temp8 6384 272cc endif 6385 272cc 6386 272cc c8 iny 6387 272cd 6388 272cd a5 46 lda temp5 ;Y position 6389 272cf 29 07 and #(WZONEHEIGHT - 1) 6390 272d1 c9 01 cmp #1 ; clear carry if our sprite is just in this zone 6391 272d3 05 43 ora temp2 ; graphic data, hi byte 6392 272d5 91 63 sta (dlpnt),y 6393 272d7 6394 272d7 6395 272d7 c8 iny 6396 272d8 a5 44 lda temp3 ;palette|width 6397 272da 91 63 sta (dlpnt),y 6398 272dc 6399 272dc c8 iny 6400 272dd a5 45 lda temp4 ;Horizontal position 6401 272df 91 63 sta (dlpnt),y 6402 272e1 6403 272e1 c8 iny 6404 272e2 94 65 sty dlend,x 6405 272e4 6406 272e4 - ifconst ALWAYSTERMINATE 6407 272e4 - iny 6408 272e4 - lda #0 6409 272e4 - sta (dlpnt),y 6410 272e4 endif 6411 272e4 6412 272e4 - ifconst ATOMICSPRITEUPDATE 6413 272e4 - ldy temp8 6414 272e4 - lda temp6 6415 272e4 - sta (dlpnt),y 6416 272e4 endif 6417 272e4 6418 272e4 checkcontinueplotsprite2 6419 272e4 6420 272e4 90 38 bcc doneSPDL ;branch if the sprite was fully in the last zone 6421 272e6 6422 272e6 ;Create DL entry for lower part of sprite 6423 272e6 6424 272e6 e8 inx ;Next region 6425 272e7 6426 272e7 ifnconst NOLIMITCHECKING 6427 272e7 e0 18 cpx #WZONECOUNT 6428 272e9 6429 272e9 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 6430 272eb 60 rts 6431 272ec continueplotsprite2 6432 272ec endif 6433 272ec 6434 272ec bd 83 f6 lda DLPOINTL,x ;Get pointer to next DL 6435 272ef - ifconst DOUBLEBUFFER 6436 272ef - clc 6437 272ef - adc doublebufferdloffset 6438 272ef endif ; DOUBLEBUFFER 6439 272ef 85 63 sta dlpnt 6440 272f1 bd 6b f6 lda DLPOINTH,x 6441 272f4 - ifconst DOUBLEBUFFER 6442 272f4 - adc #0 6443 272f4 endif ; DOUBLEBUFFER 6444 272f4 85 64 sta dlpnt+1 6445 272f6 b4 65 ldy dlend,x ;Get the index to the end of this DL 6446 272f8 6447 272f8 ifconst CHECKOVERWRITE 6448 272f8 c0 4b cpy #DLLASTOBJ 6449 272fa d0 01 bne continueplotsprite2a 6450 272fc 60 rts 6451 272fd continueplotsprite2a 6452 272fd endif 6453 272fd 6454 272fd a5 42 lda temp1 ; graphic data, lo byte 6455 272ff 91 63 sta (dlpnt),y 6456 27301 6457 27301 ifnconst ATOMICSPRITEUPDATE 6458 27301 c8 iny 6459 27302 a5 47 lda temp6 6460 27304 91 63 sta (dlpnt),y 6461 27306 - else 6462 27306 - iny 6463 27306 - sty temp8 6464 27306 endif 6465 27306 6466 27306 c8 iny 6467 27307 6468 27307 a5 46 lda temp5 ;Y position 6469 27309 0b 07 anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 6470 2730b 05 43 ora temp2 ; graphic data, hi byte 6471 2730d e9 07 sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 6472 2730f 91 63 sta (dlpnt),y 6473 27311 6474 27311 c8 iny 6475 27312 6476 27312 a5 44 lda temp3 ;palette|width 6477 27314 91 63 sta (dlpnt),y 6478 27316 6479 27316 c8 iny 6480 27317 6481 27317 a5 45 lda temp4 ;Horizontal position 6482 27319 91 63 sta (dlpnt),y 6483 2731b 6484 2731b c8 iny 6485 2731c 94 65 sty dlend,x 6486 2731e 6487 2731e - ifconst ALWAYSTERMINATE 6488 2731e - iny 6489 2731e - lda #0 6490 2731e - sta (dlpnt),y 6491 2731e endif 6492 2731e 6493 2731e - ifconst ATOMICSPRITEUPDATE 6494 2731e - ldy temp8 6495 2731e - lda temp6 6496 2731e - sta (dlpnt),y 6497 2731e endif 6498 2731e 6499 2731e doneSPDL 6500 2731e 60 rts 6501 2731f 6502 2731f 6503 2731f lockzonex 6504 2731f - ifconst ZONELOCKS 6505 2731f - ldy dlend,x 6506 2731f - cpy #DLLASTOBJ 6507 2731f - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 6508 2731f - lda DLPOINTL,x 6509 2731f - ifconst DOUBLEBUFFER 6510 2731f - clc 6511 2731f - adc doublebufferdloffset 6512 2731f - endif ; DOUBLEBUFFER 6513 2731f - sta dlpnt 6514 2731f - lda DLPOINTH,x 6515 2731f - ifconst DOUBLEBUFFER 6516 2731f - adc #0 6517 2731f - endif ; DOUBLEBUFFER 6518 2731f - sta dlpnt+1 6519 2731f - iny 6520 2731f - lda #0 6521 2731f - sta (dlpnt),y 6522 2731f - dey 6523 2731f - tya 6524 2731f - ldy #(DLLASTOBJ-1) 6525 2731f - sta (dlpnt),y 6526 2731f - iny 6527 2731f - sty dlend,x 6528 2731f -lockzonexreturn 6529 2731f - rts 6530 2731f endif ; ZONELOCKS 6531 2731f unlockzonex 6532 2731f - ifconst ZONELOCKS 6533 2731f - ldy dlend,x 6534 2731f - cpy #DLLASTOBJ 6535 2731f - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 6536 2731f - lda DLPOINTL,x 6537 2731f - ifconst DOUBLEBUFFER 6538 2731f - clc 6539 2731f - adc doublebufferdloffset 6540 2731f - endif ; DOUBLEBUFFER 6541 2731f - sta dlpnt 6542 2731f - lda DLPOINTH,x 6543 2731f - ifconst DOUBLEBUFFER 6544 2731f - adc #0 6545 2731f - endif ; DOUBLEBUFFER 6546 2731f - sta dlpnt+1 6547 2731f - dey 6548 2731f - ;ldy #(DLLASTOBJ-1) 6549 2731f - lda (dlpnt),y 6550 2731f - tay 6551 2731f - sty dlend,x 6552 2731f -unlockzonexreturn 6553 2731f endif ; ZONELOCKS 6554 2731f 60 rts 6555 27320 6556 27320 plotcharloop 6557 27320 ; ** read from a data indirectly pointed to from temp8,temp9 6558 27320 ; ** format is: lo_data, hi_data, palette|width, x, y 6559 27320 ; ** format ends with lo_data | hi_data = 0 6560 27320 6561 27320 - ifconst DOUBLEBUFFER 6562 27320 - lda doublebufferstate 6563 27320 - bne skipplotcharloopwait 6564 27320 endif ; DOUBLEBUFFER 6565 27320 - ifconst DEBUGWAITCOLOR 6566 27320 - lda #$61 6567 27320 - sta BACKGRND 6568 27320 endif 6569 27320 plotcharloopwait 6570 27320 a5 4d lda visibleover 6571 27322 d0 fc bne plotcharloopwait 6572 27324 - ifconst DEBUGWAITCOLOR 6573 27324 - lda #0 6574 27324 - sta BACKGRND 6575 27324 endif 6576 27324 skipplotcharloopwait 6577 27324 plotcharlooploop 6578 27324 a0 00 ldy #0 6579 27326 b1 49 lda (temp8),y 6580 27328 85 42 sta temp1 6581 2732a c8 iny 6582 2732b b1 49 lda (temp8),y 6583 2732d 85 43 sta temp2 6584 2732f 05 42 ora temp1 6585 27331 d0 01 bne plotcharloopcontinue 6586 27333 ;the pointer=0, so return 6587 27333 60 rts 6588 27334 plotcharloopcontinue 6589 27334 c8 iny 6590 27335 b1 49 lda (temp8),y 6591 27337 85 44 sta temp3 6592 27339 c8 iny 6593 2733a b1 49 lda (temp8),y 6594 2733c 85 45 sta temp4 6595 2733e c8 iny 6596 2733f b1 49 lda (temp8),y 6597 27341 ;sta temp5 ; not needed with our late entry. 6598 27341 20 5a f3 jsr plotcharactersskipentry 6599 27344 a5 49 lda temp8 6600 27346 18 clc 6601 27347 69 05 adc #5 6602 27349 85 49 sta temp8 6603 2734b a5 4a lda temp9 6604 2734d 69 00 adc #0 6605 2734f 85 4a sta temp9 6606 27351 4c 24 f3 jmp plotcharlooploop 6607 27354 6608 27354 plotcharacters 6609 27354 - ifconst DOUBLEBUFFER 6610 27354 - lda doublebufferstate 6611 27354 - bne skipplotcharacterswait 6612 27354 endif ; DOUBLEBUFFER 6613 27354 - ifconst DEBUGWAITCOLOR 6614 27354 - lda #$41 6615 27354 - sta BACKGRND 6616 27354 endif 6617 27354 plotcharacterswait 6618 27354 a5 4d lda visibleover 6619 27356 d0 fc bne plotcharacterswait 6620 27358 - ifconst DEBUGWAITCOLOR 6621 27358 - sta BACKGRND 6622 27358 endif 6623 27358 skipplotcharacterswait 6624 27358 ;arguments: 6625 27358 ; temp1=lo charactermap 6626 27358 ; temp2=hi charactermap 6627 27358 ; temp3=palette | width byte 6628 27358 ; temp4=x 6629 27358 ; temp5=y 6630 27358 6631 27358 a5 46 lda temp5 ;Y position 6632 2735a 6633 2735a plotcharactersskipentry 6634 2735a 6635 2735a ;ifconst ZONEHEIGHT 6636 2735a ; if ZONEHEIGHT = 16 6637 2735a ; and #$0F 6638 2735a ; endif 6639 2735a ; if ZONEHEIGHT = 8 6640 2735a ; and #$1F 6641 2735a ; endif 6642 2735a ;else 6643 2735a ; and #$0F 6644 2735a ;endif 6645 2735a 6646 2735a aa tax 6647 2735b bd 83 f6 lda DLPOINTL,x ;Get pointer to DL that the characters are in 6648 2735e - ifconst DOUBLEBUFFER 6649 2735e - clc 6650 2735e - adc doublebufferdloffset 6651 2735e endif ; DOUBLEBUFFER 6652 2735e 85 63 sta dlpnt 6653 27360 bd 6b f6 lda DLPOINTH,x 6654 27363 - ifconst DOUBLEBUFFER 6655 27363 - adc #0 6656 27363 endif ; DOUBLEBUFFER 6657 27363 85 64 sta dlpnt+1 6658 27365 6659 27365 ;Create DL entry for the characters 6660 27365 6661 27365 b4 65 ldy dlend,x ;Get the index to the end of this DL 6662 27367 6663 27367 ifconst CHECKOVERWRITE 6664 27367 c0 4b cpy #DLLASTOBJ 6665 27369 d0 01 bne continueplotcharacters 6666 2736b 60 rts 6667 2736c continueplotcharacters 6668 2736c endif 6669 2736c 6670 2736c a5 42 lda temp1 ; character map data, lo byte 6671 2736e 91 63 sta (dlpnt),y ;(1) store low address 6672 27370 6673 27370 c8 iny 6674 27371 ad 06 21 lda charactermode 6675 27374 91 63 sta (dlpnt),y ;(2) store mode 6676 27376 6677 27376 c8 iny 6678 27377 a5 43 lda temp2 ; character map, hi byte 6679 27379 91 63 sta (dlpnt),y ;(3) store high address 6680 2737b 6681 2737b c8 iny 6682 2737c a5 44 lda temp3 ;palette|width 6683 2737e 91 63 sta (dlpnt),y ;(4) store palette|width 6684 27380 6685 27380 c8 iny 6686 27381 a5 45 lda temp4 ;Horizontal position 6687 27383 91 63 sta (dlpnt),y ;(5) store horizontal position 6688 27385 6689 27385 c8 iny 6690 27386 94 65 sty dlend,x ; save display list end byte 6691 27388 60 rts 6692 27389 6693 27389 6694 27389 - ifconst plotvalueonscreen 6695 27389 -plotcharacterslive 6696 27389 - ; a version of plotcharacters that draws live and minimally disrupts the screen... 6697 27389 - 6698 27389 - ;arguments: 6699 27389 - ; temp1=lo charactermap 6700 27389 - ; temp2=hi charactermap 6701 27389 - ; temp3=palette | width byte 6702 27389 - ; temp4=x 6703 27389 - ; temp5=y 6704 27389 - 6705 27389 - lda temp5 ;Y position 6706 27389 - 6707 27389 - tax 6708 27389 - lda DLPOINTL,x ;Get pointer to DL that the characters are in 6709 27389 - ifconst DOUBLEBUFFER 6710 27389 - clc 6711 27389 - adc doublebufferdloffset 6712 27389 - endif ; DOUBLEBUFFER 6713 27389 - sta dlpnt 6714 27389 - lda DLPOINTH,x 6715 27389 - ifconst DOUBLEBUFFER 6716 27389 - adc #0 6717 27389 - endif ; DOUBLEBUFFER 6718 27389 - sta dlpnt+1 6719 27389 - 6720 27389 - ;Create DL entry for the characters 6721 27389 - 6722 27389 - ldy dlend,x ;Get the index to the end of this DL 6723 27389 - 6724 27389 - ifconst CHECKOVERWRITE 6725 27389 - cpy #DLLASTOBJ 6726 27389 - bne continueplotcharacterslive 6727 27389 - rts 6728 27389 -continueplotcharacterslive 6729 27389 - endif 6730 27389 - 6731 27389 - lda temp1 ; character map data, lo byte 6732 27389 - sta (dlpnt),y ;(1) store low address 6733 27389 - 6734 27389 - iny 6735 27389 - ; we don't add the second byte yet, since the charmap could briefly 6736 27389 - ; render without a proper character map address, width, or position. 6737 27389 - lda charactermode 6738 27389 - sta (dlpnt),y ;(2) store mode 6739 27389 - 6740 27389 - iny 6741 27389 - lda temp2 ; character map, hi byte 6742 27389 - sta (dlpnt),y ;(3) store high address 6743 27389 - 6744 27389 - iny 6745 27389 - lda temp3 ;palette|width 6746 27389 - sta (dlpnt),y ;(4) store palette|width 6747 27389 - 6748 27389 - iny 6749 27389 - lda temp4 ;Horizontal position 6750 27389 - sta (dlpnt),y ;(5) store horizontal position 6751 27389 - 6752 27389 - iny 6753 27389 - sty dlend,x ; save display list end byte 6754 27389 - 6755 27389 - rts 6756 27389 endif ;plotcharacterslive 6757 27389 6758 27389 ifconst USED_PLOTVALUE 6759 27389 plotvalue 6760 27389 ; calling 7800basic command: 6761 27389 ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6762 27389 ; ...displays the variable as BCD digits 6763 27389 ; 6764 27389 ; asm sub arguments: 6765 27389 ; temp1=lo charactermap 6766 27389 ; temp2=hi charactermap 6767 27389 ; temp3=palette | width byte 6768 27389 ; temp4=x 6769 27389 ; temp5=y 6770 27389 ; temp6=number of digits 6771 27389 ; temp7=lo variable 6772 27389 ; temp8=hi variable 6773 27389 ; temp9=character mode 6774 27389 6775 27389 00 47 plotdigitcount = temp6 6776 27389 6777 27389 - ifconst ZONELOCKS 6778 27389 - ldx temp5 6779 27389 - ldy dlend,x 6780 27389 - cpy #DLLASTOBJ 6781 27389 - bne carryonplotvalue 6782 27389 - rts 6783 27389 -carryonplotvalue 6784 27389 endif 6785 27389 6786 27389 a9 00 lda #0 6787 2738b a8 tay 6788 2738c ae ad 01 ldx valbufend 6789 2738f 6790 2738f a5 47 lda plotdigitcount 6791 27391 29 01 and #1 6792 27393 f0 07 beq pvnibble2char 6793 27395 a9 00 lda #0 6794 27397 9d 00 20 sta VALBUFFER,x ; just in case we skip this digit 6795 2739a f0 11 beq pvnibble2char_skipnibble 6796 2739c 6797 2739c pvnibble2char 6798 2739c ; high nibble... 6799 2739c b1 48 lda (temp7),y 6800 2739e 29 f0 and #$f0 6801 273a0 4a lsr 6802 273a1 4a lsr 6803 273a2 4a lsr 6804 273a3 ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6805 273a3 4a lsr 6806 273a4 endif 6807 273a4 6808 273a4 18 clc 6809 273a5 65 42 adc temp1 ; add the offset to character graphics to our value 6810 273a7 9d 00 20 sta VALBUFFER,x 6811 273aa e8 inx 6812 273ab c6 47 dec plotdigitcount 6813 273ad 6814 273ad pvnibble2char_skipnibble 6815 273ad ; low nibble... 6816 273ad b1 48 lda (temp7),y 6817 273af 29 0f and #$0f 6818 273b1 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6819 273b1 - asl 6820 273b1 endif 6821 273b1 18 clc 6822 273b2 65 42 adc temp1 ; add the offset to character graphics to our value 6823 273b4 9d 00 20 sta VALBUFFER,x 6824 273b7 e8 inx 6825 273b8 c8 iny 6826 273b9 6827 273b9 c6 47 dec plotdigitcount 6828 273bb d0 df bne pvnibble2char 6829 273bd 6830 273bd ;point to the start of our valuebuffer 6831 273bd 18 clc 6832 273be a9 00 lda #VALBUFFER 6836 273c7 69 00 adc #0 6837 273c9 85 43 sta temp2 6838 273cb 6839 273cb ;advance valbufend to the end of our value buffer 6840 273cb 8e ad 01 stx valbufend 6841 273ce 6842 273ce ifnconst plotvalueonscreen 6843 273ce 4c 54 f3 jmp plotcharacters 6844 273d1 - else 6845 273d1 - jmp plotcharacterslive 6846 273d1 endif 6847 273d1 6848 273d1 endif ; USED_PLOTVALUE 6849 273d1 6850 273d1 6851 273d1 - ifconst USED_PLOTVALUEEXTRA 6852 273d1 -plotdigitcount = temp6 6853 273d1 -plotvalueextra 6854 273d1 - ; calling 7800basic command: 6855 273d1 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6856 273d1 - ; ...displays the variable as BCD digits 6857 273d1 - ; 6858 273d1 - ; asm sub arguments: 6859 273d1 - ; temp1=lo charactermap 6860 273d1 - ; temp2=hi charactermap 6861 273d1 - ; temp3=palette | width byte 6862 273d1 - ; temp4=x 6863 273d1 - ; temp5=y 6864 273d1 - ; temp6=number of digits 6865 273d1 - ; temp7=lo variable 6866 273d1 - ; temp8=hi variable 6867 273d1 - 6868 273d1 - lda #0 6869 273d1 - tay 6870 273d1 - ldx valbufend 6871 273d1 - ifnconst plotvalueonscreen 6872 273d1 - sta VALBUFFER,x 6873 273d1 - endif 6874 273d1 - 6875 273d1 - lda plotdigitcount 6876 273d1 - and #1 6877 273d1 - 6878 273d1 - bne pvnibble2char_skipnibbleextra 6879 273d1 - 6880 273d1 -pvnibble2charextra 6881 273d1 - ; high nibble... 6882 273d1 - lda (temp7),y 6883 273d1 - and #$f0 6884 273d1 - lsr 6885 273d1 - lsr 6886 273d1 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6887 273d1 - lsr 6888 273d1 - endif 6889 273d1 - clc 6890 273d1 - adc temp1 ; add the offset to character graphics to our value 6891 273d1 - sta VALBUFFER,x 6892 273d1 - inx 6893 273d1 - 6894 273d1 - ; second half of the digit 6895 273d1 - clc 6896 273d1 - adc #1 6897 273d1 - sta VALBUFFER,x 6898 273d1 - inx 6899 273d1 - 6900 273d1 -pvnibble2char_skipnibbleextra 6901 273d1 - ; low nibble... 6902 273d1 - lda (temp7),y 6903 273d1 - and #$0f 6904 273d1 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6905 273d1 - asl 6906 273d1 - endif 6907 273d1 - asl 6908 273d1 - 6909 273d1 - clc 6910 273d1 - adc temp1 ; add the offset to character graphics to our value 6911 273d1 - sta VALBUFFER,x 6912 273d1 - inx 6913 273d1 - 6914 273d1 - clc 6915 273d1 - adc #1 6916 273d1 - sta VALBUFFER,x 6917 273d1 - inx 6918 273d1 - iny 6919 273d1 - 6920 273d1 - dec plotdigitcount 6921 273d1 - bne pvnibble2charextra 6922 273d1 - 6923 273d1 - ;point to the start of our valuebuffer 6924 273d1 - clc 6925 273d1 - lda #VALBUFFER 6929 273d1 - adc #0 6930 273d1 - sta temp2 6931 273d1 - 6932 273d1 - ;advance valbufend to the end of our value buffer 6933 273d1 - stx valbufend 6934 273d1 - 6935 273d1 - ifnconst plotvalueonscreen 6936 273d1 - jmp plotcharacters 6937 273d1 - else 6938 273d1 - jmp plotcharacterslive 6939 273d1 - endif 6940 273d1 endif ; USED_PLOTVALUEEXTRA 6941 273d1 6942 273d1 boxcollision 6943 273d1 ifconst BOXCOLLISION 6944 273d1 ; the worst case cycle-time for the code below is 43 cycles. 6945 273d1 ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 6946 273d1 6947 273d1 ;__boxx1 = accumulator 6948 273d1 ;__boxy1 = y 6949 273d1 00 44 __boxw1 = temp3 6950 273d1 00 45 __boxh1 = temp4 6951 273d1 6952 273d1 00 46 __boxx2 = temp5 6953 273d1 00 47 __boxy2 = temp6 6954 273d1 00 48 __boxw2 = temp7 6955 273d1 00 49 __boxh2 = temp8 6956 273d1 6957 273d1 DoXCollisionCheck 6958 273d1 ;lda __boxx1 ; skipped. already in the accumulator 6959 273d1 c5 46 cmp __boxx2 ;3 6960 273d3 b0 07 bcs X1isbiggerthanX2 ;2/3 6961 273d5 X2isbiggerthanX1 6962 273d5 ; carry is clear 6963 273d5 65 44 adc __boxw1 ;3 6964 273d7 c5 46 cmp __boxx2 ;3 6965 273d9 b0 08 bcs DoYCollisionCheck ;3/2 6966 273db 60 rts ;6 - carry clear, no collision 6967 273dc X1isbiggerthanX2 6968 273dc 18 clc ;2 6969 273dd e5 48 sbc __boxw2 ;3 6970 273df c5 46 cmp __boxx2 ;3 6971 273e1 b0 13 bcs noboxcollision ;3/2 6972 273e3 DoYCollisionCheck 6973 273e3 98 tya ; 2 ; use to be "lda __boxy1" 6974 273e4 c5 47 cmp __boxy2 ;3 6975 273e6 b0 05 bcs Y1isbiggerthanY2 ;3/2 6976 273e8 Y2isbiggerthanY1 6977 273e8 ; carry is clear 6978 273e8 65 45 adc __boxh1 ;3 6979 273ea c5 47 cmp __boxy2 ;3 6980 273ec 60 rts ;6 6981 273ed Y1isbiggerthanY2 6982 273ed 18 clc ;2 6983 273ee e5 49 sbc __boxh2 ;3 6984 273f0 c5 47 cmp __boxy2 ;3 6985 273f2 b0 02 bcs noboxcollision ;3/2 6986 273f4 yesboxcollision 6987 273f4 38 sec ;2 6988 273f5 60 rts ;6 6989 273f6 noboxcollision 6990 273f6 18 clc ;2 6991 273f7 60 rts ;6 6992 273f8 endif ; BOXCOLLISION 6993 273f8 6994 273f8 randomize 6995 273f8 a5 40 lda rand 6996 273fa 4a lsr 6997 273fb 26 41 rol rand16 6998 273fd 90 02 bcc noeor 6999 273ff 49 b4 eor #$B4 7000 27401 noeor 7001 27401 85 40 sta rand 7002 27403 45 41 eor rand16 7003 27405 60 rts 7004 27406 7005 27406 ; *** bcd conversion routine courtesy Omegamatrix 7006 27406 ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 7007 27406 converttobcd 7008 27406 ;value to convert is in the accumulator 7009 27406 85 42 sta temp1 7010 27408 4a lsr 7011 27409 65 42 adc temp1 7012 2740b 6a ror 7013 2740c 4a lsr 7014 2740d 4a lsr 7015 2740e 65 42 adc temp1 7016 27410 6a ror 7017 27411 65 42 adc temp1 7018 27413 6a ror 7019 27414 4a lsr 7020 27415 29 3c and #$3C 7021 27417 85 43 sta temp2 7022 27419 4a lsr 7023 2741a 65 43 adc temp2 7024 2741c 65 42 adc temp1 7025 2741e 60 rts ; return the result in the accumulator 7026 2741f 7027 2741f ; Y and A contain multiplicands, result in A 7028 2741f mul8 7029 2741f 84 42 sty temp1 7030 27421 85 43 sta temp2 7031 27423 a9 00 lda #0 7032 27425 reptmul8 7033 27425 46 43 lsr temp2 7034 27427 90 03 bcc skipmul8 7035 27429 18 clc 7036 2742a 65 42 adc temp1 7037 2742c ;bcs donemul8 might save cycles? 7038 2742c skipmul8 7039 2742c ;beq donemul8 might save cycles? 7040 2742c 06 42 asl temp1 7041 2742e d0 f5 bne reptmul8 7042 27430 donemul8 7043 27430 60 rts 7044 27431 7045 27431 div8 7046 27431 ; A=numerator Y=denominator, result in A 7047 27431 c0 02 cpy #2 7048 27433 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 7049 27435 84 42 sty temp1 7050 27437 a0 ff ldy #$ff 7051 27439 div8loop 7052 27439 e5 42 sbc temp1 7053 2743b c8 iny 7054 2743c b0 fb bcs div8loop 7055 2743e div8end 7056 2743e 98 tya 7057 2743f ; result in A 7058 2743f 60 rts 7059 27440 7060 27440 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 7061 27440 mul16 7062 27440 84 42 sty temp1 7063 27442 85 43 sta temp2 7064 27444 7065 27444 a9 00 lda #0 7066 27446 a2 08 ldx #8 7067 27448 46 42 lsr temp1 7068 2744a mul16_1 7069 2744a 90 03 bcc mul16_2 7070 2744c 18 clc 7071 2744d 65 43 adc temp2 7072 2744f mul16_2 7073 2744f 6a ror 7074 27450 66 42 ror temp1 7075 27452 ca dex 7076 27453 d0 f5 bne mul16_1 7077 27455 85 43 sta temp2 7078 27457 60 rts 7079 27458 7080 27458 ; div int/int 7081 27458 ; numerator in A, denom in temp1 7082 27458 ; returns with quotient in A, remainder in temp1 7083 27458 div16 7084 27458 85 43 sta temp2 7085 2745a 84 42 sty temp1 7086 2745c a9 00 lda #0 7087 2745e a2 08 ldx #8 7088 27460 06 43 asl temp2 7089 27462 div16_1 7090 27462 2a rol 7091 27463 c5 42 cmp temp1 7092 27465 90 02 bcc div16_2 7093 27467 e5 42 sbc temp1 7094 27469 div16_2 7095 27469 26 43 rol temp2 7096 2746b ca dex 7097 2746c d0 f4 bne div16_1 7098 2746e 85 42 sta temp1 7099 27470 a5 43 lda temp2 7100 27472 60 rts 7101 27473 7102 27473 ifconst bankswitchmode 7103 27473 BS_jsr 7104 27473 - ifconst dumpbankswitch 7105 27473 - sta dumpbankswitch 7106 27473 endif 7107 27473 - ifconst MCPDEVCART 7108 27473 - ora #$18 7109 27473 - sta $3000 7110 27473 else 7111 27473 8d 00 80 sta $8000 7112 27476 endif 7113 27476 68 pla 7114 27477 aa tax 7115 27478 68 pla 7116 27479 60 rts 7117 2747a 7118 2747a BS_return 7119 2747a 68 pla ; bankswitch bank 7120 2747b - ifconst dumpbankswitch 7121 2747b - sta dumpbankswitch 7122 2747b endif 7123 2747b - ifconst BANKRAM 7124 2747b - sta currentbank 7125 2747b - ora currentrambank 7126 2747b endif 7127 2747b - ifconst MCPDEVCART 7128 2747b - ora #$18 7129 2747b - sta $3000 7130 2747b else 7131 2747b 8d 00 80 sta $8000 7132 2747e endif 7133 2747e 68 pla ; bankswitch $0 flag 7134 2747f 60 rts 7135 27480 endif 7136 27480 7137 27480 checkselectswitch 7138 27480 ad 82 02 lda SWCHB ; first check the real select switch... 7139 27483 29 02 and #%00000010 7140 27485 ifnconst MOUSESUPPORT 7141 27485 f0 05 beq checkselectswitchreturn ; switch is pressed 7142 27487 ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 7143 2748a 29 b0 and #%10110000 ; R_DU 7144 2748c endif ; MOUSESUPPORT 7145 2748c checkselectswitchreturn 7146 2748c 60 rts 7147 2748d 7148 2748d checkresetswitch 7149 2748d ad 82 02 lda SWCHB ; first check the real reset switch... 7150 27490 29 01 and #%00000001 7151 27492 ifnconst MOUSESUPPORT 7152 27492 f0 05 beq checkresetswitchreturn ; switch is pressed 7153 27494 ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 7154 27497 29 70 and #%01110000 ; _LDU 7155 27499 endif ; MOUSESUPPORT 7156 27499 checkresetswitchreturn 7157 27499 60 rts 7158 2749a 7159 2749a - ifconst FINESCROLLENABLED 7160 2749a -finescrolldlls 7161 2749a - ldx temp1 ; first DLL index x3 7162 2749a - lda DLLMEM,x 7163 2749a - and #%11110000 7164 2749a - ora finescrolly 7165 2749a - sta DLLMEM,x 7166 2749a - 7167 2749a - ldx temp2 ; last DLL index x3 7168 2749a - lda DLLMEM,x 7169 2749a - and #%11110000 7170 2749a - ora finescrolly 7171 2749a - eor #(WZONEHEIGHT-1) 7172 2749a - sta DLLMEM,x 7173 2749a - rts 7174 2749a endif ; FINESCROLLENABLED 7175 2749a 7176 2749a - ifconst USED_ADJUSTVISIBLE 7177 2749a -adjustvisible 7178 2749a - ; called with temp1=first visible zone *3, temp2=last visible zone *3 7179 2749a - jsr waitforvblankstart ; ensure vblank just started 7180 2749a - ldx visibleDLLstart 7181 2749a -findfirstinterrupt 7182 2749a - lda DLLMEM,x 7183 2749a - bmi foundfirstinterrupt 7184 2749a - inx 7185 2749a - inx 7186 2749a - inx 7187 2749a - bne findfirstinterrupt 7188 2749a -foundfirstinterrupt 7189 2749a - and #%01111111 ; clear the interrupt bit 7190 2749a - sta DLLMEM,x 7191 2749a - ifconst DOUBLEBUFFER 7192 2749a - sta DLLMEM+DBOFFSET,x 7193 2749a - endif ; DOUBLEBUFFER 7194 2749a - ldx overscanDLLstart 7195 2749a -findlastinterrupt 7196 2749a - lda DLLMEM,x 7197 2749a - bmi foundlastinterrupt 7198 2749a - dex 7199 2749a - dex 7200 2749a - dex 7201 2749a - bne findlastinterrupt 7202 2749a -foundlastinterrupt 7203 2749a - and #%01111111 ; clear the interrupt bit 7204 2749a - sta DLLMEM,x 7205 2749a - ifconst DOUBLEBUFFER 7206 2749a - sta DLLMEM+DBOFFSET,x 7207 2749a - endif ; DOUBLEBUFFER 7208 2749a - ;now we need to set the new interrupts 7209 2749a - clc 7210 2749a - lda temp1 7211 2749a - adc visibleDLLstart 7212 2749a - tax 7213 2749a - lda DLLMEM,x 7214 2749a - ora #%10000000 7215 2749a - sta DLLMEM,x 7216 2749a - ifconst DOUBLEBUFFER 7217 2749a - sta DLLMEM+DBOFFSET,x 7218 2749a - endif ; DOUBLEBUFFER 7219 2749a - clc 7220 2749a - lda temp2 7221 2749a - adc visibleDLLstart 7222 2749a - tax 7223 2749a - lda DLLMEM,x 7224 2749a - ora #%10000000 7225 2749a - sta DLLMEM,x 7226 2749a - ifconst DOUBLEBUFFER 7227 2749a - sta DLLMEM+DBOFFSET,x 7228 2749a - endif ; DOUBLEBUFFER 7229 2749a - jsr vblankresync 7230 2749a - rts 7231 2749a endif ; USED_ADJUSTVISIBLE 7232 2749a 7233 2749a vblankresync 7234 2749a 20 38 f5 jsr waitforvblankstart ; ensure vblank just started 7235 2749d a9 00 lda #0 7236 2749f 85 4d sta visibleover 7237 274a1 a9 03 lda #3 7238 274a3 8d b2 01 sta interruptindex 7239 274a6 60 rts 7240 274a7 7241 274a7 createallgamedlls 7242 274a7 a2 00 ldx #0 7243 274a9 a9 19 lda #NVLINES 7244 274ab ac 09 21 ldy paldetected 7245 274ae f0 03 beq skipcreatePALpadding 7246 274b0 18 clc 7247 274b1 69 15 adc #21 7248 274b3 skipcreatePALpadding 7249 274b3 20 e8 f4 jsr createnonvisibledlls 7250 274b6 8e 3c 21 stx visibleDLLstart 7251 274b9 20 19 f5 jsr createvisiblezones 7252 274bc 8e 3d 21 stx overscanDLLstart 7253 274bf createallgamedllscontinue 7254 274bf a9 50 lda #(NVLINES+55) ; extras for PAL 7255 274c1 20 e8 f4 jsr createnonvisibledlls 7256 274c4 7257 274c4 ae 3c 21 ldx visibleDLLstart 7258 274c7 bd 00 18 lda DLLMEM,x 7259 274ca 09 80 ora #%10000000 ; NMI 1 - start of visible screen 7260 274cc 9d 00 18 sta DLLMEM,x 7261 274cf - ifconst DOUBLEBUFFER 7262 274cf - sta DLLMEM+DBOFFSET,x 7263 274cf endif ; DOUBLEBUFFER 7264 274cf 7265 274cf ae 3d 21 ldx overscanDLLstart 7266 274d2 bd 00 18 lda DLLMEM,x 7267 274d5 09 83 ora #%10000011 ; NMI 2 - end of visible screen 7268 274d7 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 7269 274d9 9d 00 18 sta DLLMEM,x 7270 274dc - ifconst DOUBLEBUFFER 7271 274dc - sta DLLMEM+DBOFFSET,x 7272 274dc endif ; DOUBLEBUFFER 7273 274dc 7274 274dc e8 inx 7275 274dd e8 inx 7276 274de e8 inx 7277 274df 7278 274df bd 00 18 lda DLLMEM,x 7279 274e2 09 80 ora #%10000000 ; NMI 3 - deeper overscan 7280 274e4 9d 00 18 sta DLLMEM,x 7281 274e7 - ifconst DOUBLEBUFFER 7282 274e7 - sta DLLMEM+DBOFFSET,x 7283 274e7 endif ; DOUBLEBUFFER 7284 274e7 7285 274e7 60 rts 7286 274e8 7287 274e8 createnonvisibledlls 7288 274e8 85 42 sta temp1 7289 274ea 4a lsr 7290 274eb 4a lsr 7291 274ec 4a lsr 7292 274ed 4a lsr ; /16 7293 274ee f0 09 beq skipcreatenonvisibledlls1loop 7294 274f0 a8 tay 7295 274f1 createnonvisibledlls1loop 7296 274f1 a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 7297 274f3 20 08 f5 jsr createblankdllentry 7298 274f6 88 dey 7299 274f7 d0 f8 bne createnonvisibledlls1loop 7300 274f9 skipcreatenonvisibledlls1loop 7301 274f9 a5 42 lda temp1 7302 274fb 29 0f and #%00001111 7303 274fd f0 08 beq createnonvisibledllsreturn 7304 274ff 38 sec 7305 27500 e9 01 sbc #1 7306 27502 09 40 ora #%01000000 7307 27504 20 08 f5 jsr createblankdllentry 7308 27507 createnonvisibledllsreturn 7309 27507 60 rts 7310 27508 7311 27508 createblankdllentry 7312 27508 9d 00 18 sta DLLMEM,x 7313 2750b - ifconst DOUBLEBUFFER 7314 2750b - sta DLLMEM+DBOFFSET,x 7315 2750b endif ; DOUBLEBUFFER 7316 2750b e8 inx 7317 2750c a9 21 lda #$21 ; blank 7318 2750e 9d 00 18 sta DLLMEM,x 7319 27511 - ifconst DOUBLEBUFFER 7320 27511 - sta DLLMEM+DBOFFSET,x 7321 27511 endif ; DOUBLEBUFFER 7322 27511 e8 inx 7323 27512 a9 00 lda #$00 7324 27514 9d 00 18 sta DLLMEM,x 7325 27517 - ifconst DOUBLEBUFFER 7326 27517 - sta DLLMEM+DBOFFSET,x 7327 27517 endif ; DOUBLEBUFFER 7328 27517 e8 inx 7329 27518 60 rts 7330 27519 7331 27519 createvisiblezones 7332 27519 a0 00 ldy #0 7333 2751b createvisiblezonesloop 7334 2751b b9 9b f6 lda.w DLHEIGHT,y 7335 2751e 09 20 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 7336 27520 9d 00 18 sta DLLMEM,x 7337 27523 - ifconst DOUBLEBUFFER 7338 27523 - sta DLLMEM+DBOFFSET,x 7339 27523 endif ; DOUBLEBUFFER 7340 27523 e8 inx 7341 27524 b9 6b f6 lda DLPOINTH,y 7342 27527 9d 00 18 sta DLLMEM,x 7343 2752a - ifconst DOUBLEBUFFER 7344 2752a - sta DLLMEM+DBOFFSET,x 7345 2752a endif ; DOUBLEBUFFER 7346 2752a e8 inx 7347 2752b b9 83 f6 lda DLPOINTL,y 7348 2752e 9d 00 18 sta DLLMEM,x 7349 27531 - ifconst DOUBLEBUFFER 7350 27531 - clc 7351 27531 - adc #DOUBLEBUFFEROFFSET 7352 27531 - sta DLLMEM+DBOFFSET,x 7353 27531 - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 7354 27531 - inc DLLMEM+DBOFFSET-1,x 7355 27531 -skiphidoublebufferadjust 7356 27531 endif ; DOUBLEBUFFER 7357 27531 e8 inx 7358 27532 c8 iny 7359 27533 c0 18 cpy #WZONECOUNT 7360 27535 d0 e4 bne createvisiblezonesloop 7361 27537 60 rts 7362 27538 7363 27538 waitforvblankstart 7364 27538 visibleoverwait 7365 27538 24 28 BIT MSTAT 7366 2753a 10 fc bpl visibleoverwait 7367 2753c vblankstartwait 7368 2753c 24 28 BIT MSTAT 7369 2753e 30 fc bmi vblankstartwait 7370 27540 60 rts 7371 27541 7372 27541 - ifconst DOUBLEBUFFER 7373 27541 -flipdisplaybufferreturn 7374 27541 - rts 7375 27541 -flipdisplaybuffer 7376 27541 - lda doublebufferstate 7377 27541 - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 7378 27541 - 7379 27541 - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 7380 27541 - 7381 27541 - lda doublebufferstate 7382 27541 - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 7383 27541 - tax 7384 27541 - 7385 27541 - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 7386 27541 - 7387 27541 -flipdisplaybufferwait1 7388 27541 - lda visibleover 7389 27541 - beq flipdisplaybufferwait1 7390 27541 - 7391 27541 -flipdisplaybufferwait 7392 27541 - lda visibleover 7393 27541 - bne flipdisplaybufferwait 7394 27541 - 7395 27541 - lda doublebufferminimumframetarget 7396 27541 - beq skipminimumframecode 7397 27541 - lda doublebufferminimumframeindex 7398 27541 - bne flipdisplaybufferwait1 7399 27541 - lda doublebufferminimumframetarget 7400 27541 - sta doublebufferminimumframeindex 7401 27541 -skipminimumframecode 7402 27541 - 7403 27541 - lda DLLMEMLutHi,x 7404 27541 - sta DPPH 7405 27541 - lda DLLMEMLutLo,x 7406 27541 - sta DPPL 7407 27541 - 7408 27541 - lda NewPageflipstate,x 7409 27541 - sta doublebufferstate 7410 27541 - lda NewPageflipoffset,x 7411 27541 - sta doublebufferdloffset 7412 27541 - 7413 27541 - lda doublebufferbufferdirty 7414 27541 - beq flipdisplaybufferreturn 7415 27541 - 7416 27541 - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 7417 27541 - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 7418 27541 - ; from the displayed buffer to the working buffer... 7419 27541 - 7420 27541 - lda doublebufferdloffset 7421 27541 - eor #DOUBLEBUFFEROFFSET 7422 27541 - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 7423 27541 - 7424 27541 - ldx #(WZONECOUNT-1) 7425 27541 -copybufferzoneloop 7426 27541 - 7427 27541 - lda DLPOINTL,x 7428 27541 - clc 7429 27541 - adc doublebufferdloffset 7430 27541 - sta temp1 7431 27541 - lda DLPOINTH,x 7432 27541 - adc #0 7433 27541 - sta temp2 7434 27541 - 7435 27541 - lda DLPOINTL,x 7436 27541 - clc 7437 27541 - adc temp6 7438 27541 - sta temp3 7439 27541 - lda DLPOINTH,x 7440 27541 - adc #0 7441 27541 - sta temp4 7442 27541 - 7443 27541 - lda dlendsave,x 7444 27541 - tay 7445 27541 -copybuffercharsloop 7446 27541 - lda (temp3),y 7447 27541 - sta (temp1),y 7448 27541 - dey 7449 27541 - bpl copybuffercharsloop 7450 27541 - dex 7451 27541 - bpl copybufferzoneloop 7452 27541 - lda #0 7453 27541 - sta doublebufferbufferdirty 7454 27541 - rts 7455 27541 - 7456 27541 -doublebufferoff 7457 27541 - lda #1 7458 27541 - sta doublebufferstate 7459 27541 - jsr flipdisplaybuffer 7460 27541 - lda #0 7461 27541 - sta doublebufferstate 7462 27541 - sta doublebufferdloffset 7463 27541 - rts 7464 27541 - 7465 27541 -DLLMEMLutLo 7466 27541 - .byte DLLMEM,>(DLLMEM+DBOFFSET) 7469 27541 -NewPageflipstate 7470 27541 - .byte 3,1 7471 27541 -NewPageflipoffset 7472 27541 - .byte DOUBLEBUFFEROFFSET,0 7473 27541 - 7474 27541 endif ; DOUBLEBUFFER 7475 27541 7476 27541 - ifconst MOUSESUPPORT 7477 27541 - 7478 27541 -rotationalcompare 7479 27541 - ; old = 00 01 10 11 7480 27541 - .byte $00, $01, $ff, $00 ; new=00 7481 27541 - .byte $ff, $00, $00, $01 ; new=01 7482 27541 - .byte $01, $00, $00, $ff ; new=10 7483 27541 - .byte $00, $ff, $01, $00 ; new=11 7484 27541 - 7485 27541 - ; 0000YyXx st mouse 7486 27541 - 7487 27541 - ; 0000xyXY amiga mouse 7488 27541 - 7489 27541 - ifconst MOUSEXONLY 7490 27541 -amigatoataribits ; swap bits 1 and 4... 7491 27541 - .byte %0000, %0000, %0010, %0010 7492 27541 - .byte %0000, %0000, %0010, %0010 7493 27541 - .byte %0001, %0001, %0011, %0011 7494 27541 - .byte %0001, %0001, %0011, %0011 7495 27541 - 7496 27541 - ; null change bits 7497 27541 - .byte %0000, %0001, %0010, %0011 7498 27541 - .byte %0000, %0001, %0010, %0011 7499 27541 - .byte %0000, %0001, %0010, %0011 7500 27541 - .byte %0000, %0001, %0010, %0011 7501 27541 - 7502 27541 - else ; !MOUSEXONLY 7503 27541 - 7504 27541 -amigatoataribits ; swap bits 1 and 4... 7505 27541 - .byte %0000, %1000, %0010, %1010 7506 27541 - .byte %0100, %1100, %0110, %1110 7507 27541 - .byte %0001, %1001, %0011, %1011 7508 27541 - .byte %0101, %1101, %0111, %1111 7509 27541 - ; null change bits 7510 27541 - .byte %0000, %0001, %0010, %0011 7511 27541 - .byte %0100, %0101, %0110, %0111 7512 27541 - .byte %1000, %1001, %1010, %1011 7513 27541 - .byte %1100, %1101, %1110, %1111 7514 27541 - endif ; !MOUSEXONLY 7515 27541 - 7516 27541 endif ; MOUSESUPPORT 7517 27541 7518 27541 mouse0update 7519 27541 - ifconst MOUSE0SUPPORT 7520 27541 - 7521 27541 -mousetableselect = inttemp2 7522 27541 -mousexdelta = inttemp3 7523 27541 -mouseydelta = inttemp4 7524 27541 -lastSWCHA = inttemp6 7525 27541 - 7526 27541 - ; 0000YyXx st mouse 7527 27541 - ; 0000xyXY amiga mouse 7528 27541 - 7529 27541 - lda #$ff 7530 27541 - sta lastSWCHA 7531 27541 - 7532 27541 - ldy port0control 7533 27541 - 7534 27541 - lda #%00010000 7535 27541 - cpy #9 ; AMIGA? 7536 27541 - bne skipamigabitsfix0 7537 27541 - lda #0 7538 27541 -skipamigabitsfix0 7539 27541 - sta mousetableselect 7540 27541 - ifconst DRIVINGBOOST 7541 27541 - cpy #6 ; DRIVING? 7542 27541 - bne skipdriving0setup 7543 27541 - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 7544 27541 - ; trails the actual mousex0, so we can smoothly interpolate toward 7545 27541 - ; the actual position. This actual position is stored in mousey0 7546 27541 - ; after the driver has run. 7547 27541 - ldx mousex0 7548 27541 - lda mousey0 7549 27541 - stx mousey0 7550 27541 - sta mousex0 7551 27541 -skipdriving0setup 7552 27541 - endif ; DRIVINGBOOST 7553 27541 - 7554 27541 - lda #0 7555 27541 - sta mousexdelta 7556 27541 - sta mouseydelta 7557 27541 - 7558 27541 - ifnconst MOUSETIME 7559 27541 - ifnconst MOUSEXONLY 7560 27541 - lda #180 ; minimum for x+y 7561 27541 - else 7562 27541 - lda #100 ; minimum for just x 7563 27541 - endif 7564 27541 - else 7565 27541 - lda #MOUSETIME 7566 27541 - endif 7567 27541 - jsr SETTIM64T ; INTIM is in Y 7568 27541 - 7569 27541 -mouse0updateloop 7570 27541 - lda SWCHA 7571 27541 - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 7572 27541 - cmp lastSWCHA 7573 27541 - beq mouse0loopcondition 7574 27541 - sta lastSWCHA 7575 27541 - lsr 7576 27541 - lsr 7577 27541 - lsr 7578 27541 - 7579 27541 - ora mousetableselect ; atari/amiga decoding table selection 7580 27541 - 7581 27541 - ; st mice encode on different bits/joystick-lines than amiga mice... 7582 27541 - ; 0000YyXx st mouse 7583 27541 - ; 0000xyXY amiga mouse 7584 27541 - ; ...so can shuffle the amiga bits to reuse the st driver. 7585 27541 - tay 7586 27541 - lax amigatoataribits,y 7587 27541 - 7588 27541 - ifnconst MOUSEXONLY 7589 27541 - ; first the Y... 7590 27541 - and #%00001100 7591 27541 - ora mousecodey0 7592 27541 - tay 7593 27541 - lda rotationalcompare,y 7594 27541 - clc 7595 27541 - adc mouseydelta 7596 27541 - sta mouseydelta 7597 27541 - tya 7598 27541 - lsr 7599 27541 - lsr 7600 27541 - sta mousecodey0 7601 27541 - txa 7602 27541 - ; ...then the X... 7603 27541 - and #%00000011 7604 27541 - tax 7605 27541 - endif ; !MOUSEXONLY 7606 27541 - 7607 27541 - asl 7608 27541 - asl 7609 27541 - ora mousecodex0 7610 27541 - tay 7611 27541 - lda rotationalcompare,y 7612 27541 - adc mousexdelta ; carry was clear by previous ASL 7613 27541 - sta mousexdelta 7614 27541 - stx mousecodex0 7615 27541 -mouse0loopcondition 7616 27541 - lda TIMINT 7617 27541 - bpl mouse0updateloop 7618 27541 - 7619 27541 - ; *** adapt to selected device resolution. 7620 27541 - ldx port0control 7621 27541 - 7622 27541 - ifconst PRECISIONMOUSING 7623 27541 - ldy port0resolution 7624 27541 - bne mouse0halveddone 7625 27541 - cpx #6 ; half-resolution is no good for driving wheels 7626 27541 - beq mouse0halveddone 7627 27541 - ; resolution=0 is half mouse resolution, necessary for precision 7628 27541 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7629 27541 - 7630 27541 - lda mousexdelta 7631 27541 - cmp #$80 7632 27541 - ror ; do a signed divide by 2. 7633 27541 - clc 7634 27541 - adc mousex0 7635 27541 - sta mousex0 7636 27541 - ifnconst MOUSEXONLY 7637 27541 - lda mouseydelta 7638 27541 - clc 7639 27541 - adc mousey0 7640 27541 - sta mousey0 7641 27541 - endif 7642 27541 - ; at half resolution we just exit after updating x and y 7643 27541 - jmp LLRET0 7644 27541 -mouse0halveddone 7645 27541 - endif ; PRECISIONMOUSING 7646 27541 - 7647 27541 - ifnconst MOUSEXONLY 7648 27541 - asl mouseydelta ; *2 because Y resolution is finer 7649 27541 - ldy port0resolution 7650 27541 - dey 7651 27541 - lda #0 7652 27541 -mousey0resolutionfix 7653 27541 - clc 7654 27541 - adc mouseydelta 7655 27541 - dey 7656 27541 - bpl mousey0resolutionfix 7657 27541 - clc 7658 27541 - adc mousey0 7659 27541 - sta mousey0 7660 27541 - endif ; MOUSEXONLY 7661 27541 - 7662 27541 - ldy port0resolution 7663 27541 - dey 7664 27541 - lda #0 7665 27541 -mousex0resolutionfix 7666 27541 - clc 7667 27541 - adc mousexdelta 7668 27541 - dey 7669 27541 - bpl mousex0resolutionfix 7670 27541 - ifnconst DRIVINGBOOST 7671 27541 - clc 7672 27541 - adc mousex0 7673 27541 - sta mousex0 7674 27541 - else 7675 27541 - cpx #6 7676 27541 - beq carryonmouse0boost 7677 27541 - clc 7678 27541 - adc mousex0 7679 27541 - sta mousex0 7680 27541 - jmp LLRET0 7681 27541 -carryonmouse0boost 7682 27541 - sta mousexdelta 7683 27541 - clc 7684 27541 - adc mousecodey0 7685 27541 - sta mousecodey0 7686 27541 - clc 7687 27541 - adc mousex0 7688 27541 - tay ; save the target X 7689 27541 - adc mousey0 ; average in the smoothly-trailing X 7690 27541 - ror 7691 27541 - sta mousex0 ; mousex0 now has the smoothly trailing X 7692 27541 - sty mousey0 ; and mousey0 has the the target X 7693 27541 - 7694 27541 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7695 27541 - ; A has mousex0, the smoothly trailing X 7696 27541 - sbc mousey0 ; less the target X 7697 27541 - bpl skipabsolutedrive0 7698 27541 - eor #$ff 7699 27541 -skipabsolutedrive0 7700 27541 - cmp #64 ; just an unreasonably large change 7701 27541 - bcc skipdrivewrapfix0 7702 27541 - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 7703 27541 -skipdrivewrapfix0 7704 27541 - 7705 27541 - ; get rid of the tweening if the distance travelled was very small 7706 27541 - lda mousexdelta 7707 27541 - cmp port0resolution 7708 27541 - bcs skipbetweenfix0 7709 27541 - lda mousex0 7710 27541 - sta mousey0 7711 27541 -skipbetweenfix0 7712 27541 - 7713 27541 -drivingboostreductioncheck0 7714 27541 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7715 27541 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7716 27541 - ; negated again because truncation during BCD math results in 7717 27541 - ; differing magnitudes, depending if the value is +ve or -ve. 7718 27541 -driving0fix 7719 27541 - lax mousecodey0 7720 27541 - cmp #$80 7721 27541 - bcs driving0skipnegate1 7722 27541 - eor #$FF 7723 27541 - adc #1 7724 27541 - sta mousecodey0 7725 27541 -driving0skipnegate1 7726 27541 - cmp #$80 7727 27541 - ror 7728 27541 - cmp #$80 7729 27541 - ror 7730 27541 - cmp #$80 7731 27541 - ror 7732 27541 - sta inttemp1 7733 27541 - lda mousecodey0 7734 27541 - sec 7735 27541 - sbc inttemp1 7736 27541 - cpx #$80 7737 27541 - bcs driving0skipnegate2 7738 27541 - eor #$FF 7739 27541 - adc #1 7740 27541 -driving0skipnegate2 7741 27541 - sta mousecodey0 7742 27541 -drivingboostdone0 7743 27541 - endif ; DRIVINGBOOST 7744 27541 - 7745 27541 - jmp LLRET0 7746 27541 - 7747 27541 endif ; MOUSE0SUPPORT 7748 27541 7749 27541 mouse1update 7750 27541 - ifconst MOUSE1SUPPORT 7751 27541 - 7752 27541 -mousetableselect = inttemp2 7753 27541 -mousexdelta = inttemp3 7754 27541 -mouseydelta = inttemp4 7755 27541 -lastSWCHA = inttemp6 7756 27541 - 7757 27541 - ; 0000YyXx st mouse 7758 27541 - ; 0000xyXY amiga mouse 7759 27541 - 7760 27541 - lda #$ff 7761 27541 - sta lastSWCHA 7762 27541 - 7763 27541 - ldy port1control 7764 27541 - 7765 27541 - lda #%00010000 7766 27541 - cpy #9 ; AMIGA? 7767 27541 - bne skipamigabitsfix1 7768 27541 - lda #0 7769 27541 -skipamigabitsfix1 7770 27541 - sta mousetableselect 7771 27541 - ifconst DRIVINGBOOST 7772 27541 - cpy #6 ; DRIVING? 7773 27541 - bne skipdriving1setup 7774 27541 - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 7775 27541 - ; trails the actual mousex1, so we can smoothly interpolate toward 7776 27541 - ; the actual position. This actual position is stored in mousey1 7777 27541 - ; after the driver has run. 7778 27541 - ldx mousex1 7779 27541 - lda mousey1 7780 27541 - stx mousey1 7781 27541 - sta mousex1 7782 27541 -skipdriving1setup 7783 27541 - endif ; DRIVINGBOOST 7784 27541 - 7785 27541 - lda #0 7786 27541 - sta mousexdelta 7787 27541 - sta mouseydelta 7788 27541 - 7789 27541 - ifnconst MOUSETIME 7790 27541 - ifnconst MOUSEXONLY 7791 27541 - lda #180 ; minimum for x+y 7792 27541 - else 7793 27541 - lda #100 ; minimum for just x 7794 27541 - endif 7795 27541 - else 7796 27541 - lda #MOUSETIME 7797 27541 - endif 7798 27541 - jsr SETTIM64T ; INTIM is in Y 7799 27541 - 7800 27541 -mouse1updateloop 7801 27541 - lda SWCHA 7802 27541 - and #%00001111 7803 27541 - cmp lastSWCHA 7804 27541 - beq mouse1loopcondition 7805 27541 - sta lastSWCHA 7806 27541 - 7807 27541 - ora mousetableselect ; atari/amiga decoding table selection 7808 27541 - 7809 27541 - ; st mice encode on different bits/joystick-lines than amiga mice... 7810 27541 - ; 0000YyXx st mouse 7811 27541 - ; 0000xyXY amiga mouse 7812 27541 - ; ...so can shuffle the amiga bits to reuse the st driver. 7813 27541 - tay 7814 27541 - lax amigatoataribits,y 7815 27541 - 7816 27541 - ifnconst MOUSEXONLY 7817 27541 - ; first the Y... 7818 27541 - and #%00001100 7819 27541 - ora mousecodey1 7820 27541 - tay 7821 27541 - lda rotationalcompare,y 7822 27541 - clc 7823 27541 - adc mouseydelta 7824 27541 - sta mouseydelta 7825 27541 - tya 7826 27541 - lsr 7827 27541 - lsr 7828 27541 - sta mousecodey1 7829 27541 - txa 7830 27541 - ; ...then the X... 7831 27541 - and #%00000011 7832 27541 - tax 7833 27541 - endif ; !MOUSEXONLY 7834 27541 - 7835 27541 - asl 7836 27541 - asl 7837 27541 - ora mousecodex1 7838 27541 - tay 7839 27541 - lda rotationalcompare,y 7840 27541 - adc mousexdelta ; carry was clear by previous ASL 7841 27541 - sta mousexdelta 7842 27541 - stx mousecodex1 7843 27541 -mouse1loopcondition 7844 27541 - lda TIMINT 7845 27541 - bpl mouse1updateloop 7846 27541 - 7847 27541 - ; *** adapt to selected device resolution. 7848 27541 - ldx port1control 7849 27541 - 7850 27541 - ifconst PRECISIONMOUSING 7851 27541 - ldy port1resolution 7852 27541 - bne mouse1halveddone 7853 27541 - cpx #6 ; half-resolution is no good for driving wheels 7854 27541 - beq mouse1halveddone 7855 27541 - ; resolution=0 is half mouse resolution, necessary for precision 7856 27541 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7857 27541 - 7858 27541 - lda mousexdelta 7859 27541 - cmp #$80 7860 27541 - ror ; do a signed divide by 2. 7861 27541 - clc 7862 27541 - adc mousex1 7863 27541 - sta mousex1 7864 27541 - ifnconst MOUSEXONLY 7865 27541 - lda mouseydelta 7866 27541 - clc 7867 27541 - adc mousey1 7868 27541 - sta mousey1 7869 27541 - endif 7870 27541 - ; at half resolution we just exit after updating x and y 7871 27541 - jmp LLRET1 7872 27541 -mouse1halveddone 7873 27541 - endif ; PRECISIONMOUSING 7874 27541 - 7875 27541 - ifnconst MOUSEXONLY 7876 27541 - asl mouseydelta ; *2 because Y resolution is finer 7877 27541 - ldy port1resolution 7878 27541 - dey 7879 27541 - lda #0 7880 27541 -mousey1resolutionfix 7881 27541 - clc 7882 27541 - adc mouseydelta 7883 27541 - dey 7884 27541 - bpl mousey1resolutionfix 7885 27541 - clc 7886 27541 - adc mousey1 7887 27541 - sta mousey1 7888 27541 - endif ; MOUSEXONLY 7889 27541 - 7890 27541 - ldy port1resolution 7891 27541 - dey 7892 27541 - lda #0 7893 27541 -mousex1resolutionfix 7894 27541 - clc 7895 27541 - adc mousexdelta 7896 27541 - dey 7897 27541 - bpl mousex1resolutionfix 7898 27541 - ifnconst DRIVINGBOOST 7899 27541 - clc 7900 27541 - adc mousex1 7901 27541 - sta mousex1 7902 27541 - else 7903 27541 - cpx #6 7904 27541 - beq carryonmouse1boost 7905 27541 - clc 7906 27541 - adc mousex1 7907 27541 - sta mousex1 7908 27541 - jmp LLRET1 7909 27541 -carryonmouse1boost 7910 27541 - sta mousexdelta 7911 27541 - clc 7912 27541 - adc mousecodey1 7913 27541 - sta mousecodey1 7914 27541 - clc 7915 27541 - adc mousex1 7916 27541 - tay ; save the target X 7917 27541 - adc mousey1 ; average in the smoothly-trailing X 7918 27541 - ror 7919 27541 - sta mousex1 ; mousex0 now has the smoothly trailing X 7920 27541 - sty mousey1 ; and mousey0 has the the target X 7921 27541 - 7922 27541 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7923 27541 - ; A has mousex1, the smoothly trailing X 7924 27541 - sbc mousey1 ; less the target X 7925 27541 - bpl skipabsolutedrive1 7926 27541 - eor #$ff 7927 27541 -skipabsolutedrive1 7928 27541 - cmp #64 ; just an unreasonably large change 7929 27541 - bcc skipdrivewrapfix1 7930 27541 - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 7931 27541 -skipdrivewrapfix1 7932 27541 - 7933 27541 - ; get rid of the tweening if the distance travelled was very small 7934 27541 - lda mousexdelta 7935 27541 - cmp port1resolution 7936 27541 - bcs skipbetweenfix1 7937 27541 - lda mousex1 7938 27541 - sta mousey1 7939 27541 -skipbetweenfix1 7940 27541 - 7941 27541 -drivingboostreductioncheck1 7942 27541 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7943 27541 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7944 27541 - ; negated again because truncation during BCD math results in 7945 27541 - ; differing magnitudes, depending if the value is +ve or -ve. 7946 27541 -driving1fix 7947 27541 - lax mousecodey1 7948 27541 - cmp #$80 7949 27541 - bcs driving0skipnegate1 7950 27541 - eor #$FF 7951 27541 - adc #1 7952 27541 - sta mousecodey1 7953 27541 -driving0skipnegate1 7954 27541 - cmp #$80 7955 27541 - ror 7956 27541 - cmp #$80 7957 27541 - ror 7958 27541 - cmp #$80 7959 27541 - ror 7960 27541 - sta inttemp1 7961 27541 - lda mousecodey1 7962 27541 - sec 7963 27541 - sbc inttemp1 7964 27541 - cpx #$80 7965 27541 - bcs driving1skipnegate2 7966 27541 - eor #$FF 7967 27541 - adc #1 7968 27541 -driving1skipnegate2 7969 27541 - sta mousecodey1 7970 27541 -drivingboostdone1 7971 27541 - endif ; DRIVINGBOOST 7972 27541 - 7973 27541 - jmp LLRET1 7974 27541 - 7975 27541 endif ; MOUSE1SUPPORT 7976 27541 7977 27541 7978 27541 trakball0update 7979 27541 - ifconst TRAKBALL0SUPPORT 7980 27541 - ifnconst TRAKTIME 7981 27541 - ifnconst TRAKXONLY 7982 27541 - lda #180 ; minimum for x+y 7983 27541 - else ; !TRAKXONLY 7984 27541 - lda #100 ; minimum for just x 7985 27541 - endif ; !TRAKXONLY 7986 27541 - else ; !TRAKTIME 7987 27541 - lda #TRAKTIME 7988 27541 - endif ; !TRAKTIME 7989 27541 - jsr SETTIM64T ; INTIM is in Y 7990 27541 - ldx #0 7991 27541 - ifnconst TRAKXONLY 7992 27541 - ldy #0 7993 27541 - endif ; TRAKXONLY 7994 27541 -trakball0updateloop 7995 27541 - lda SWCHA 7996 27541 - and #%00110000 7997 27541 - cmp trakballcodex0 7998 27541 - sta trakballcodex0 7999 27541 - beq trakball0movementXdone 8000 27541 - and #%00010000 8001 27541 - beq trakball0negativeX 8002 27541 -trakball0positiveX 8003 27541 - ;(2 from beq) 8004 27541 - inx ; 2 8005 27541 - jmp trakball0movementXdone ; 3 8006 27541 -trakball0negativeX 8007 27541 - ;(3 from beq) 8008 27541 - dex ; 2 8009 27541 - nop ; 2 8010 27541 -trakball0movementXdone 8011 27541 - 8012 27541 - ifnconst TRAKXONLY 8013 27541 - lda SWCHA 8014 27541 - and #%11000000 8015 27541 - cmp trakballcodey0 8016 27541 - sta trakballcodey0 8017 27541 - beq trakball0movementYdone 8018 27541 - and #%01000000 8019 27541 - beq trakball0negativeY 8020 27541 -trakball0positiveY 8021 27541 - ;(2 from beq) 8022 27541 - iny ; 2 8023 27541 - jmp trakball0movementYdone ; 3 8024 27541 -trakball0negativeY 8025 27541 - ;(3 from beq) 8026 27541 - dey ; 2 8027 27541 - nop ; 2 8028 27541 -trakball0movementYdone 8029 27541 - endif ; !TRAKXONLY 8030 27541 - 8031 27541 - lda TIMINT 8032 27541 - bpl trakball0updateloop 8033 27541 - lda #0 8034 27541 - cpx #0 8035 27541 - beq trakball0skipXadjust 8036 27541 - clc 8037 27541 -trakball0Xloop 8038 27541 - adc port0resolution 8039 27541 - dex 8040 27541 - bne trakball0Xloop 8041 27541 - clc 8042 27541 - adc trakballx0 8043 27541 - sta trakballx0 8044 27541 -trakball0skipXadjust 8045 27541 - ifnconst TRAKXONLY 8046 27541 - lda #0 8047 27541 - cpy #0 8048 27541 - beq trakball0skipYadjust 8049 27541 - clc 8050 27541 -trakball0yloop 8051 27541 - adc port0resolution 8052 27541 - dey 8053 27541 - bne trakball0yloop 8054 27541 - clc 8055 27541 - adc trakbally0 8056 27541 - sta trakbally0 8057 27541 -trakball0skipYadjust 8058 27541 - endif ; !TRAKXONLY 8059 27541 - 8060 27541 - jmp LLRET0 8061 27541 endif 8062 27541 8063 27541 8064 27541 8065 27541 trakball1update 8066 27541 - ifconst TRAKBALL1SUPPORT 8067 27541 - ifnconst TRAKTIME 8068 27541 - ifnconst TRAKXONLY 8069 27541 - lda #180 ; minimum for x+y 8070 27541 - else ; !TRAKXONLY 8071 27541 - lda #100 ; minimum for just x 8072 27541 - endif ; !TRAKXONLY 8073 27541 - else ; !TRAKTIME 8074 27541 - lda #TRAKTIME 8075 27541 - endif ; !TRAKTIME 8076 27541 - jsr SETTIM64T ; INTIM is in Y 8077 27541 - ldx #0 8078 27541 - ifnconst TRAKXONLY 8079 27541 - ldy #0 8080 27541 - endif ; TRAKXONLY 8081 27541 -trakball1updateloop 8082 27541 - lda SWCHA 8083 27541 - and #%00000011 8084 27541 - cmp trakballcodex1 8085 27541 - sta trakballcodex1 8086 27541 - beq trakball1movementXdone 8087 27541 - and #%00000001 8088 27541 - beq trakball1negativeX 8089 27541 -trakball1positiveX 8090 27541 - ;(2 from beq) 8091 27541 - inx ; 2 8092 27541 - jmp trakball1movementXdone ; 3 8093 27541 -trakball1negativeX 8094 27541 - ;(3 from beq) 8095 27541 - dex ; 2 8096 27541 - nop ; 2 8097 27541 -trakball1movementXdone 8098 27541 - 8099 27541 - ifnconst TRAKXONLY 8100 27541 - lda SWCHA 8101 27541 - and #%00001100 8102 27541 - cmp trakballcodey1 8103 27541 - sta trakballcodey1 8104 27541 - beq trakball1movementYdone 8105 27541 - and #%00000100 8106 27541 - beq trakball1negativeY 8107 27541 -trakball1positiveY 8108 27541 - ;(2 from beq) 8109 27541 - iny ; 2 8110 27541 - jmp trakball1movementYdone ; 3 8111 27541 -trakball1negativeY 8112 27541 - ;(3 from beq) 8113 27541 - dey ; 2 8114 27541 - nop ; 2 8115 27541 -trakball1movementYdone 8116 27541 - endif ; !TRAKXONLY 8117 27541 - 8118 27541 - lda TIMINT 8119 27541 - bpl trakball1updateloop 8120 27541 - lda #0 8121 27541 - cpx #0 8122 27541 - beq trakball1skipXadjust 8123 27541 - clc 8124 27541 -trakball1Xloop 8125 27541 - adc port1resolution 8126 27541 - dex 8127 27541 - bne trakball1Xloop 8128 27541 - clc 8129 27541 - adc trakballx1 8130 27541 - sta trakballx1 8131 27541 -trakball1skipXadjust 8132 27541 - ifnconst TRAKXONLY 8133 27541 - lda #0 8134 27541 - cpy #0 8135 27541 - beq trakball1skipYadjust 8136 27541 - clc 8137 27541 -trakball1yloop 8138 27541 - adc port1resolution 8139 27541 - dey 8140 27541 - bne trakball1yloop 8141 27541 - clc 8142 27541 - adc trakbally1 8143 27541 - sta trakbally1 8144 27541 -trakball1skipYadjust 8145 27541 - endif ; !TRAKXONLY 8146 27541 - 8147 27541 - jmp LLRET1 8148 27541 endif 8149 27541 8150 27541 8151 27541 paddleport0update 8152 27541 - ifconst PADDLE0SUPPORT 8153 27541 - lda #6 8154 27541 - sta VBLANK ; start charging the paddle caps 8155 27541 - lda #0 ; use PADDLE timing 8156 27541 - jsr SETTIM64T ; INTIM is in Y 8157 27541 - 8158 27541 -paddleport0updateloop 8159 27541 - lda INPT0 8160 27541 - bmi skippaddle0setposition 8161 27541 - sty paddleposition0 8162 27541 -skippaddle0setposition 8163 27541 - ifconst TWOPADDLESUPPORT 8164 27541 - lda INPT1 8165 27541 - bmi skippaddle1setposition 8166 27541 - sty paddleposition1 8167 27541 -skippaddle1setposition 8168 27541 - endif 8169 27541 - ldy INTIM 8170 27541 - cpy #TIMEOFFSET 8171 27541 - bcs paddleport0updateloop 8172 27541 - 8173 27541 - lda #%10000110 8174 27541 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8175 27541 - sec 8176 27541 - lda paddleposition0 8177 27541 - sbc #TIMEOFFSET 8178 27541 - ifconst PADDLESCALEX2 8179 27541 - asl 8180 27541 - endif 8181 27541 - 8182 27541 - ifnconst PADDLESMOOTHINGOFF 8183 27541 - clc 8184 27541 - adc paddleprevious0 8185 27541 - ror 8186 27541 - sta paddleprevious0 8187 27541 - endif 8188 27541 - 8189 27541 - sta paddleposition0 8190 27541 - 8191 27541 - ifconst TWOPADDLESUPPORT 8192 27541 - sec 8193 27541 - lda paddleposition1 8194 27541 - sbc #TIMEOFFSET 8195 27541 - ifconst PADDLESCALEX2 8196 27541 - asl 8197 27541 - endif 8198 27541 - 8199 27541 - ifnconst PADDLESMOOTHINGOFF 8200 27541 - clc 8201 27541 - adc paddleprevious1 8202 27541 - ror 8203 27541 - sta paddleprevious1 8204 27541 - endif 8205 27541 - sta paddleposition1 8206 27541 - endif ; TWOPADDLESUPPORT 8207 27541 - 8208 27541 - jmp LLRET0 8209 27541 endif 8210 27541 8211 27541 paddleport1update 8212 27541 - ifconst PADDLE1SUPPORT 8213 27541 - lda #6 8214 27541 - sta VBLANK ; start charging the paddle caps 8215 27541 - 8216 27541 - lda #0 ; use PADDLE timing 8217 27541 - jsr SETTIM64T ; INTIM is in Y 8218 27541 - 8219 27541 -paddleport1updateloop 8220 27541 - lda INPT2 8221 27541 - bmi skippaddle2setposition 8222 27541 - sty paddleposition2 8223 27541 -skippaddle2setposition 8224 27541 - ifconst TWOPADDLESUPPORT 8225 27541 - lda INPT3 8226 27541 - bmi skippaddle3setposition 8227 27541 - sty paddleposition3 8228 27541 -skippaddle3setposition 8229 27541 - endif 8230 27541 - ldy INTIM 8231 27541 - cpy #TIMEOFFSET 8232 27541 - bcs paddleport1updateloop 8233 27541 - 8234 27541 - lda #%10000110 8235 27541 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8236 27541 - sec 8237 27541 - lda paddleposition2 8238 27541 - sbc #TIMEOFFSET 8239 27541 - ifconst PADDLESCALEX2 8240 27541 - asl 8241 27541 - endif 8242 27541 - 8243 27541 - ifnconst PADDLESMOOTHINGOFF 8244 27541 - clc 8245 27541 - adc paddleprevious2 8246 27541 - ror 8247 27541 - sta paddleprevious2 8248 27541 - endif 8249 27541 - 8250 27541 - sta paddleposition2 8251 27541 - 8252 27541 - ifconst TWOPADDLESUPPORT 8253 27541 - sec 8254 27541 - lda paddleposition3 8255 27541 - sbc #TIMEOFFSET 8256 27541 - ifconst PADDLESCALEX2 8257 27541 - asl 8258 27541 - endif 8259 27541 - 8260 27541 - ifnconst PADDLESMOOTHINGOFF 8261 27541 - clc 8262 27541 - adc paddleprevious3 8263 27541 - ror 8264 27541 - sta paddleprevious3 8265 27541 - endif 8266 27541 - sta paddleposition3 8267 27541 - endif ; TWOPADDLESUPPORT 8268 27541 - 8269 27541 - jmp LLRET1 8270 27541 endif 8271 27541 8272 27541 8273 27541 paddlebuttonhandler ; outside of conditional, for button-handler LUT 8274 27541 - ifconst PADDLESUPPORT 8275 27541 - ; x=0|1 for port, rather than paddle #. 8276 27541 - ; Only the first paddle button will integrate into "joy0fire" testing. If the 8277 27541 - ; game wants to support 2 paddles, up to the game to instead test the 8278 27541 - ; joystick right+left directions instead. 8279 27541 - lda SWCHA ; top of nibble is first paddle button 8280 27541 - cpx #0 ; port 0? 8281 27541 - beq skippaddleport2shift 8282 27541 - asl ; shift second port to upper nibble 8283 27541 - asl 8284 27541 - asl 8285 27541 - asl 8286 27541 -skippaddleport2shift 8287 27541 - and #%10000000 8288 27541 - eor #%10000000 ; invert 8289 27541 - sta sINPT1,x 8290 27541 - jmp buttonreadloopreturn 8291 27541 endif ; PADDLESUPPORT 8292 27541 8293 27541 mousebuttonhandler ; outside of conditional, for button-handler LUT 8294 27541 - ifconst MOUSESUPPORT 8295 27541 - ; stick the mouse buttons in the correct shadow register... 8296 27541 - txa 8297 27541 - asl 8298 27541 - tay ; y=x*2 8299 27541 - lda INPT4,x 8300 27541 - eor #%10000000 8301 27541 - lsr 8302 27541 - sta sINPT1,x 8303 27541 - 8304 27541 - lda INPT1,y 8305 27541 - and #%10000000 8306 27541 - eor #%10000000 8307 27541 - ora sINPT1,x 8308 27541 - sta sINPT1,x 8309 27541 - jmp buttonreadloopreturn 8310 27541 endif ; MOUSESUPPORT 8311 27541 8312 27541 - ifconst KEYPADSUPPORT 8313 27541 - ; ** select keypad rows 0 to 3 over 4 frames... 8314 27541 -keypadrowselect 8315 27541 - ldy #0 8316 27541 - lda port0control 8317 27541 - cmp #7 8318 27541 - bne skipport0val 8319 27541 - iny ; y=y+1 8320 27541 -skipport0val 8321 27541 - lda port1control 8322 27541 - cmp #7 8323 27541 - bne skipport1val 8324 27541 - iny 8325 27541 - iny ; y=y+2 8326 27541 -skipport1val 8327 27541 - lda keyrowdirectionmask,y 8328 27541 - sta CTLSWA 8329 27541 - tya 8330 27541 - asl 8331 27541 - asl 8332 27541 - sta inttemp1 8333 27541 - lda framecounter 8334 27541 - and #3 8335 27541 - ora inttemp1 8336 27541 - tax 8337 27541 - lda keyrowselectvalue,x 8338 27541 - sta SWCHA 8339 27541 - rts 8340 27541 - 8341 27541 -keyrowdirectionmask 8342 27541 - .byte #%00000000 ; 0 : port0=input port1=input 8343 27541 - .byte #%11110000 ; 1 : port0=output port1=input 8344 27541 - .byte #%00001111 ; 2 : port0=input port1=output 8345 27541 - .byte #%11111111 ; 3 : port0=output port1=output 8346 27541 - 8347 27541 -keyrowselectvalue 8348 27541 - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 8349 27541 - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 8350 27541 - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 8351 27541 - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 8352 27541 endif ; KEYPADSUPPORT 8353 27541 8354 27541 - ifconst KEYPADSUPPORT 8355 27541 - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 8356 27541 -keypadcolumnread 8357 27541 - lda port0control 8358 27541 - cmp #7 8359 27541 - bne skipkeypadcolumnread0 8360 27541 - lda framecounter 8361 27541 - and #3 8362 27541 - asl ; x2 because keypad variables are interleaved 8363 27541 - tax 8364 27541 - lda #0 8365 27541 - sta keypadmatrix0a,x 8366 27541 - lda INPT0 8367 27541 - cmp #$80 8368 27541 - rol keypadmatrix0a,x 8369 27541 - lda INPT1 8370 27541 - cmp #$80 8371 27541 - rol keypadmatrix0a,x 8372 27541 - lda INPT4 8373 27541 - cmp #$80 8374 27541 - rol keypadmatrix0a,x 8375 27541 - lda keypadmatrix0a,x 8376 27541 - eor #%00000111 8377 27541 - sta keypadmatrix0a,x 8378 27541 -skipkeypadcolumnread0 8379 27541 - 8380 27541 - lda port1control 8381 27541 - cmp #7 8382 27541 - bne skipkeypadcolumnread1 8383 27541 - lda framecounter 8384 27541 - and #3 8385 27541 - asl ; x2 because keypad variables are interleaved 8386 27541 - tax 8387 27541 - lda #0 8388 27541 - sta keypadmatrix1a,x 8389 27541 - rol keypadmatrix1a,x 8390 27541 - lda INPT2 8391 27541 - cmp #$80 8392 27541 - rol keypadmatrix1a,x 8393 27541 - lda INPT3 8394 27541 - cmp #$80 8395 27541 - rol keypadmatrix1a,x 8396 27541 - lda INPT5 8397 27541 - cmp #$80 8398 27541 - rol keypadmatrix1a,x 8399 27541 - lda keypadmatrix1a,x 8400 27541 - eor #%00000111 8401 27541 - sta keypadmatrix1a,x 8402 27541 -skipkeypadcolumnread1 8403 27541 - rts 8404 27541 endif ; KEYPADSUPPORT 8405 27541 8406 27541 setportforinput 8407 27541 a5 e4 lda CTLSWAs 8408 27543 3d 4c f5 and allpinsinputlut,x 8409 27546 85 e4 sta CTLSWAs 8410 27548 8d 81 02 sta CTLSWA 8411 2754b 60 rts 8412 2754c 8413 2754c allpinsinputlut 8414 2754c 0f f0 .byte.b $0F, $F0 8415 2754e 8416 2754e setonebuttonmode 8417 2754e a9 06 lda #6 ; in case we're in unlocked-bios mode 8418 27550 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8419 27552 a9 14 lda #$14 8420 27554 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8421 27557 a5 e5 lda CTLSWBs 8422 27559 1d 62 f5 ora thisjoy2buttonbit,x 8423 2755c 85 e5 sta CTLSWBs 8424 2755e 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 8425 27561 60 rts 8426 27562 8427 27562 thisjoy2buttonbit 8428 27562 04 10 .byte.b $04, $10 8429 27564 8430 27564 settwobuttonmode 8431 27564 a9 06 lda #6 ; in case we're in unlocked-bios mode 8432 27566 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8433 27568 a9 14 lda #$14 8434 2756a 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8435 2756d a5 e5 lda CTLSWBs 8436 2756f 3d 78 f5 and thisjoy2buttonmask,x 8437 27572 85 e5 sta CTLSWBs 8438 27574 8d 82 02 sta SWCHB 8439 27577 60 rts 8440 27578 8441 27578 thisjoy2buttonmask 8442 27578 fb ef .byte.b $fb, $ef 8443 2757a 8444 2757a ; Provided under the CC0 license. See the included LICENSE.txt for details. 8445 2757a 8446 2757a START 8447 2757a start 8448 2757a 8449 2757a ;******** more or less the Atari recommended startup procedure 8450 2757a 8451 2757a 78 sei 8452 2757b d8 cld 8453 2757c 8454 2757c ifnconst NOTIALOCK 8455 2757c a9 07 lda #$07 8456 2757e - else 8457 2757e - lda #$06 8458 2757e endif 8459 2757e 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 8460 27580 a9 7f lda #$7F 8461 27582 85 3c sta CTRL ;disable DMA 8462 27584 a9 00 lda #$00 8463 27586 85 38 sta OFFSET 8464 27588 ifnconst NOTIALOCK 8465 27588 85 01 sta INPTCTRL 8466 2758a 85 20 sta BACKGRND ; black default, in case a flash cart is using something else 8467 2758c endif 8468 2758c a2 ff ldx #$FF 8469 2758e 9a txs 8470 2758f 8471 2758f ;************** Clear Memory 8472 2758f 8473 2758f a2 40 ldx #$40 8474 27591 a9 00 lda #$00 8475 27593 crloop1 8476 27593 95 00 sta $00,x ;Clear zero page 8477 27595 9d 00 01 sta $100,x ;Clear page 1 8478 27598 e8 inx 8479 27599 d0 f8 bne crloop1 8480 2759b 8481 2759b 8482 2759b a0 00 ldy #$00 ;Clear Ram 8483 2759d a9 18 lda #$18 ;Start at $1800 8484 2759f 85 81 sta $81 8485 275a1 a9 00 lda #$00 8486 275a3 85 80 sta $80 8487 275a5 crloop3 8488 275a5 a9 00 lda #$00 8489 275a7 91 80 sta ($80),y ;Store data 8490 275a9 c8 iny ;Next byte 8491 275aa d0 f9 bne crloop3 ;Branch if not done page 8492 275ac e6 81 inc $81 ;Next page 8493 275ae a5 81 lda $81 8494 275b0 c9 20 cmp #$20 ;End at $1FFF 8495 275b2 d0 f1 bne crloop3 ;Branch if not 8496 275b4 8497 275b4 a0 00 ldy #$00 ;Clear Ram 8498 275b6 a9 22 lda #$22 ;Start at $2200 8499 275b8 85 81 sta $81 8500 275ba a9 00 lda #$00 8501 275bc 85 80 sta $80 8502 275be crloop4 8503 275be a9 00 lda #$00 8504 275c0 91 80 sta ($80),y ;Store data 8505 275c2 c8 iny ;Next byte 8506 275c3 d0 f9 bne crloop4 ;Branch if not done page 8507 275c5 e6 81 inc $81 ;Next page 8508 275c7 a5 81 lda $81 8509 275c9 c9 27 cmp #$27 ;End at $27FF 8510 275cb d0 f1 bne crloop4 ;Branch if not 8511 275cd 8512 275cd a2 00 ldx #$00 8513 275cf a9 00 lda #$00 8514 275d1 crloop5 ;Clear 2100-213F, 2000-203F 8515 275d1 9d 00 20 sta $2000,x 8516 275d4 9d 00 21 sta $2100,x 8517 275d7 e8 inx 8518 275d8 e0 40 cpx #$40 8519 275da d0 f5 bne crloop5 8520 275dc 8521 275dc 85 80 sta $80 8522 275de 85 81 sta $81 8523 275e0 85 82 sta $82 8524 275e2 85 83 sta $83 8525 275e4 8526 275e4 ;seed random number with hopefully-random timer value 8527 275e4 a9 01 lda #1 8528 275e6 0d 84 02 ora INTIM 8529 275e9 85 40 sta rand 8530 275eb 8531 275eb ; detect the console type... 8532 275eb pndetectvblankstart 8533 275eb a5 28 lda MSTAT 8534 275ed 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 8535 275ef pndetectvblankover 8536 275ef a5 28 lda MSTAT 8537 275f1 30 fc bmi pndetectvblankover ; then wait for it to be over 8538 275f3 a0 00 ldy #$00 8539 275f5 a2 00 ldx #$00 8540 275f7 pndetectvblankhappening 8541 275f7 a5 28 lda MSTAT 8542 275f9 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 8543 275fb 85 24 sta WSYNC 8544 275fd 85 24 sta WSYNC 8545 275ff e8 inx 8546 27600 d0 f5 bne pndetectvblankhappening 8547 27602 pndetectinvblank 8548 27602 e0 7d cpx #125 8549 27604 90 02 bcc pndetecispal 8550 27606 a0 01 ldy #$01 8551 27608 pndetecispal 8552 27608 8c 09 21 sty paldetected 8553 2760b 8554 2760b 20 a7 f4 jsr createallgamedlls 8555 2760e 8556 2760e a9 18 lda #>DLLMEM 8557 27610 85 2c sta DPPH 8558 27612 a9 00 lda # 255 8753 2766b -DOUBLEBUFFEROFFSET = 255 8754 2766b else 8755 2766b 00 4d DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 8756 2766b endif 8757 2766b 8758 2766b - ifconst EXTRADLMEMORY 8759 2766b -SECONDDLHALFSTART SET $2300 8760 2766b endif 8761 2766b 8762 2766b DLPOINTH 8763 2766b DLINDEX SET 0 8764 2766b REPEAT WZONECOUNT 8765 2766b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 2766b - ifconst EXTRADLMEMORY 8767 2766b - if TMPMEMADDRESS > $1FFF 8768 2766b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 2766b - else 8770 2766b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 2766b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 2766b -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 2766b - endif 8774 2766b - endif ; TMPMEMADDRESS > $1FFF 8775 2766b endif ; EXTRADLMEMORY 8776 2766b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 2766b 18 .byte.b >TMPMEMADDRESS 8778 2766b DLINDEX SET DLINDEX + 1 8764 2766b REPEND 8765 2766b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 2766c - ifconst EXTRADLMEMORY 8767 2766c - if TMPMEMADDRESS > $1FFF 8768 2766c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 2766c - else 8770 2766c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 2766c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 2766c -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 2766c - endif 8774 2766c - endif ; TMPMEMADDRESS > $1FFF 8775 2766c endif ; EXTRADLMEMORY 8776 2766c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 2766c 18 .byte.b >TMPMEMADDRESS 8778 2766c DLINDEX SET DLINDEX + 1 8764 2766c REPEND 8765 2766c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 2766d - ifconst EXTRADLMEMORY 8767 2766d - if TMPMEMADDRESS > $1FFF 8768 2766d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 2766d - else 8770 2766d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 2766d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 2766d -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 2766d - endif 8774 2766d - endif ; TMPMEMADDRESS > $1FFF 8775 2766d endif ; EXTRADLMEMORY 8776 2766d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 2766d 19 .byte.b >TMPMEMADDRESS 8778 2766d DLINDEX SET DLINDEX + 1 8764 2766d REPEND 8765 2766d TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 2766e - ifconst EXTRADLMEMORY 8767 2766e - if TMPMEMADDRESS > $1FFF 8768 2766e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 2766e - else 8770 2766e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 2766e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 2766e -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 2766e - endif 8774 2766e - endif ; TMPMEMADDRESS > $1FFF 8775 2766e endif ; EXTRADLMEMORY 8776 2766e ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 2766e 19 .byte.b >TMPMEMADDRESS 8778 2766e DLINDEX SET DLINDEX + 1 8764 2766e REPEND 8765 2766e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 2766f - ifconst EXTRADLMEMORY 8767 2766f - if TMPMEMADDRESS > $1FFF 8768 2766f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 2766f - else 8770 2766f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 2766f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 2766f -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 2766f - endif 8774 2766f - endif ; TMPMEMADDRESS > $1FFF 8775 2766f endif ; EXTRADLMEMORY 8776 2766f ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 2766f 19 .byte.b >TMPMEMADDRESS 8778 2766f DLINDEX SET DLINDEX + 1 8764 2766f REPEND 8765 2766f TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27670 - ifconst EXTRADLMEMORY 8767 27670 - if TMPMEMADDRESS > $1FFF 8768 27670 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27670 - else 8770 27670 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27670 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27670 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27670 - endif 8774 27670 - endif ; TMPMEMADDRESS > $1FFF 8775 27670 endif ; EXTRADLMEMORY 8776 27670 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27670 1a .byte.b >TMPMEMADDRESS 8778 27670 DLINDEX SET DLINDEX + 1 8764 27670 REPEND 8765 27670 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27671 - ifconst EXTRADLMEMORY 8767 27671 - if TMPMEMADDRESS > $1FFF 8768 27671 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27671 - else 8770 27671 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27671 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27671 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27671 - endif 8774 27671 - endif ; TMPMEMADDRESS > $1FFF 8775 27671 endif ; EXTRADLMEMORY 8776 27671 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27671 1a .byte.b >TMPMEMADDRESS 8778 27671 DLINDEX SET DLINDEX + 1 8764 27671 REPEND 8765 27671 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27672 - ifconst EXTRADLMEMORY 8767 27672 - if TMPMEMADDRESS > $1FFF 8768 27672 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27672 - else 8770 27672 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27672 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27672 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27672 - endif 8774 27672 - endif ; TMPMEMADDRESS > $1FFF 8775 27672 endif ; EXTRADLMEMORY 8776 27672 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27672 1a .byte.b >TMPMEMADDRESS 8778 27672 DLINDEX SET DLINDEX + 1 8764 27672 REPEND 8765 27672 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27673 - ifconst EXTRADLMEMORY 8767 27673 - if TMPMEMADDRESS > $1FFF 8768 27673 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27673 - else 8770 27673 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27673 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27673 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27673 - endif 8774 27673 - endif ; TMPMEMADDRESS > $1FFF 8775 27673 endif ; EXTRADLMEMORY 8776 27673 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27673 1b .byte.b >TMPMEMADDRESS 8778 27673 DLINDEX SET DLINDEX + 1 8764 27673 REPEND 8765 27673 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27674 - ifconst EXTRADLMEMORY 8767 27674 - if TMPMEMADDRESS > $1FFF 8768 27674 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27674 - else 8770 27674 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27674 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27674 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27674 - endif 8774 27674 - endif ; TMPMEMADDRESS > $1FFF 8775 27674 endif ; EXTRADLMEMORY 8776 27674 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27674 1b .byte.b >TMPMEMADDRESS 8778 27674 DLINDEX SET DLINDEX + 1 8764 27674 REPEND 8765 27674 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27675 - ifconst EXTRADLMEMORY 8767 27675 - if TMPMEMADDRESS > $1FFF 8768 27675 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27675 - else 8770 27675 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27675 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27675 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27675 - endif 8774 27675 - endif ; TMPMEMADDRESS > $1FFF 8775 27675 endif ; EXTRADLMEMORY 8776 27675 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27675 1b .byte.b >TMPMEMADDRESS 8778 27675 DLINDEX SET DLINDEX + 1 8764 27675 REPEND 8765 27675 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27676 - ifconst EXTRADLMEMORY 8767 27676 - if TMPMEMADDRESS > $1FFF 8768 27676 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27676 - else 8770 27676 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27676 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27676 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27676 - endif 8774 27676 - endif ; TMPMEMADDRESS > $1FFF 8775 27676 endif ; EXTRADLMEMORY 8776 27676 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27676 1b .byte.b >TMPMEMADDRESS 8778 27676 DLINDEX SET DLINDEX + 1 8764 27676 REPEND 8765 27676 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27677 - ifconst EXTRADLMEMORY 8767 27677 - if TMPMEMADDRESS > $1FFF 8768 27677 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27677 - else 8770 27677 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27677 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27677 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27677 - endif 8774 27677 - endif ; TMPMEMADDRESS > $1FFF 8775 27677 endif ; EXTRADLMEMORY 8776 27677 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27677 1c .byte.b >TMPMEMADDRESS 8778 27677 DLINDEX SET DLINDEX + 1 8764 27677 REPEND 8765 27677 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27678 - ifconst EXTRADLMEMORY 8767 27678 - if TMPMEMADDRESS > $1FFF 8768 27678 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27678 - else 8770 27678 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27678 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27678 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27678 - endif 8774 27678 - endif ; TMPMEMADDRESS > $1FFF 8775 27678 endif ; EXTRADLMEMORY 8776 27678 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27678 1c .byte.b >TMPMEMADDRESS 8778 27678 DLINDEX SET DLINDEX + 1 8764 27678 REPEND 8765 27678 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27679 - ifconst EXTRADLMEMORY 8767 27679 - if TMPMEMADDRESS > $1FFF 8768 27679 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27679 - else 8770 27679 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27679 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27679 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27679 - endif 8774 27679 - endif ; TMPMEMADDRESS > $1FFF 8775 27679 endif ; EXTRADLMEMORY 8776 27679 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27679 1c .byte.b >TMPMEMADDRESS 8778 27679 DLINDEX SET DLINDEX + 1 8764 27679 REPEND 8765 27679 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 2767a - ifconst EXTRADLMEMORY 8767 2767a - if TMPMEMADDRESS > $1FFF 8768 2767a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 2767a - else 8770 2767a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 2767a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 2767a -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 2767a - endif 8774 2767a - endif ; TMPMEMADDRESS > $1FFF 8775 2767a endif ; EXTRADLMEMORY 8776 2767a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 2767a 1d .byte.b >TMPMEMADDRESS 8778 2767a DLINDEX SET DLINDEX + 1 8764 2767a REPEND 8765 2767a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 2767b - ifconst EXTRADLMEMORY 8767 2767b - if TMPMEMADDRESS > $1FFF 8768 2767b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 2767b - else 8770 2767b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 2767b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 2767b -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 2767b - endif 8774 2767b - endif ; TMPMEMADDRESS > $1FFF 8775 2767b endif ; EXTRADLMEMORY 8776 2767b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 2767b 1d .byte.b >TMPMEMADDRESS 8778 2767b DLINDEX SET DLINDEX + 1 8764 2767b REPEND 8765 2767b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 2767c - ifconst EXTRADLMEMORY 8767 2767c - if TMPMEMADDRESS > $1FFF 8768 2767c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 2767c - else 8770 2767c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 2767c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 2767c -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 2767c - endif 8774 2767c - endif ; TMPMEMADDRESS > $1FFF 8775 2767c endif ; EXTRADLMEMORY 8776 2767c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 2767c 1d .byte.b >TMPMEMADDRESS 8778 2767c DLINDEX SET DLINDEX + 1 8764 2767c REPEND 8765 2767c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 2767d - ifconst EXTRADLMEMORY 8767 2767d - if TMPMEMADDRESS > $1FFF 8768 2767d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 2767d - else 8770 2767d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 2767d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 2767d -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 2767d - endif 8774 2767d - endif ; TMPMEMADDRESS > $1FFF 8775 2767d endif ; EXTRADLMEMORY 8776 2767d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 2767d 1e .byte.b >TMPMEMADDRESS 8778 2767d DLINDEX SET DLINDEX + 1 8764 2767d REPEND 8765 2767d TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 2767e - ifconst EXTRADLMEMORY 8767 2767e - if TMPMEMADDRESS > $1FFF 8768 2767e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 2767e - else 8770 2767e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 2767e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 2767e -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 2767e - endif 8774 2767e - endif ; TMPMEMADDRESS > $1FFF 8775 2767e endif ; EXTRADLMEMORY 8776 2767e ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 2767e 1e .byte.b >TMPMEMADDRESS 8778 2767e DLINDEX SET DLINDEX + 1 8764 2767e REPEND 8765 2767e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 2767f - ifconst EXTRADLMEMORY 8767 2767f - if TMPMEMADDRESS > $1FFF 8768 2767f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 2767f - else 8770 2767f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 2767f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 2767f -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 2767f - endif 8774 2767f - endif ; TMPMEMADDRESS > $1FFF 8775 2767f endif ; EXTRADLMEMORY 8776 2767f ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 2767f 1e .byte.b >TMPMEMADDRESS 8778 2767f DLINDEX SET DLINDEX + 1 8764 2767f REPEND 8765 2767f TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27680 - ifconst EXTRADLMEMORY 8767 27680 - if TMPMEMADDRESS > $1FFF 8768 27680 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27680 - else 8770 27680 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27680 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27680 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27680 - endif 8774 27680 - endif ; TMPMEMADDRESS > $1FFF 8775 27680 endif ; EXTRADLMEMORY 8776 27680 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27680 1f .byte.b >TMPMEMADDRESS 8778 27680 DLINDEX SET DLINDEX + 1 8764 27680 REPEND 8765 27680 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27681 - ifconst EXTRADLMEMORY 8767 27681 - if TMPMEMADDRESS > $1FFF 8768 27681 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27681 - else 8770 27681 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27681 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27681 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27681 - endif 8774 27681 - endif ; TMPMEMADDRESS > $1FFF 8775 27681 endif ; EXTRADLMEMORY 8776 27681 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27681 1f .byte.b >TMPMEMADDRESS 8778 27681 DLINDEX SET DLINDEX + 1 8764 27681 REPEND 8765 27681 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8766 27682 - ifconst EXTRADLMEMORY 8767 27682 - if TMPMEMADDRESS > $1FFF 8768 27682 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8769 27682 - else 8770 27682 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8771 27682 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8772 27682 -SECONDDLHALFSTART SET TMPMEMADDRESS 8773 27682 - endif 8774 27682 - endif ; TMPMEMADDRESS > $1FFF 8775 27682 endif ; EXTRADLMEMORY 8776 27682 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8777 27682 1f .byte.b >TMPMEMADDRESS 8778 27682 DLINDEX SET DLINDEX + 1 8779 27683 REPEND 8780 27683 8781 27683 - ifconst EXTRADLMEMORY 8782 27683 - echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 8783 27683 endif 8784 27683 8785 27683 8786 27683 DLPOINTL 8787 27683 DLINDEX SET 0 8788 27683 REPEAT WZONECOUNT 8789 27683 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8790 27683 - ifconst EXTRADLMEMORY 8791 27683 - if TMPMEMADDRESS > $1FFF 8792 27683 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27683 - else 8794 27683 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27683 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27683 - endif 8797 27683 - endif ; TMPMEMADDRESS > $1FFF 8798 27683 endif ; EXTRADLMEMORY 8799 27683 80 .byte.b $1FFF 8792 27684 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27684 - else 8794 27684 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27684 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27684 - endif 8797 27684 - endif ; TMPMEMADDRESS > $1FFF 8798 27684 endif ; EXTRADLMEMORY 8799 27684 d0 .byte.b $1FFF 8792 27685 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27685 - else 8794 27685 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27685 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27685 - endif 8797 27685 - endif ; TMPMEMADDRESS > $1FFF 8798 27685 endif ; EXTRADLMEMORY 8799 27685 20 .byte.b $1FFF 8792 27686 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27686 - else 8794 27686 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27686 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27686 - endif 8797 27686 - endif ; TMPMEMADDRESS > $1FFF 8798 27686 endif ; EXTRADLMEMORY 8799 27686 70 .byte.b $1FFF 8792 27687 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27687 - else 8794 27687 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27687 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27687 - endif 8797 27687 - endif ; TMPMEMADDRESS > $1FFF 8798 27687 endif ; EXTRADLMEMORY 8799 27687 c0 .byte.b $1FFF 8792 27688 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27688 - else 8794 27688 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27688 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27688 - endif 8797 27688 - endif ; TMPMEMADDRESS > $1FFF 8798 27688 endif ; EXTRADLMEMORY 8799 27688 10 .byte.b $1FFF 8792 27689 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27689 - else 8794 27689 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27689 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27689 - endif 8797 27689 - endif ; TMPMEMADDRESS > $1FFF 8798 27689 endif ; EXTRADLMEMORY 8799 27689 60 .byte.b $1FFF 8792 2768a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 2768a - else 8794 2768a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 2768a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 2768a - endif 8797 2768a - endif ; TMPMEMADDRESS > $1FFF 8798 2768a endif ; EXTRADLMEMORY 8799 2768a b0 .byte.b $1FFF 8792 2768b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 2768b - else 8794 2768b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 2768b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 2768b - endif 8797 2768b - endif ; TMPMEMADDRESS > $1FFF 8798 2768b endif ; EXTRADLMEMORY 8799 2768b 00 .byte.b $1FFF 8792 2768c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 2768c - else 8794 2768c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 2768c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 2768c - endif 8797 2768c - endif ; TMPMEMADDRESS > $1FFF 8798 2768c endif ; EXTRADLMEMORY 8799 2768c 50 .byte.b $1FFF 8792 2768d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 2768d - else 8794 2768d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 2768d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 2768d - endif 8797 2768d - endif ; TMPMEMADDRESS > $1FFF 8798 2768d endif ; EXTRADLMEMORY 8799 2768d a0 .byte.b $1FFF 8792 2768e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 2768e - else 8794 2768e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 2768e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 2768e - endif 8797 2768e - endif ; TMPMEMADDRESS > $1FFF 8798 2768e endif ; EXTRADLMEMORY 8799 2768e f0 .byte.b $1FFF 8792 2768f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 2768f - else 8794 2768f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 2768f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 2768f - endif 8797 2768f - endif ; TMPMEMADDRESS > $1FFF 8798 2768f endif ; EXTRADLMEMORY 8799 2768f 40 .byte.b $1FFF 8792 27690 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27690 - else 8794 27690 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27690 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27690 - endif 8797 27690 - endif ; TMPMEMADDRESS > $1FFF 8798 27690 endif ; EXTRADLMEMORY 8799 27690 90 .byte.b $1FFF 8792 27691 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27691 - else 8794 27691 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27691 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27691 - endif 8797 27691 - endif ; TMPMEMADDRESS > $1FFF 8798 27691 endif ; EXTRADLMEMORY 8799 27691 e0 .byte.b $1FFF 8792 27692 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27692 - else 8794 27692 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27692 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27692 - endif 8797 27692 - endif ; TMPMEMADDRESS > $1FFF 8798 27692 endif ; EXTRADLMEMORY 8799 27692 30 .byte.b $1FFF 8792 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27693 - else 8794 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27693 - endif 8797 27693 - endif ; TMPMEMADDRESS > $1FFF 8798 27693 endif ; EXTRADLMEMORY 8799 27693 80 .byte.b $1FFF 8792 27694 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27694 - else 8794 27694 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27694 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27694 - endif 8797 27694 - endif ; TMPMEMADDRESS > $1FFF 8798 27694 endif ; EXTRADLMEMORY 8799 27694 d0 .byte.b $1FFF 8792 27695 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27695 - else 8794 27695 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27695 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27695 - endif 8797 27695 - endif ; TMPMEMADDRESS > $1FFF 8798 27695 endif ; EXTRADLMEMORY 8799 27695 20 .byte.b $1FFF 8792 27696 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27696 - else 8794 27696 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27696 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27696 - endif 8797 27696 - endif ; TMPMEMADDRESS > $1FFF 8798 27696 endif ; EXTRADLMEMORY 8799 27696 70 .byte.b $1FFF 8792 27697 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27697 - else 8794 27697 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27697 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27697 - endif 8797 27697 - endif ; TMPMEMADDRESS > $1FFF 8798 27697 endif ; EXTRADLMEMORY 8799 27697 c0 .byte.b $1FFF 8792 27698 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27698 - else 8794 27698 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27698 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27698 - endif 8797 27698 - endif ; TMPMEMADDRESS > $1FFF 8798 27698 endif ; EXTRADLMEMORY 8799 27698 10 .byte.b $1FFF 8792 27699 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 27699 - else 8794 27699 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 27699 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 27699 - endif 8797 27699 - endif ; TMPMEMADDRESS > $1FFF 8798 27699 endif ; EXTRADLMEMORY 8799 27699 60 .byte.b $1FFF 8792 2769a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8793 2769a - else 8794 2769a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8795 2769a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8796 2769a - endif 8797 2769a - endif ; TMPMEMADDRESS > $1FFF 8798 2769a endif ; EXTRADLMEMORY 8799 2769a b0 .byte.b $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 18 80 ZONE0ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 18 d0 ZONE1ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 19 20 ZONE2ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 19 70 ZONE3ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 19 c0 ZONE4ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1a 10 ZONE5ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1a 60 ZONE6ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1a b0 ZONE7ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1b 00 ZONE8ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1b 50 ZONE9ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1b a0 ZONE10ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1b f0 ZONE11ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1c 40 ZONE12ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1c 90 ZONE13ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1c e0 ZONE14ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1d 30 ZONE15ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1d 80 ZONE16ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1d d0 ZONE17ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1e 20 ZONE18ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1e 70 ZONE19ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1e c0 ZONE20ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1f 10 ZONE21ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1f 60 ZONE22ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8805 2769b REPEND 8806 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8807 2769b - ifconst EXTRADLMEMORY 8808 2769b - if TMPMEMADDRESS > $1FFF 8809 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8810 2769b - else 8811 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8812 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8813 2769b - endif 8814 2769b - endif ; TMPMEMADDRESS > $1FFF 8815 2769b endif ; EXTRADLMEMORY 8816 2769b 8817 2769b 1f b0 ZONE23ADDRESS = TMPMEMADDRESS 8818 2769b 8819 2769b DLINDEX SET DLINDEX + 1 8820 2769b REPEND 8821 2769b 8822 2769b $1880 to $1fff used as zone memory, allowing 15 display objects per zone. 8823 2769b echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 8824 2769b 8825 2769b DLHEIGHT 8826 2769b REPEAT WZONECOUNT 8827 2769b 07 .byte.b (WZONEHEIGHT-1) 8826 2769b REPEND 8827 2769c 07 .byte.b (WZONEHEIGHT-1) 8826 2769c REPEND 8827 2769d 07 .byte.b (WZONEHEIGHT-1) 8826 2769d REPEND 8827 2769e 07 .byte.b (WZONEHEIGHT-1) 8826 2769e REPEND 8827 2769f 07 .byte.b (WZONEHEIGHT-1) 8826 2769f REPEND 8827 276a0 07 .byte.b (WZONEHEIGHT-1) 8826 276a0 REPEND 8827 276a1 07 .byte.b (WZONEHEIGHT-1) 8826 276a1 REPEND 8827 276a2 07 .byte.b (WZONEHEIGHT-1) 8826 276a2 REPEND 8827 276a3 07 .byte.b (WZONEHEIGHT-1) 8826 276a3 REPEND 8827 276a4 07 .byte.b (WZONEHEIGHT-1) 8826 276a4 REPEND 8827 276a5 07 .byte.b (WZONEHEIGHT-1) 8826 276a5 REPEND 8827 276a6 07 .byte.b (WZONEHEIGHT-1) 8826 276a6 REPEND 8827 276a7 07 .byte.b (WZONEHEIGHT-1) 8826 276a7 REPEND 8827 276a8 07 .byte.b (WZONEHEIGHT-1) 8826 276a8 REPEND 8827 276a9 07 .byte.b (WZONEHEIGHT-1) 8826 276a9 REPEND 8827 276aa 07 .byte.b (WZONEHEIGHT-1) 8826 276aa REPEND 8827 276ab 07 .byte.b (WZONEHEIGHT-1) 8826 276ab REPEND 8827 276ac 07 .byte.b (WZONEHEIGHT-1) 8826 276ac REPEND 8827 276ad 07 .byte.b (WZONEHEIGHT-1) 8826 276ad REPEND 8827 276ae 07 .byte.b (WZONEHEIGHT-1) 8826 276ae REPEND 8827 276af 07 .byte.b (WZONEHEIGHT-1) 8826 276af REPEND 8827 276b0 07 .byte.b (WZONEHEIGHT-1) 8826 276b0 REPEND 8827 276b1 07 .byte.b (WZONEHEIGHT-1) 8826 276b1 REPEND 8827 276b2 07 .byte.b (WZONEHEIGHT-1) 8828 276b3 REPEND 8829 276b3 8830 276b3 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8831 276b3 8832 276b3 ; a simple guard, than ensures the 7800basic code hasn't 8833 276b3 ; spilled into the encryption area... 2251 bytes left in the 7800basic reserved area. 8834 276b3 echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 8835 276b3 - if (*>$FF7D) 8836 276b3 - ERR ; abort the assembly 8837 276b3 endif 8838 276b3 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8839 276b3 8840 276b3 - ifconst DEV 8841 276b3 - ifnconst ZONEHEIGHT 8842 276b3 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8843 276b3 - else 8844 276b3 - if ZONEHEIGHT = 8 8845 276b3 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8846 276b3 - else 8847 276b3 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8848 276b3 - endif 8849 276b3 - endif 8850 276b3 endif 8851 276b3 8852 276b3 ; FF7E/FF7F contains the 7800basic crc checksum word 8853 276b3 8854 276b3 ; FF80 - FFF7 contains the 7800 encryption key 8855 276b3 8856 276b3 - ifnconst bankswitchmode 8857 276b3 - ORG $FFF8 8858 276b3 else 8859 276b3 ifconst ROM128K 8860 27ff8 ORG $27FF8 8861 27ff8 RORG $FFF8 8862 27ff8 endif 8863 27ff8 - ifconst ROM144K 8864 27ff8 - ORG $27FF8 8865 27ff8 - RORG $FFF8 8866 27ff8 endif 8867 27ff8 - ifconst ROM256K 8868 27ff8 - ORG $47FF8 8869 27ff8 - RORG $FFF8 8870 27ff8 endif 8871 27ff8 - ifconst ROM272K 8872 27ff8 - ORG $47FF8 8873 27ff8 - RORG $FFF8 8874 27ff8 endif 8875 27ff8 - ifconst ROM512K 8876 27ff8 - ORG $87FF8 8877 27ff8 - RORG $FFF8 8878 27ff8 endif 8879 27ff8 - ifconst ROM528K 8880 27ff8 - ORG $87FF8 8881 27ff8 - RORG $FFF8 8882 27ff8 endif 8883 27ff8 endif 8884 27ff8 8885 27ff8 8886 27ff8 ff .byte.b $FF ; region verification. $FF=all regions 8887 27ff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 8888 27ffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 8889 27ffa 8890 27ffa ;Vectors 8891 27ffa 00 f0 .word.w NMI 8892 27ffc 7a f5 .word.w START 8893 27ffe 62 f0 .word.w IRQ 8894 28000