------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite4.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_01_mode = $00 76 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width_twoscompliment = $00 77 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width = $00 78 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 79 28000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 80 28000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 81 28000 ???? 00 00 vertical_shooting_enemy01_mode = $00 82 28000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 83 28000 ???? 00 02 vertical_shooting_enemy01_width = $02 84 28000 ???? 00 00 vertical_shooting_powerup_mode = $00 85 28000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 86 28000 ???? 00 02 vertical_shooting_powerup_width = $02 87 28000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 88 28000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 89 28000 ???? 00 01 vertical_shooting_enemyshot_width = $01 90 28000 ???? 00 00 vertical_shooting_bullet_mode = $00 91 28000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 92 28000 ???? 00 01 vertical_shooting_bullet_width = $01 93 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 94 28000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 95 28000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 96 28000 ???? 00 00 vertical_shooting_ship_mode = $00 97 28000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 98 28000 ???? 00 02 vertical_shooting_ship_width = $02 99 28000 ???? 00 00 vertical_shooting_font_mode = $00 100 28000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 101 28000 ???? 00 2d vertical_shooting_font_width = $2d 102 28000 ???? 00 90 sfx_explosion_length = .skipL0357-sfx_explosion 103 28000 ???? 104 28000 ???? 00 30 sfx_plainlaser_length = .skipL0356-sfx_plainlaser 105 28000 ???? 106 28000 ???? 00 54 sfx_pulsecannon_length = .skipL0355-sfx_pulsecannon 107 28000 ???? 108 28000 ???? 00 36 sfx_bling_length = .skipL0354-sfx_bling 109 28000 ???? 110 28000 ???? 00 01 BOXCOLLISION = 1 111 28000 ???? 00 00 FALSE = 0 112 28000 ???? 113 28000 ???? 00 01 TRUE = 1 114 28000 ???? 115 28000 ???? 00 0c FIRINGRATE = 12 116 28000 ???? 117 28000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 118 28000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 119 28000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 120 28000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 121 28000 ???? 00 04 vertical_shooting_laser_color3 = $04 122 28000 ???? 00 42 vertical_shooting_laser_color2 = $42 123 28000 ???? 00 0f vertical_shooting_laser_color1 = $0f 124 28000 ???? 00 00 vertical_shooting_laser_color0 = $00 125 28000 ???? 00 33 vertical_shooting_explosion_10_tallsprite_00_color3 = $33 126 28000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 127 28000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 128 28000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 129 28000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 130 28000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 131 28000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 132 28000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 133 28000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 134 28000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 135 28000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 136 28000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 137 28000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 138 28000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 139 28000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 140 28000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 141 28000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 142 28000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 143 28000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 144 28000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 145 28000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 146 28000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 147 28000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 148 28000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 149 28000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 150 28000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 151 28000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 152 28000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 153 28000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 154 28000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 155 28000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 156 28000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 157 28000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 158 28000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 159 28000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 160 28000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 161 28000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 162 28000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 163 28000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 164 28000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 165 28000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 166 28000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 167 28000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 168 28000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 169 28000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 170 28000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 171 28000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 172 28000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 173 28000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 174 28000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 175 28000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 176 28000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 177 28000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 178 28000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 179 28000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 180 28000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 181 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 182 28000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 183 28000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 184 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 185 28000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 186 28000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 187 28000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 188 28000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 189 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 190 28000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 191 28000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 192 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 193 28000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 194 28000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 195 28000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 196 28000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 197 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 198 28000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 199 28000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 200 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 201 28000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 202 28000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 203 28000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 204 28000 ???? 00 00 vertical_shooting_explosion_01_color0 = $00 205 28000 ???? 00 0f vertical_shooting_1up_color3 = $0f 206 28000 ???? 00 42 vertical_shooting_1up_color2 = $42 207 28000 ???? 00 04 vertical_shooting_1up_color1 = $04 208 28000 ???? 00 00 vertical_shooting_1up_color0 = $00 209 28000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 210 28000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 211 28000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 212 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 213 28000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 214 28000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 215 28000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 216 28000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 217 28000 ???? 00 36 vertical_shooting_powerup_color3 = $36 218 28000 ???? 00 33 vertical_shooting_powerup_color2 = $33 219 28000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 220 28000 ???? 00 00 vertical_shooting_powerup_color0 = $00 221 28000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 222 28000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 223 28000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 224 28000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 225 28000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 226 28000 ???? 00 18 vertical_shooting_bullet_color2 = $18 227 28000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 228 28000 ???? 00 00 vertical_shooting_bullet_color0 = $00 229 28000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 230 28000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 231 28000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 232 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 233 28000 ???? 00 42 vertical_shooting_ship_color3 = $42 234 28000 ???? 00 04 vertical_shooting_ship_color2 = $04 235 28000 ???? 00 0f vertical_shooting_ship_color1 = $0f 236 28000 ???? 00 00 vertical_shooting_ship_color0 = $00 237 28000 ???? 00 0f vertical_shooting_font_color1 = $0f 238 28000 ???? 00 00 vertical_shooting_font_color0 = $00 239 28000 ???? 01 98 enemy01_speed = var88 240 28000 ???? 241 28000 ???? 01 97 twinlaser_flag = var87 242 28000 ???? 243 28000 ???? 01 9a customTemp2 = var90 244 28000 ???? 245 28000 ???? 01 99 customTemp1 = var89 246 28000 ???? 247 28000 ???? 00 f2 Temp_Y_speed = Temp_YSu 248 28000 ???? 00 f3 Temp_YSf = n 249 28000 ???? 250 28000 ???? 00 f2 Temp_YSu = m 251 28000 ???? 252 28000 ???? 00 f0 Temp_X_speed = Temp_XSu 253 28000 ???? 00 f1 Temp_XSf = l 254 28000 ???? 255 28000 ???? 00 f0 Temp_XSu = k 256 28000 ???? 257 28000 ???? 01 96 enemy_shotFlag = var86 258 28000 ???? 259 28000 ???? 01 95 max_bullets = var85 260 28000 ???? 261 28000 ???? 01 94 p_twinlaser4_time = var84 262 28000 ???? 263 28000 ???? 01 93 p_twinlaser3_time = var83 264 28000 ???? 265 28000 ???? 01 92 p_twinlaser2_time = var82 266 28000 ???? 267 28000 ???? 01 91 p_twinlaser1_time = var81 268 28000 ???? 269 28000 ???? 01 88 p_twinlaser4_y = var72 270 28000 ???? 01 87 p_twinlaser3_y = var71 271 28000 ???? 01 86 p_twinlaser2_y = var70 272 28000 ???? 01 85 p_twinlaser1_y = var69 273 28000 ???? 01 84 p_twinlaser4_x = var68 274 28000 ???? 01 83 p_twinlaser3_x = var67 275 28000 ???? 01 82 p_twinlaser2_x = var66 276 28000 ???? 01 81 p_twinlaser1_x = var65 277 28000 ???? 01 80 rDirection = var64 278 28000 ???? 279 28000 ???? 01 7f rMovement_2 = var63 280 28000 ???? 281 28000 ???? 01 7e rMovement_1 = var62 282 28000 ???? 283 28000 ???? 01 7d temp_y = var61 284 28000 ???? 285 28000 ???? 01 7c temp_x = var60 286 28000 ???? 287 28000 ???? 01 7b temp_Loop = var59 288 28000 ???? 289 28000 ???? 01 7a p_bullet4time = var58 290 28000 ???? 291 28000 ???? 01 79 p_bullet3time = var57 292 28000 ???? 293 28000 ???? 01 78 p_bullet2time = var56 294 28000 ???? 295 28000 ???? 01 77 p_bullet1time = var55 296 28000 ???? 297 28000 ???? 01 76 isDead_flag = var54 298 28000 ???? 299 28000 ???? 01 75 gameover_flag = var53 300 28000 ???? 301 28000 ???? 01 73 lives = var51 302 28000 ???? 303 28000 ???? 01 72 explosion_aniframe = var50 304 28000 ???? 305 28000 ???? 01 71 extra_shipFlag = var49 306 28000 ???? 307 28000 ???? 01 70 extra_shipY = var48 308 28000 ???? 309 28000 ???? 01 6f extra_shipX = var47 310 28000 ???? 311 28000 ???? 01 6e power_up_Flag = var46 312 28000 ???? 313 28000 ???? 01 6d power_upY = var45 314 28000 ???? 315 28000 ???? 01 6c power_upX = var44 316 28000 ???? 317 28000 ???? 01 6b enemy_movement = var43 318 28000 ???? 319 28000 ???? 01 6a enemy_direction = var42 320 28000 ???? 321 28000 ???? 01 68 Mob_Pos_Y = var40 322 28000 ???? 01 66 Mob_Pos_X = var38 323 28000 ???? 01 64 Mob_SpeedY = var36 324 28000 ???? 01 62 Mob_SpeedX = var34 325 28000 ???? 01 60 Total_speedY = Total_YSu 326 28000 ???? 01 61 Total_YSf = var33 327 28000 ???? 328 28000 ???? 01 60 Total_YSu = var32 329 28000 ???? 330 28000 ???? 01 5e Total_speedX = Total_XSu 331 28000 ???? 01 5f Total_XSf = var31 332 28000 ???? 333 28000 ???? 01 5e Total_XSu = var30 334 28000 ???? 335 28000 ???? 00 ef enemy_shot_direction = j 336 28000 ???? 337 28000 ???? 00 ee enemy_shot_active = i 338 28000 ???? 339 28000 ???? 00 ed enemy_shot_Syf = h 340 28000 ???? 341 28000 ???? 00 ec enemy_shot_Sy = g 342 28000 ???? 343 28000 ???? 00 eb enemy_shot_Sxf = f 344 28000 ???? 345 28000 ???? 00 ea enemy_shot_Sx = e 346 28000 ???? 347 28000 ???? 00 e9 enemy_shot_Yf = d 348 28000 ???? 349 28000 ???? 00 e8 enemy_shot_ypos = c 350 28000 ???? 351 28000 ???? 00 e7 enemy_shot_Xf = b 352 28000 ???? 353 28000 ???? 00 e6 enemy_shot_xpos = a 354 28000 ???? 355 28000 ???? 01 5d enemy01_Slowdown = var29 356 28000 ???? 357 28000 ???? 01 5c enemy01_Flag = var28 358 28000 ???? 359 28000 ???? 01 5b player_Flag = var27 360 28000 ???? 361 28000 ???? 01 5a enemy01_ypos = var26 362 28000 ???? 363 28000 ???? 01 59 enemy01_xpos = var25 364 28000 ???? 365 28000 ???? 01 58 Timer = var24 366 28000 ???? 367 28000 ???? 01 4f p_bullet4y = var15 368 28000 ???? 01 4e p_bullet3y = var14 369 28000 ???? 01 4d p_bullet2y = var13 370 28000 ???? 01 4c p_bullet1y = var12 371 28000 ???? 01 4b p_bullet4x = var11 372 28000 ???? 01 4a p_bullet3x = var10 373 28000 ???? 01 49 p_bullet2x = var9 374 28000 ???? 01 48 p_bullet1x = var8 375 28000 ???? 01 47 joyposright = var7 376 28000 ???? 377 28000 ???? 01 46 joyposleft = var6 378 28000 ???? 379 28000 ???? 01 45 joyposdown = var5 380 28000 ???? 381 28000 ???? 01 44 joyposup = var4 382 28000 ???? 383 28000 ???? 01 43 fire_debounce = var3 384 28000 ???? 385 28000 ???? 01 42 playerY = var2 386 28000 ???? 387 28000 ???? 01 41 playerX = var1 388 28000 ???? 389 28000 ???? 01 40 frame_counter = var0 390 28000 ???? 391 28000 ???? 00 01 collisionwrap = 1 392 28000 ???? 00 01 NTSC = 1 393 28000 ???? 00 c0 SCREENHEIGHT = 192 394 28000 ???? 00 01 CHECKOVERWRITE = 1 395 28000 ???? 00 08 ZONEHEIGHT = 8 396 28000 ???? 00 01 SGRAM = 1 397 28000 ???? 00 08 bankswitchmode = 8 398 28000 ???? 00 01 ROM128K = 1 ------- FILE 7800basic.h 6 28000 ???? 7 28000 ???? ;************ 7800 overall RAM map ************** 8 28000 ???? 9 28000 ???? ; 40-FF zero page RAM 10 28000 ???? ; 140-1FF RAM (stack) 11 28000 ???? ; 1800-203F RAM 12 28000 ???? ; 2100-213F RAM 13 28000 ???? ; 2200-27FF RAM 14 28000 ???? 15 28000 ???? ;************ 7800basic RAM usage map ************** 16 28000 ???? 17 28000 ???? ; 40-FF numerous defines, listed below 18 28000 ???? ; 140-1FF RAM (stack) 19 28000 ???? 20 28000 ???? ; 1800-187F DLL (1800-18DF with page flipping enabled) 21 28000 ???? ; 1880-1FFF DLs (18E0-1FFF with page flipping enabled) 22 28000 ???? 23 28000 ???? ; 2000-203F Reserved 24 28000 ???? ; 2100-213F Reserved 25 28000 ???? ; 2200-27FF Free 26 28000 ???? 27 28000 ???? 1f e0 eeprombuffer = $1FE0 28 28000 ???? 18 00 DLLMEM = $1800 29 28000 ???? 00 70 DBOFFSET = $70 ; $E0 length DL is /2 for double-buffering 30 28000 ???? 31 28000 ???? - ifconst PLOTVALUEPAGE 32 28000 ???? -VALBUFFER = (PLOTVALUEPAGE*256) 33 28000 ???? else 34 28000 ???? 20 00 VALBUFFER = $2000 ; to $203F ** never let VALBUFFER straddle pages 35 28000 ???? endif 36 28000 ???? 37 28000 ???? 38 28000 ???? 21 00 pausestate = $2100 39 28000 ???? 21 01 dlzero = $2101 ; zero to force end of $2100 DL, which we use in vblank and overscan 40 28000 ???? 21 02 sINPT1 = $2102 ; save register for joy button joy0 41 28000 ???? 21 03 sINPT3 = $2103 ; save register for joy button joy1 42 28000 ???? 21 04 currentbank = $2104 43 28000 ???? 44 28000 ???? 21 05 currentrambank = $2105 45 28000 ???? 21 06 charactermode = $2106 46 28000 ???? 21 07 sCTRL = $2107 47 28000 ???? 21 08 pokeydetected = $2108 48 28000 ???? 21 09 paldetected = $2109 49 28000 ???? 21 0a avoxdetected = $210A 50 28000 ???? 21 0b sCHARBASE = $210B ; save register for CHARBASE 51 28000 ???? 52 28000 ???? 21 0c hsdevice = $210C 53 28000 ???? 21 0d hsdifficulty = $210D 54 28000 ???? 21 0e hserror = $210E 55 28000 ???? 21 0f hsgameslot = $210F 56 28000 ???? 21 10 hsnewscoreline = $2110 57 28000 ???? 21 11 hsnewscorerank = $2111 58 28000 ???? 21 12 HSRAMTable = $2112 ; to $212F (30 bytes) Format: III*5, SSS*5 59 28000 ???? 21 12 HSRAMInitials = $2112 ; see above 60 28000 ???? 21 21 HSRAMScores = $2121 ; see above 61 28000 ???? 62 28000 ???? 21 31 ssCTRL = $2131 63 28000 ???? 21 32 ssCHARBASE = $2132 64 28000 ???? 21 33 hsdisplaymode = $2133 65 28000 ???? 21 34 gamedifficulty = $2134 66 28000 ???? 21 35 hsinitialpos = $2135 67 28000 ???? 21 36 hsinitialhold = $2136 68 28000 ???? 21 37 hscursorx = $2137 69 28000 ???? 21 38 hsjoydebounce = $2138 70 28000 ???? 21 39 hsswcha = $2139 71 28000 ???? 21 3a hsinpt1 = $213A 72 28000 ???? 21 3b hscolorchaseindex = $213B 73 28000 ???? 21 3c visibleDLLstart = $213C 74 28000 ???? 21 3d overscanDLLstart = $213D 75 28000 ???? 21 3e frameslost = $213E 76 28000 ???? 77 28000 ???? 78 28000 ???? 00 40 rand = $40 79 28000 ???? 00 41 rand16 = $41 80 28000 ???? 00 42 temp1 = $42 81 28000 ???? 00 43 temp2 = $43 82 28000 ???? 00 44 temp3 = $44 83 28000 ???? 00 45 temp4 = $45 84 28000 ???? 00 46 temp5 = $46 85 28000 ???? 00 47 temp6 = $47 86 28000 ???? 00 48 temp7 = $48 87 28000 ???? 00 49 temp8 = $49 88 28000 ???? 00 4a temp9 = $4a 89 28000 ???? 90 28000 ???? 00 4b pokeybase = $4b 91 28000 ???? 00 4b pokeybaselo = $4b 92 28000 ???? 00 4c pokeybasehi = $4c 93 28000 ???? 94 28000 ???? 00 4d visibleover = $4d 95 28000 ???? 96 28000 ???? 00 4e sfx1pointlo = $4e 97 28000 ???? 00 4f sfx2pointlo = $4f 98 28000 ???? 00 50 sfx1pointhi = $50 99 28000 ???? 00 51 sfx2pointhi = $51 100 28000 ???? 101 28000 ???? 00 52 sfx1priority = $52 102 28000 ???? 00 53 sfx2priority = $53 103 28000 ???? 00 54 sfx1poffset = $54 104 28000 ???? 00 55 sfx2poffset = $55 105 28000 ???? 106 28000 ???? 00 56 sfx1frames = $56 107 28000 ???? 00 57 sfx2frames = $57 108 28000 ???? 00 58 sfx1tick = $58 109 28000 ???? 00 59 sfx2tick = $59 110 28000 ???? 111 28000 ???? 00 5a tempmath = $5a 112 28000 ???? 113 28000 ???? 00 5b pokey1pointlo = $5b 114 28000 ???? 00 5c pokey1pointhi = $5c 115 28000 ???? 00 5d pokey2pointlo = $5d 116 28000 ???? 00 5e pokey2pointhi = $5e 117 28000 ???? 00 5f pokey3pointlo = $5f 118 28000 ???? 00 60 pokey3pointhi = $60 119 28000 ???? 00 61 pokey4pointlo = $61 120 28000 ???? 00 62 pokey4pointhi = $62 121 28000 ???? 122 28000 ???? 00 63 dlpnt = $63 ; to $64 123 28000 ???? 00 65 dlend = $65 ; to $81 - for 28 possible visible dll entries 124 28000 ???? 00 82 dlendsave = $82 ; to $9e - for 28 possible visible dll entries 125 28000 ???? 126 28000 ???? 00 9f speech_addr = $9f 127 28000 ???? 00 a0 speech_addr_hi = $a0 128 28000 ???? 129 28000 ???? 00 a1 HSGameTableLo = $a1 130 28000 ???? 00 a2 HSGameTableHi = $a2 131 28000 ???? 00 a3 HSVoxHi = $a3 132 28000 ???? 00 a4 HSVoxLo = $a4 133 28000 ???? 134 28000 ???? ;channel pointers 135 28000 ???? 136 28000 ???? 00 a5 songchannel1layer1lo = $a5 137 28000 ???? 00 a6 songchannel2layer1lo = $a6 138 28000 ???? 00 a7 songchannel3layer1lo = $a7 139 28000 ???? 00 a8 songchannel4layer1lo = $a8 140 28000 ???? 141 28000 ???? 00 a9 songchannel1layer2lo = $a9 142 28000 ???? 00 aa songchannel2layer2lo = $aA 143 28000 ???? 00 ab songchannel3layer2lo = $aB 144 28000 ???? 00 ac songchannel4layer2lo = $aC 145 28000 ???? 146 28000 ???? 00 ad songchannel1layer3lo = $aD 147 28000 ???? 00 ae songchannel2layer3lo = $aE 148 28000 ???? 00 af songchannel3layer3lo = $aF 149 28000 ???? 00 b0 songchannel4layer3lo = $b0 150 28000 ???? 151 28000 ???? 00 b1 songchannel1layer1hi = $b1 152 28000 ???? 00 b2 songchannel2layer1hi = $b2 153 28000 ???? 00 b3 songchannel3layer1hi = $b3 154 28000 ???? 00 b4 songchannel4layer1hi = $b4 155 28000 ???? 156 28000 ???? 00 b5 songchannel1layer2hi = $b5 157 28000 ???? 00 b6 songchannel2layer2hi = $b6 158 28000 ???? 00 b7 songchannel3layer2hi = $b7 159 28000 ???? 00 b8 songchannel4layer2hi = $b8 160 28000 ???? 161 28000 ???? 00 b9 songchannel1layer3hi = $b9 162 28000 ???? 00 ba songchannel2layer3hi = $bA 163 28000 ???? 00 bb songchannel3layer3hi = $bB 164 28000 ???? 00 bc songchannel4layer3hi = $bC 165 28000 ???? 166 28000 ???? 00 bd songdatalo = $bd 167 28000 ???? 00 be songdatahi = $be 168 28000 ???? 169 28000 ???? 00 bf inactivechannelcount = $bf 170 28000 ???? 171 28000 ???? 172 28000 ???? 00 c0 songchannel1transpose = $c0 173 28000 ???? 00 c1 songchannel2transpose = $c1 174 28000 ???? 00 c2 songchannel3transpose = $c2 175 28000 ???? 00 c3 songchannel4transpose = $c3 176 28000 ???? 177 28000 ???? 00 c4 songstackindex = $c4 178 28000 ???? 179 28000 ???? 00 c5 songchannel1instrumentlo = $c5 180 28000 ???? 00 c6 songchannel2instrumentlo = $c6 181 28000 ???? 00 c7 songchannel3instrumentlo = $c7 182 28000 ???? 00 c8 songchannel4instrumentlo = $c8 183 28000 ???? 184 28000 ???? 00 c9 songchannel1instrumenthi = $c9 185 28000 ???? 00 ca songchannel2instrumenthi = $ca 186 28000 ???? 00 cb songchannel3instrumenthi = $cb 187 28000 ???? 00 cc songchannel4instrumenthi = $cc 188 28000 ???? 189 28000 ???? 00 cd sfx1notedata = $cd 190 28000 ???? 00 ce sfx2notedata = $ce 191 28000 ???? 192 28000 ???? 00 cf songloops = $cf 193 28000 ???? 194 28000 ???? 00 d0 songpointerlo = $D0 195 28000 ???? 00 d1 songpointerhi = $D1 196 28000 ???? 197 28000 ???? 00 d2 voxlock = $D2 198 28000 ???? 00 d3 voxqueuesize = $D3 199 28000 ???? 200 28000 ???? 00 d4 vblankroutines = $D4 201 28000 ???? 202 28000 ???? 00 d5 doublebufferstate = $D5 203 28000 ???? 00 d6 doublebufferdloffset = $D6 204 28000 ???? 00 d7 doublebufferbufferdirty = $D7 205 28000 ???? 206 28000 ???? 00 d8 inttemp1 = $D8 207 28000 ???? 00 d9 inttemp2 = $D9 208 28000 ???? 00 da inttemp3 = $DA 209 28000 ???? 00 db inttemp4 = $DB 210 28000 ???? 00 dc inttemp5 = $DC 211 28000 ???? 00 dd inttemp6 = $DD 212 28000 ???? 213 28000 ???? 00 de sfxschedulelock = $DE 214 28000 ???? 00 df sfxschedulemissed = $DF 215 28000 ???? 00 e0 sfxinstrumentlo = $E0 216 28000 ???? 00 e1 sfxinstrumenthi = $E1 217 28000 ???? 00 e2 sfxpitchoffset = $E2 218 28000 ???? 00 e3 sfxnoteindex = $E3 219 28000 ???? 220 28000 ???? 00 e4 CTLSWAs = $E4 221 28000 ???? 00 e5 CTLSWBs = $E5 222 28000 ???? 223 28000 ???? 00 e6 A = $e6 224 28000 ???? 00 e6 a = $e6 225 28000 ???? 00 e7 B = $e7 226 28000 ???? 00 e7 b = $e7 227 28000 ???? 00 e8 C = $e8 228 28000 ???? 00 e8 c = $e8 229 28000 ???? 00 e9 D = $e9 230 28000 ???? 00 e9 d = $e9 231 28000 ???? 00 ea E = $ea 232 28000 ???? 00 ea e = $ea 233 28000 ???? 00 eb F = $eb 234 28000 ???? 00 eb f = $eb 235 28000 ???? 00 ec G = $ec 236 28000 ???? 00 ec g = $ec 237 28000 ???? 00 ed H = $ed 238 28000 ???? 00 ed h = $ed 239 28000 ???? 00 ee I = $ee 240 28000 ???? 00 ee i = $ee 241 28000 ???? 00 ef J = $ef 242 28000 ???? 00 ef j = $ef 243 28000 ???? 00 f0 K = $f0 244 28000 ???? 00 f0 k = $f0 245 28000 ???? 00 f1 L = $f1 246 28000 ???? 00 f1 l = $f1 247 28000 ???? 00 f2 M = $f2 248 28000 ???? 00 f2 m = $f2 249 28000 ???? 00 f3 N = $f3 250 28000 ???? 00 f3 n = $f3 251 28000 ???? 00 f4 O = $f4 252 28000 ???? 00 f4 o = $f4 253 28000 ???? 00 f5 P = $f5 254 28000 ???? 00 f5 p = $f5 255 28000 ???? 00 f6 Q = $f6 256 28000 ???? 00 f6 q = $f6 257 28000 ???? 00 f7 R = $f7 258 28000 ???? 00 f7 r = $f7 259 28000 ???? 00 f8 S = $f8 260 28000 ???? 00 f8 s = $f8 261 28000 ???? 00 f9 T = $f9 262 28000 ???? 00 f9 t = $f9 263 28000 ???? 00 fa U = $fa 264 28000 ???? 00 fa u = $fa 265 28000 ???? 00 fb V = $fb 266 28000 ???? 00 fb v = $fb 267 28000 ???? 00 fc W = $fc 268 28000 ???? 00 fc w = $fc 269 28000 ???? 00 fd X = $fd 270 28000 ???? 00 fd x = $fd 271 28000 ???? 00 fe Y = $fe 272 28000 ???? 00 fe y = $fe 273 28000 ???? 00 ff Z = $ff 274 28000 ???? 00 ff z = $ff 275 28000 ???? 276 28000 ???? ; var0-var99 variables use the top of the stack 277 28000 ???? 01 40 var0 = $140 278 28000 ???? 01 41 var1 = $141 279 28000 ???? 01 42 var2 = $142 280 28000 ???? 01 43 var3 = $143 281 28000 ???? 01 44 var4 = $144 282 28000 ???? 01 45 var5 = $145 283 28000 ???? 01 46 var6 = $146 284 28000 ???? 01 47 var7 = $147 285 28000 ???? 01 48 var8 = $148 286 28000 ???? 01 49 var9 = $149 287 28000 ???? 01 4a var10 = $14a 288 28000 ???? 01 4b var11 = $14b 289 28000 ???? 01 4c var12 = $14c 290 28000 ???? 01 4d var13 = $14d 291 28000 ???? 01 4e var14 = $14e 292 28000 ???? 01 4f var15 = $14f 293 28000 ???? 01 50 var16 = $150 294 28000 ???? 01 51 var17 = $151 295 28000 ???? 01 52 var18 = $152 296 28000 ???? 01 53 var19 = $153 297 28000 ???? 01 54 var20 = $154 298 28000 ???? 01 55 var21 = $155 299 28000 ???? 01 56 var22 = $156 300 28000 ???? 01 57 var23 = $157 301 28000 ???? 01 58 var24 = $158 302 28000 ???? 01 59 var25 = $159 303 28000 ???? 01 5a var26 = $15a 304 28000 ???? 01 5b var27 = $15b 305 28000 ???? 01 5c var28 = $15c 306 28000 ???? 01 5d var29 = $15d 307 28000 ???? 01 5e var30 = $15e 308 28000 ???? 01 5f var31 = $15f 309 28000 ???? 01 60 var32 = $160 310 28000 ???? 01 61 var33 = $161 311 28000 ???? 01 62 var34 = $162 312 28000 ???? 01 63 var35 = $163 313 28000 ???? 01 64 var36 = $164 314 28000 ???? 01 65 var37 = $165 315 28000 ???? 01 66 var38 = $166 316 28000 ???? 01 67 var39 = $167 317 28000 ???? 01 68 var40 = $168 318 28000 ???? 01 69 var41 = $169 319 28000 ???? 01 6a var42 = $16a 320 28000 ???? 01 6b var43 = $16b 321 28000 ???? 01 6c var44 = $16c 322 28000 ???? 01 6d var45 = $16d 323 28000 ???? 01 6e var46 = $16e 324 28000 ???? 01 6f var47 = $16f 325 28000 ???? 01 70 var48 = $170 326 28000 ???? 01 71 var49 = $171 327 28000 ???? 01 72 var50 = $172 328 28000 ???? 01 73 var51 = $173 329 28000 ???? 01 74 var52 = $174 330 28000 ???? 01 75 var53 = $175 331 28000 ???? 01 76 var54 = $176 332 28000 ???? 01 77 var55 = $177 333 28000 ???? 01 78 var56 = $178 334 28000 ???? 01 79 var57 = $179 335 28000 ???? 01 7a var58 = $17a 336 28000 ???? 01 7b var59 = $17b 337 28000 ???? 01 7c var60 = $17c 338 28000 ???? 01 7d var61 = $17d 339 28000 ???? 01 7e var62 = $17e 340 28000 ???? 01 7f var63 = $17f 341 28000 ???? 01 80 var64 = $180 342 28000 ???? 01 81 var65 = $181 343 28000 ???? 01 82 var66 = $182 344 28000 ???? 01 83 var67 = $183 345 28000 ???? 01 84 var68 = $184 346 28000 ???? 01 85 var69 = $185 347 28000 ???? 01 86 var70 = $186 348 28000 ???? 01 87 var71 = $187 349 28000 ???? 01 88 var72 = $188 350 28000 ???? 01 89 var73 = $189 351 28000 ???? 01 8a var74 = $18a 352 28000 ???? 01 8b var75 = $18b 353 28000 ???? 01 8c var76 = $18c 354 28000 ???? 01 8d var77 = $18d 355 28000 ???? 01 8e var78 = $18e 356 28000 ???? 01 8f var79 = $18f 357 28000 ???? 01 90 var80 = $190 358 28000 ???? 01 91 var81 = $191 359 28000 ???? 01 92 var82 = $192 360 28000 ???? 01 93 var83 = $193 361 28000 ???? 01 94 var84 = $194 362 28000 ???? 01 95 var85 = $195 363 28000 ???? 01 96 var86 = $196 364 28000 ???? 01 97 var87 = $197 365 28000 ???? 01 98 var88 = $198 366 28000 ???? 01 99 var89 = $199 367 28000 ???? 01 9a var90 = $19a 368 28000 ???? 01 9b var91 = $19b 369 28000 ???? 01 9c var92 = $19c 370 28000 ???? 01 9d var93 = $19d 371 28000 ???? 01 9e var94 = $19e 372 28000 ???? 01 9f var95 = $19f 373 28000 ???? 01 a0 var96 = $1a0 374 28000 ???? 01 a1 var97 = $1a1 375 28000 ???? 01 a2 var98 = $1a2 376 28000 ???? 01 a3 var99 = $1a3 377 28000 ???? 378 U01c2 ???? SEG.U "7800basicRAM" 379 U01a4 ORG $1A4 380 U01a4 381 U01a4 ; MAX allocation locations are in comments... 382 U01a4 00 framecounter DS 1 ; $1A4 383 U01a5 00 countdownseconds DS 1 ; $1A5 384 U01a6 00 00 00 score0 DS 3 ; $1A6 $1A7 $1A8 385 U01a9 00 00 00 score1 DS 3 ; $1A9 $1AA $1AB 386 U01ac 00 pausebuttonflag DS 1 ; $1AC 387 U01ad 00 valbufend DS 1 ; $1AD 388 U01ae 00 valbufendsave DS 1 ; $1AE 389 U01af 00 finescrollx DS 1 ; $1AF 390 U01b0 00 finescrolly DS 1 ; $1B0 391 U01b1 00 joybuttonmode DS 1 ; $1B1 ; track joysticks that were changed to one-button mode 392 U01b2 00 interruptindex DS 1 ; $1B2 393 U01b3 394 U01b3 - ifconst DOUBLEBUFFER 395 U01b3 -doublebufferminimumframetarget DS 1 ; $1B3 396 U01b3 -doublebufferminimumframeindex DS 1 ; $1B4 397 U01b3 endif 398 U01b3 399 U01b3 00 pausedisable DS 1 ; $1B5 400 U01b4 00 XCTRL1s DS 1 ; $1B6 401 U01b5 402 U01b5 - ifconst AVOXVOICE 403 U01b5 -avoxenable DS 1 ; $1B7 404 U01b5 -tempavox DS 1 ; $1B8 405 U01b5 endif 406 U01b5 407 U01b5 - ifconst MUSICTRACKER 408 U01b5 -songtempo DS 1 ; $1B9 409 U01b5 -songtick DS 1 ; $1BA 410 U01b5 - 411 U01b5 -songchannel1layer1loops DS 1 ; $1BB 412 U01b5 -songchannel2layer1loops DS 1 ; $1BC 413 U01b5 -songchannel3layer1loops DS 1 ; $1BD 414 U01b5 -songchannel4layer1loops DS 1 ; $1BE 415 U01b5 - 416 U01b5 -songchannel1layer2loops DS 1 ; $1BF 417 U01b5 -songchannel2layer2loops DS 1 ; $1C0 418 U01b5 -songchannel3layer2loops DS 1 ; $1C1 419 U01b5 -songchannel4layer2loops DS 1 ; $1C2 420 U01b5 - 421 U01b5 -songchannel1layer3loops DS 1 ; $1C3 422 U01b5 -songchannel2layer3loops DS 1 ; $1C4 423 U01b5 -songchannel3layer3loops DS 1 ; $1C5 424 U01b5 -songchannel4layer3loops DS 1 ; $1C6 425 U01b5 - 426 U01b5 -songchannel1busywait DS 1 ; $1C7 427 U01b5 -songchannel2busywait DS 1 ; $1C8 428 U01b5 -songchannel3busywait DS 1 ; $1C9 429 U01b5 -songchannel4busywait DS 1 ; $1CA 430 U01b5 - 431 U01b5 -songchannel1stackdepth DS 1 ; $1CB 432 U01b5 -songchannel2stackdepth DS 1 ; $1CC 433 U01b5 -songchannel3stackdepth DS 1 ; $1CD 434 U01b5 -songchannel4stackdepth DS 1 ; $1CE 435 U01b5 endif 436 U01b5 437 U01b5 00 palframes DS 1 ; $1CF 438 U01b6 00 palfastframe DS 1 ; $1D0 439 U01b7 440 U01b7 - ifconst MOUSESUPPORT 441 U01b7 -port0resolution DS 1 ; $1D1 442 U01b7 -port1resolution DS 1 ; $1D2 443 U01b7 else 444 U01b7 - ifconst TRAKBALLSUPPORT 445 U01b7 -port0resolution DS 1 ; $1D1 446 U01b7 -port1resolution DS 1 ; $1D2 447 U01b7 endif 448 U01b7 endif 449 U01b7 450 U01b7 00 port0control DS 1 ; $1D3 451 U01b8 00 port1control DS 1 ; $1D4 452 U01b9 453 U01b9 ; port#control values... 454 U01b9 ; 1 = proline 455 U01b9 ; 2 = lightgun 456 U01b9 ; 3 = paddle 457 U01b9 ; 4 = trakball 458 U01b9 ; 5 = vcs joystick 459 U01b9 ; 6 = driving 460 U01b9 ; 7 = keypad 461 U01b9 ; 8 = st mouse/cx80 462 U01b9 ; 9 = amiga mouse 463 U01b9 ; 10 = atarivox 464 U01b9 465 U01b9 ; controller 0 data... 466 U01b9 00 paddleposition0 DS 1 ; $1D5 467 U01b9 01 b9 keypadmatrix0a = paddleposition0 468 U01b9 01 b9 drivingposition0 = paddleposition0 469 U01b9 01 b9 trakballx0 = paddleposition0 470 U01b9 01 b9 mousex0 = paddleposition0 471 U01b9 01 b9 lighttgunx0 = paddleposition0 472 U01ba 473 U01ba ; controller 1 data... 474 U01ba 00 paddleposition2 DS 1 ; $1D6 475 U01ba 01 ba keypadmatrix1a = paddleposition2 476 U01ba 01 ba drivingposition1 = paddleposition2 477 U01ba 01 ba trakballx1 = paddleposition2 478 U01ba 01 ba mousex1 = paddleposition2 479 U01ba 01 ba lightgunx1 = paddleposition2 480 U01bb 481 U01bb ; controller 0 altdata... 482 U01bb 00 paddleposition1 DS 1 ; $1D7 483 U01bb 01 bb keypadmatrix0b = paddleposition1 484 U01bb 01 bb trakbally0 = paddleposition1 485 U01bb 01 bb mousey0 = paddleposition1 486 U01bb 01 bb lightguny0 = paddleposition1 487 U01bc 488 U01bc ; controller 1 altdata... 489 U01bc 00 paddleposition3 DS 1 ; $1D8 490 U01bc 01 bc keypadmatrix1b = paddleposition3 491 U01bc 01 bc trakbally1 = paddleposition3 492 U01bc 01 bc mousey1 = paddleposition3 493 U01bc 01 bc lightguny1 = paddleposition3 494 U01bd 495 U01bd ; controller state save. for trakball state+dir codes, rotary position codes 496 U01bd 00 controller0statesave DS 1 ; $1D9 497 U01bd 01 bd paddleprevious0 = controller0statesave 498 U01bd 01 bd mousecodex0 = controller0statesave 499 U01bd 01 bd trakballcodex0 = controller0statesave 500 U01bd 01 bd keypadmatrix0c = controller0statesave 501 U01be 502 U01be 00 controller1statesave DS 1 ; $1DA 503 U01be 01 be paddleprevious2 = controller1statesave 504 U01be 01 be mousecodex1 = controller1statesave 505 U01be 01 be trakballcodex1 = controller1statesave 506 U01be 01 be keypadmatrix1c = controller1statesave 507 U01bf 508 U01bf 00 paddleprevious1 DS 1 ; $1DB 509 U01bf 01 bf keypadmatrix0d = paddleprevious1 510 U01bf 01 bf mousecodey0 = paddleprevious1 511 U01bf 01 bf trakballcodey0 = paddleprevious1 512 U01c0 513 U01c0 00 paddleprevious3 DS 1 ; $1DC 514 U01c0 01 c0 keypadmatrix1d = paddleprevious3 515 U01c0 01 c0 mousecodey1 = paddleprevious3 516 U01c0 01 c0 trakballcodey1 = paddleprevious3 517 U01c1 518 U01c1 - ifconst pokeysupport 519 U01c1 -pokey1frames DS 1 ; $1DD 520 U01c1 -pokey1tick DS 1 ; $1DE 521 U01c1 -pokey2frames DS 1 ; $1DF 522 U01c1 -pokey2tick DS 1 ; $1E0 523 U01c1 -pokey3frames DS 1 ; $1E1 524 U01c1 -pokey3tick DS 1 ; $1E2 525 U01c1 -pokey4frames DS 1 ; $1E3 526 U01c1 -pokey4tick DS 1 ; $1E4 527 U01c1 -pokey1priority DS 1 ; $1E5 528 U01c1 -pokey1offset DS 1 ; $1E6 529 U01c1 -pokey2priority DS 1 ; $1E7 530 U01c1 -pokey2offset DS 1 ; $1E8 531 U01c1 -pokey3priority DS 1 ; $1E9 532 U01c1 -pokey3offset DS 1 ; $1EA 533 U01c1 -pokey4priority DS 1 ; $1EB 534 U01c1 -pokey4offset DS 1 ; $1EC 535 U01c1 endif 536 U01c1 537 U01c1 ; see if we need an interrupthold byte... 538 U01c1 INTERRUPTNEEDED SET 0 539 U01c1 - ifconst .topscreenroutine 540 U01c1 -INTERRUPTNEEDED SET 1 541 U01c1 endif 542 U01c1 - ifconst .bottomscreenroutine 543 U01c1 -INTERRUPTNEEDED SET 1 544 U01c1 endif 545 U01c1 - ifconst .userinterrupt 546 U01c1 -INTERRUPTNEEDED SET 1 547 U01c1 endif 548 U01c1 - if INTERRUPTNEEDED = 1 549 U01c1 -interrupthold DS 1 ; $1ED 550 U01c1 endif 551 U01c1 552 U01c1 ifnconst CANARYOFF 553 U01c1 00 canary DS 1 ; $1EF 554 U01c2 endif 555 U01c2 556 U01c2 557 U01c2 - ifnconst bankswitchmode 558 U01c2 - echo " stack allowance:",[($1FF - .)/2]d,"nested subroutines." 559 U01c2 else stack allowance: 20 nested subroutines. 560 U01c2 echo " stack allowance:",[($1FF - .)/3]d,"nested subroutines." 561 U01c2 endif 562 U01c2 ifnconst CANARYOFF the canary is situated at: $1c1 563 U01c2 echo " the canary is situated at:",[canary] 564 U01c2 - else 565 U01c2 - echo " the canary is disabled." 566 U01c2 endif 567 U01c2 568 U01c2 ; $1EE - $1FF reserved for stack 569 U01c2 570 28000 ???? SEG "GAME" 571 28000 ???? ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite4.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_01_mode = $00 76 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width_twoscompliment = $00 77 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width = $00 78 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 79 28000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 80 28000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 81 28000 ???? 00 00 vertical_shooting_enemy01_mode = $00 82 28000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 83 28000 ???? 00 02 vertical_shooting_enemy01_width = $02 84 28000 ???? 00 00 vertical_shooting_powerup_mode = $00 85 28000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 86 28000 ???? 00 02 vertical_shooting_powerup_width = $02 87 28000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 88 28000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 89 28000 ???? 00 01 vertical_shooting_enemyshot_width = $01 90 28000 ???? 00 00 vertical_shooting_bullet_mode = $00 91 28000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 92 28000 ???? 00 01 vertical_shooting_bullet_width = $01 93 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 94 28000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 95 28000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 96 28000 ???? 00 00 vertical_shooting_ship_mode = $00 97 28000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 98 28000 ???? 00 02 vertical_shooting_ship_width = $02 99 28000 ???? 00 00 vertical_shooting_font_mode = $00 100 28000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 101 28000 ???? 00 2d vertical_shooting_font_width = $2d 102 28000 ???? 00 90 sfx_explosion_length = .skipL0357-sfx_explosion 103 28000 ???? 104 28000 ???? 00 30 sfx_plainlaser_length = .skipL0356-sfx_plainlaser 105 28000 ???? 106 28000 ???? 00 54 sfx_pulsecannon_length = .skipL0355-sfx_pulsecannon 107 28000 ???? 108 28000 ???? 00 36 sfx_bling_length = .skipL0354-sfx_bling 109 28000 ???? 110 28000 ???? 00 01 BOXCOLLISION = 1 111 28000 ???? 00 00 FALSE = 0 112 28000 ???? 113 28000 ???? 00 01 TRUE = 1 114 28000 ???? 115 28000 ???? 00 0c FIRINGRATE = 12 116 28000 ???? 117 28000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 118 28000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 119 28000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 120 28000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 121 28000 ???? 00 04 vertical_shooting_laser_color3 = $04 122 28000 ???? 00 42 vertical_shooting_laser_color2 = $42 123 28000 ???? 00 0f vertical_shooting_laser_color1 = $0f 124 28000 ???? 00 00 vertical_shooting_laser_color0 = $00 125 28000 ???? 00 33 vertical_shooting_explosion_10_tallsprite_00_color3 = $33 126 28000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 127 28000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 128 28000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 129 28000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 130 28000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 131 28000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 132 28000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 133 28000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 134 28000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 135 28000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 136 28000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 137 28000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 138 28000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 139 28000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 140 28000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 141 28000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 142 28000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 143 28000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 144 28000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 145 28000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 146 28000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 147 28000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 148 28000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 149 28000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 150 28000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 151 28000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 152 28000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 153 28000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 154 28000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 155 28000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 156 28000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 157 28000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 158 28000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 159 28000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 160 28000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 161 28000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 162 28000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 163 28000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 164 28000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 165 28000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 166 28000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 167 28000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 168 28000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 169 28000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 170 28000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 171 28000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 172 28000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 173 28000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 174 28000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 175 28000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 176 28000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 177 28000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 178 28000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 179 28000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 180 28000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 181 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 182 28000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 183 28000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 184 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 185 28000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 186 28000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 187 28000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 188 28000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 189 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 190 28000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 191 28000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 192 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 193 28000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 194 28000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 195 28000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 196 28000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 197 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 198 28000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 199 28000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 200 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 201 28000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 202 28000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 203 28000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 204 28000 ???? 00 00 vertical_shooting_explosion_01_color0 = $00 205 28000 ???? 00 0f vertical_shooting_1up_color3 = $0f 206 28000 ???? 00 42 vertical_shooting_1up_color2 = $42 207 28000 ???? 00 04 vertical_shooting_1up_color1 = $04 208 28000 ???? 00 00 vertical_shooting_1up_color0 = $00 209 28000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 210 28000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 211 28000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 212 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 213 28000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 214 28000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 215 28000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 216 28000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 217 28000 ???? 00 36 vertical_shooting_powerup_color3 = $36 218 28000 ???? 00 33 vertical_shooting_powerup_color2 = $33 219 28000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 220 28000 ???? 00 00 vertical_shooting_powerup_color0 = $00 221 28000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 222 28000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 223 28000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 224 28000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 225 28000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 226 28000 ???? 00 18 vertical_shooting_bullet_color2 = $18 227 28000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 228 28000 ???? 00 00 vertical_shooting_bullet_color0 = $00 229 28000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 230 28000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 231 28000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 232 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 233 28000 ???? 00 42 vertical_shooting_ship_color3 = $42 234 28000 ???? 00 04 vertical_shooting_ship_color2 = $04 235 28000 ???? 00 0f vertical_shooting_ship_color1 = $0f 236 28000 ???? 00 00 vertical_shooting_ship_color0 = $00 237 28000 ???? 00 0f vertical_shooting_font_color1 = $0f 238 28000 ???? 00 00 vertical_shooting_font_color0 = $00 239 28000 ???? 01 98 enemy01_speed = var88 240 28000 ???? 241 28000 ???? 01 97 twinlaser_flag = var87 242 28000 ???? 243 28000 ???? 01 9a customTemp2 = var90 244 28000 ???? 245 28000 ???? 01 99 customTemp1 = var89 246 28000 ???? 247 28000 ???? 00 f2 Temp_Y_speed = Temp_YSu 248 28000 ???? 00 f3 Temp_YSf = n 249 28000 ???? 250 28000 ???? 00 f2 Temp_YSu = m 251 28000 ???? 252 28000 ???? 00 f0 Temp_X_speed = Temp_XSu 253 28000 ???? 00 f1 Temp_XSf = l 254 28000 ???? 255 28000 ???? 00 f0 Temp_XSu = k 256 28000 ???? 257 28000 ???? 01 96 enemy_shotFlag = var86 258 28000 ???? 259 28000 ???? 01 95 max_bullets = var85 260 28000 ???? 261 28000 ???? 01 94 p_twinlaser4_time = var84 262 28000 ???? 263 28000 ???? 01 93 p_twinlaser3_time = var83 264 28000 ???? 265 28000 ???? 01 92 p_twinlaser2_time = var82 266 28000 ???? 267 28000 ???? 01 91 p_twinlaser1_time = var81 268 28000 ???? 269 28000 ???? 01 88 p_twinlaser4_y = var72 270 28000 ???? 01 87 p_twinlaser3_y = var71 271 28000 ???? 01 86 p_twinlaser2_y = var70 272 28000 ???? 01 85 p_twinlaser1_y = var69 273 28000 ???? 01 84 p_twinlaser4_x = var68 274 28000 ???? 01 83 p_twinlaser3_x = var67 275 28000 ???? 01 82 p_twinlaser2_x = var66 276 28000 ???? 01 81 p_twinlaser1_x = var65 277 28000 ???? 01 80 rDirection = var64 278 28000 ???? 279 28000 ???? 01 7f rMovement_2 = var63 280 28000 ???? 281 28000 ???? 01 7e rMovement_1 = var62 282 28000 ???? 283 28000 ???? 01 7d temp_y = var61 284 28000 ???? 285 28000 ???? 01 7c temp_x = var60 286 28000 ???? 287 28000 ???? 01 7b temp_Loop = var59 288 28000 ???? 289 28000 ???? 01 7a p_bullet4time = var58 290 28000 ???? 291 28000 ???? 01 79 p_bullet3time = var57 292 28000 ???? 293 28000 ???? 01 78 p_bullet2time = var56 294 28000 ???? 295 28000 ???? 01 77 p_bullet1time = var55 296 28000 ???? 297 28000 ???? 01 76 isDead_flag = var54 298 28000 ???? 299 28000 ???? 01 75 gameover_flag = var53 300 28000 ???? 301 28000 ???? 01 73 lives = var51 302 28000 ???? 303 28000 ???? 01 72 explosion_aniframe = var50 304 28000 ???? 305 28000 ???? 01 71 extra_shipFlag = var49 306 28000 ???? 307 28000 ???? 01 70 extra_shipY = var48 308 28000 ???? 309 28000 ???? 01 6f extra_shipX = var47 310 28000 ???? 311 28000 ???? 01 6e power_up_Flag = var46 312 28000 ???? 313 28000 ???? 01 6d power_upY = var45 314 28000 ???? 315 28000 ???? 01 6c power_upX = var44 316 28000 ???? 317 28000 ???? 01 6b enemy_movement = var43 318 28000 ???? 319 28000 ???? 01 6a enemy_direction = var42 320 28000 ???? 321 28000 ???? 01 68 Mob_Pos_Y = var40 322 28000 ???? 01 66 Mob_Pos_X = var38 323 28000 ???? 01 64 Mob_SpeedY = var36 324 28000 ???? 01 62 Mob_SpeedX = var34 325 28000 ???? 01 60 Total_speedY = Total_YSu 326 28000 ???? 01 61 Total_YSf = var33 327 28000 ???? 328 28000 ???? 01 60 Total_YSu = var32 329 28000 ???? 330 28000 ???? 01 5e Total_speedX = Total_XSu 331 28000 ???? 01 5f Total_XSf = var31 332 28000 ???? 333 28000 ???? 01 5e Total_XSu = var30 334 28000 ???? 335 28000 ???? 00 ef enemy_shot_direction = j 336 28000 ???? 337 28000 ???? 00 ee enemy_shot_active = i 338 28000 ???? 339 28000 ???? 00 ed enemy_shot_Syf = h 340 28000 ???? 341 28000 ???? 00 ec enemy_shot_Sy = g 342 28000 ???? 343 28000 ???? 00 eb enemy_shot_Sxf = f 344 28000 ???? 345 28000 ???? 00 ea enemy_shot_Sx = e 346 28000 ???? 347 28000 ???? 00 e9 enemy_shot_Yf = d 348 28000 ???? 349 28000 ???? 00 e8 enemy_shot_ypos = c 350 28000 ???? 351 28000 ???? 00 e7 enemy_shot_Xf = b 352 28000 ???? 353 28000 ???? 00 e6 enemy_shot_xpos = a 354 28000 ???? 355 28000 ???? 01 5d enemy01_Slowdown = var29 356 28000 ???? 357 28000 ???? 01 5c enemy01_Flag = var28 358 28000 ???? 359 28000 ???? 01 5b player_Flag = var27 360 28000 ???? 361 28000 ???? 01 5a enemy01_ypos = var26 362 28000 ???? 363 28000 ???? 01 59 enemy01_xpos = var25 364 28000 ???? 365 28000 ???? 01 58 Timer = var24 366 28000 ???? 367 28000 ???? 01 4f p_bullet4y = var15 368 28000 ???? 01 4e p_bullet3y = var14 369 28000 ???? 01 4d p_bullet2y = var13 370 28000 ???? 01 4c p_bullet1y = var12 371 28000 ???? 01 4b p_bullet4x = var11 372 28000 ???? 01 4a p_bullet3x = var10 373 28000 ???? 01 49 p_bullet2x = var9 374 28000 ???? 01 48 p_bullet1x = var8 375 28000 ???? 01 47 joyposright = var7 376 28000 ???? 377 28000 ???? 01 46 joyposleft = var6 378 28000 ???? 379 28000 ???? 01 45 joyposdown = var5 380 28000 ???? 381 28000 ???? 01 44 joyposup = var4 382 28000 ???? 383 28000 ???? 01 43 fire_debounce = var3 384 28000 ???? 385 28000 ???? 01 42 playerY = var2 386 28000 ???? 387 28000 ???? 01 41 playerX = var1 388 28000 ???? 389 28000 ???? 01 40 frame_counter = var0 390 28000 ???? 391 28000 ???? 00 01 collisionwrap = 1 392 28000 ???? 00 01 NTSC = 1 393 28000 ???? 00 c0 SCREENHEIGHT = 192 394 28000 ???? 00 01 CHECKOVERWRITE = 1 395 28000 ???? 00 08 ZONEHEIGHT = 8 396 28000 ???? 00 01 SGRAM = 1 397 28000 ???? 00 08 bankswitchmode = 8 398 28000 ???? 00 01 ROM128K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite4.78b.asm 555 28000 ???? 556 28000 ???? ; A BEAD header gets automatically incorportated into the ROM header. 557 28000 ???? ; For more BEAD executable info, check out the spec... 558 28000 ???? ; http://7800.8bitdev.org/index.php/The_Atari_7800_BEAD_Execuable_Specification 559 28000 ???? 560 28000 ???? 00 01 GAMEDESCRIPTIONSET = 1 561 28000 ???? 4e 61 6d 65 GAMEDESCRIPTION = "Test Name" 562 28000 ???? 563 28000 ???? 00 40 BDHSC = %01000000 564 28000 ???? 00 20 BDYM = %00100000 565 28000 ???? 00 10 BDPOKEY = %00010000 566 28000 ???? 00 08 BDROF = %00001000 567 28000 ???? 00 00 BD16K = %00000000 568 28000 ???? 00 01 BD32K = %00000001 569 28000 ???? 00 02 BD48K = %00000010 570 28000 ???? 00 05 BD1800 = %00000101 571 28000 ???? 00 06 BD4000 = %00000110 572 28000 ???? 573 28000 ???? - ifconst ROM32K 574 28000 ???? -BEADHEADER = 1 575 28000 ???? endif 576 28000 ???? - ifconst ROM48K 577 28000 ???? -BEADHEADER = 1 578 28000 ???? endif 579 28000 ???? 580 28000 ???? - ifconst BEADHEADER 581 28000 ???? -BEADHARDWARE SET 0 582 28000 ???? - ifconst ROM16K 583 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD16K) 584 28000 ???? - endif 585 28000 ???? - ifconst ROM32K 586 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD32K) 587 28000 ???? - endif 588 28000 ???? - ifconst ROM48K 589 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD48K) 590 28000 ???? - endif 591 28000 ???? - ifconst pokeysupport 592 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDPOKEY) 593 28000 ???? - endif 594 28000 ???? - ifconst HSSUPPORT 595 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDHSC) 596 28000 ???? - endif 597 28000 ???? endif 598 28000 ???? 599 28000 ???? ;start address of cart... 600 28000 ???? - ifconst ROM48K 601 28000 ???? - ORG $4000,0 602 28000 ???? - ifconst BEADHEADER 603 28000 ???? - .byte $BE,$AD,BEADHARDWARE 604 28000 ???? - ifconst GAMEDESCRIPTIONSET 605 28000 ???? - CLC 606 28000 ???? - BCC _SKIPDESCRIPTION 607 28000 ???? - .byte GAMEDESCRIPTION,0 608 28000 ???? -_SKIPDESCRIPTION 609 28000 ???? - endif 610 28000 ???? - jmp ($FFFC) 611 28000 ???? - endif 612 28000 ???? else 613 28000 ???? ifconst bankswitchmode 614 28000 ???? - ifconst ROMAT4K 615 28000 ???? - ORG $4000,0 616 28000 ???? - RORG $4000 617 28000 ???? else 618 8000 ORG $8000,0 619 8000 RORG $8000 620 8000 endif 621 8000 - else ; not bankswitchmode 622 8000 - ifconst ROM16K 623 8000 - ORG $C000,0 624 8000 - ifconst BEADHEADER 625 8000 - .byte $BE,$AD,BEADHARDWARE 626 8000 - ifconst GAMEDESCRIPTION 627 8000 - CLC 628 8000 - BCC _SKIPDESCRIPTION 629 8000 - .byte GAMEDESCRIPTION,0 630 8000 -_SKIPDESCRIPTION 631 8000 - endif 632 8000 - jmp ($FFFC) 633 8000 - endif 634 8000 - else 635 8000 - ifconst ROM8K 636 8000 - ORG $E000,0 637 8000 - else 638 8000 - ORG $8000,0 639 8000 - ifconst BEADHEADER 640 8000 - .byte $BE,$AD,BEADHARDWARE 641 8000 - ifconst GAMEDESCRIPTION 642 8000 - CLC 643 8000 - BCC _SKIPDESCRIPTION 644 8000 - .byte GAMEDESCRIPTION,0 645 8000 -_SKIPDESCRIPTION 646 8000 - endif 647 8000 - jmp ($FFFC) 648 8000 - endif 649 8000 - endif 650 8000 - endif 651 8000 endif 652 8000 endif 653 8000 654 8000 ;7800basic v0.18 Mar 14 2021 14:27:24 655 8000 SPACEOVERFLOW SET 0 656 8000 game 657 8000 . 658 8000 ;; 659 8000 660 8000 . 661 8000 ;; 662 8000 663 8000 .L00 ;; set romsize 128kRAM 664 8000 665 8000 .L01 ;; set zoneheight 8 666 8000 667 8000 .L02 ;; set zoneprotection on 668 8000 669 8000 .L03 ;; set tallsprite on 670 8000 671 8000 .L04 ;; set screenheight 192 672 8000 673 8000 .L05 ;; set basepath gfx 674 8000 675 8000 .L06 ;; set tv ntsc 676 8000 677 8000 .L07 ;; set collisionwrap on 678 8000 679 8000 .L08 ;; set doublewide off 680 8000 681 8000 . 682 8000 ;; 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 frame_counter = 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 p_bullet1x = var8.var16 711 8007 712 8007 .L019 ;; dim p_bullet2x = var9.var17 713 8007 714 8007 .L020 ;; dim p_bullet3x = var10.var18 715 8007 716 8007 .L021 ;; dim p_bullet4x = var11.var19 717 8007 718 8007 .L022 ;; dim p_bullet1y = var12.var20 719 8007 720 8007 .L023 ;; dim p_bullet2y = var13.var21 721 8007 722 8007 .L024 ;; dim p_bullet3y = var14.var22 723 8007 724 8007 .L025 ;; dim p_bullet4y = var15.var23 725 8007 726 8007 .L026 ;; dim Timer = var24 727 8007 728 8007 .L027 ;; dim enemy01_xpos = var25 729 8007 730 8007 .L028 ;; dim enemy01_ypos = var26 731 8007 732 8007 .L029 ;; dim player_Flag = var27 733 8007 734 8007 .L030 ;; dim enemy01_Flag = var28 735 8007 736 8007 .L031 ;; dim enemy01_Slowdown = var29 737 8007 738 8007 .L032 ;; dim enemy_shot_xpos = a 739 8007 740 8007 .L033 ;; dim enemy_shot_Xf = b 741 8007 742 8007 .L034 ;; dim enemy_shot_ypos = c 743 8007 744 8007 .L035 ;; dim enemy_shot_Yf = d 745 8007 746 8007 .L036 ;; dim enemy_shot_Sx = e 747 8007 748 8007 .L037 ;; dim enemy_shot_Sxf = f 749 8007 750 8007 .L038 ;; dim enemy_shot_Sy = g 751 8007 752 8007 .L039 ;; dim enemy_shot_Syf = h 753 8007 754 8007 .L040 ;; dim enemy_shot_active = i 755 8007 756 8007 .L041 ;; dim enemy_shot_direction = j 757 8007 758 8007 .L042 ;; dim Total_XSu = var30 759 8007 760 8007 .L043 ;; dim Total_XSf = var31 761 8007 762 8007 .L044 ;; dim Total_speedX = Total_XSu.Total_XSf 763 8007 764 8007 .L045 ;; dim Total_YSu = var32 765 8007 766 8007 .L046 ;; dim Total_YSf = var33 767 8007 768 8007 .L047 ;; dim Total_speedY = Total_YSu.Total_YSf 769 8007 770 8007 .L048 ;; dim Mob_SpeedX = var34.var35 771 8007 772 8007 .L049 ;; dim Mob_SpeedY = var36.var37 773 8007 774 8007 .L050 ;; dim Mob_Pos_X = var38.var39 775 8007 776 8007 .L051 ;; dim Mob_Pos_Y = var40.var41 777 8007 778 8007 .L052 ;; dim enemy_direction = var42 779 8007 780 8007 .L053 ;; dim enemy_movement = var43 781 8007 782 8007 .L054 ;; dim power_upX = var44 783 8007 784 8007 .L055 ;; dim power_upY = var45 785 8007 786 8007 .L056 ;; dim power_up_Flag = var46 787 8007 788 8007 .L057 ;; dim extra_shipX = var47 789 8007 790 8007 .L058 ;; dim extra_shipY = var48 791 8007 792 8007 .L059 ;; dim extra_shipFlag = var49 793 8007 794 8007 .L060 ;; dim explosion_aniframe = var50 795 8007 796 8007 .L061 ;; dim lives = var51 797 8007 798 8007 . 799 8007 ;; 800 8007 801 8007 .L062 ;; dim gameover_flag = var53 802 8007 803 8007 .L063 ;; dim isDead_flag = var54 804 8007 805 8007 .L064 ;; dim p_bullet1time = var55 806 8007 807 8007 .L065 ;; dim p_bullet2time = var56 808 8007 809 8007 .L066 ;; dim p_bullet3time = var57 810 8007 811 8007 .L067 ;; dim p_bullet4time = var58 812 8007 813 8007 .L068 ;; dim temp_Loop = var59 814 8007 815 8007 .L069 ;; dim temp_x = var60 816 8007 817 8007 .L070 ;; dim temp_y = var61 818 8007 819 8007 .L071 ;; dim rMovement_1 = var62 820 8007 821 8007 .L072 ;; dim rMovement_2 = var63 822 8007 823 8007 .L073 ;; dim rDirection = var64 824 8007 825 8007 .L074 ;; dim p_twinlaser1_x = var65.var73 826 8007 827 8007 .L075 ;; dim p_twinlaser2_x = var66.var74 828 8007 829 8007 .L076 ;; dim p_twinlaser3_x = var67.var75 830 8007 831 8007 .L077 ;; dim p_twinlaser4_x = var68.var76 832 8007 833 8007 .L078 ;; dim p_twinlaser1_y = var69.var77 834 8007 835 8007 .L079 ;; dim p_twinlaser2_y = var70.var78 836 8007 837 8007 .L080 ;; dim p_twinlaser3_y = var71.var79 838 8007 839 8007 .L081 ;; dim p_twinlaser4_y = var72.var80 840 8007 841 8007 .L082 ;; dim p_twinlaser1_time = var81 842 8007 843 8007 .L083 ;; dim p_twinlaser2_time = var82 844 8007 845 8007 .L084 ;; dim p_twinlaser3_time = var83 846 8007 847 8007 .L085 ;; dim p_twinlaser4_time = var84 848 8007 849 8007 .L086 ;; dim max_bullets = var85 850 8007 851 8007 .L087 ;; dim enemy_shotFlag = var86 852 8007 853 8007 .L088 ;; dim Temp_XSu = k 854 8007 855 8007 .L089 ;; dim Temp_XSf = l 856 8007 857 8007 .L090 ;; dim Temp_X_speed = Temp_XSu.Temp_XSf 858 8007 859 8007 .L091 ;; dim Temp_YSu = m 860 8007 861 8007 .L092 ;; dim Temp_YSf = n 862 8007 863 8007 .L093 ;; dim Temp_Y_speed = Temp_YSu.Temp_YSf 864 8007 865 8007 .L094 ;; dim customTemp1 = var89 866 8007 867 8007 .L095 ;; dim customTemp2 = var90 868 8007 869 8007 .L096 ;; dim twinlaser_flag = var87 870 8007 871 8007 .L097 ;; dim enemy01_speed = var88 872 8007 873 8007 . 874 8007 ;; 875 8007 876 8007 .L098 ;; characterset vertical_shooting_font 877 8007 878 8007 a9 a0 lda #>vertical_shooting_font 879 8009 8d 0b 21 sta sCHARBASE 880 800c 881 800c 85 34 sta CHARBASE 882 800e a9 60 lda #(vertical_shooting_font_mode | %01100000) 883 8010 8d 06 21 sta charactermode 884 8013 885 8013 .L099 ;; alphachars ' 0123456789abcdefghijklmnopqrstuvwxyz.,?!:;`"' 886 8013 887 8013 . 888 8013 ;; 889 8013 890 8013 .import 891 8013 ;; import 892 8013 893 8013 .L0100 ;; incgraphic vertical_shooting_font.png 160A 894 8013 895 8013 .L0101 ;; incgraphic vertical_shooting_ship.png 160A 896 8013 897 8013 .L0102 ;; incgraphic vertical_shooting_bullet.png 160A 898 8013 899 8013 .L0103 ;; incgraphic vertical_shooting_enemyshot.png 160A 900 8013 901 8013 .L0104 ;; incgraphic vertical_shooting_powerup.png 160A 902 8013 903 8013 .L0105 ;; incgraphic vertical_shooting_enemy01.png 160A 904 8013 905 8013 .L0106 ;; newblock 906 8013 907 8013 .L0107 ;; incgraphic vertical_shooting_1up.png 160A 908 8013 909 8013 .L0108 ;; incgraphic vertical_shooting_explosion_01.png 160A 910 8013 911 8013 .L0109 ;; incgraphic vertical_shooting_explosion_02.png 160A 912 8013 913 8013 .L0110 ;; incgraphic vertical_shooting_explosion_03.png 160A 914 8013 915 8013 .L0111 ;; incgraphic vertical_shooting_explosion_04.png 160A 916 8013 917 8013 .L0112 ;; incgraphic vertical_shooting_explosion_05.png 160A 918 8013 919 8013 .L0113 ;; incgraphic vertical_shooting_explosion_06.png 160A 920 8013 921 8013 .L0114 ;; incgraphic vertical_shooting_explosion_07.png 160A 922 8013 923 8013 .L0115 ;; incgraphic vertical_shooting_explosion_08.png 160A 924 8013 925 8013 .L0116 ;; incgraphic vertical_shooting_explosion_09.png 160A 926 8013 927 8013 .L0117 ;; incgraphic vertical_shooting_explosion_10.png 160A 928 8013 929 8013 .L0118 ;; incgraphic vertical_shooting_laser.png 160A 930 8013 931 8013 . 932 8013 ;; 933 8013 934 8013 .L0119 ;; const FIRINGRATE = 12 935 8013 936 8013 .L0120 ;; const TRUE = 1 937 8013 938 8013 .L0121 ;; const FALSE = 0 939 8013 940 8013 . 941 8013 ;; 942 8013 943 8013 . 944 8013 ;; 945 8013 946 8013 .palettes 947 8013 ;; palettes 948 8013 949 8013 .L0122 ;; P0C1 = $0F : P0C2 = $05 : P0C3 = $32 950 8013 951 8013 a9 0f LDA #$0F 952 8015 85 21 STA P0C1 953 8017 a9 05 LDA #$05 954 8019 85 22 STA P0C2 955 801b a9 32 LDA #$32 956 801d 85 23 STA P0C3 957 801f .L0123 ;; P1C1 = $0F : P1C2 = $EE : P1C3 = $E7 958 801f 959 801f a9 0f LDA #$0F 960 8021 85 25 STA P1C1 961 8023 a9 ee LDA #$EE 962 8025 85 26 STA P1C2 963 8027 a9 e7 LDA #$E7 964 8029 85 27 STA P1C3 965 802b .L0124 ;; P2C1 = $9D : P2C2 = $73 : P2C3 = $88 966 802b 967 802b a9 9d LDA #$9D 968 802d 85 29 STA P2C1 969 802f a9 73 LDA #$73 970 8031 85 2a STA P2C2 971 8033 a9 88 LDA #$88 972 8035 85 2b STA P2C3 973 8037 .L0125 ;; P3C1 = $FB : P3C2 = $F2 : P3C3 = $25 974 8037 975 8037 a9 fb LDA #$FB 976 8039 85 2d STA P3C1 977 803b a9 f2 LDA #$F2 978 803d 85 2e STA P3C2 979 803f a9 25 LDA #$25 980 8041 85 2f STA P3C3 981 8043 . 982 8043 ;; 983 8043 984 8043 .plot 985 8043 ;; plot 986 8043 987 8043 .L0126 ;; frame_counter = 0 988 8043 989 8043 a9 00 LDA #0 990 8045 8d 40 01 STA frame_counter 991 8048 .L0127 ;; playerX = 80 : playerY = 144 : player_Flag = 0 992 8048 993 8048 a9 50 LDA #80 994 804a 8d 41 01 STA playerX 995 804d a9 90 LDA #144 996 804f 8d 42 01 STA playerY 997 8052 a9 00 LDA #0 998 8054 8d 5b 01 STA player_Flag 999 8057 .L0128 ;; fire_debounce = 0 : joyposdown = 0 : joyposup = 0 : joyposleft = 0 : joyposright = 0 1000 8057 1001 8057 a9 00 LDA #0 1002 8059 8d 43 01 STA fire_debounce 1003 805c 8d 45 01 STA joyposdown 1004 805f 8d 44 01 STA joyposup 1005 8062 8d 46 01 STA joyposleft 1006 8065 8d 47 01 STA joyposright 1007 8068 .L0129 ;; Timer = FIRINGRATE 1008 8068 1009 8068 a9 0c LDA #FIRINGRATE 1010 806a 8d 58 01 STA Timer 1011 806d .L0130 ;; enemy01_xpos = 5 : enemy01_ypos = 5 : enemy01_Flag = 0 : enemy01_speed = 3 : enemy_direction = 0 : enemy_movement = 0 1012 806d 1013 806d a9 05 LDA #5 1014 806f 8d 59 01 STA enemy01_xpos 1015 8072 8d 5a 01 STA enemy01_ypos 1016 8075 a9 00 LDA #0 1017 8077 8d 5c 01 STA enemy01_Flag 1018 807a a9 03 LDA #3 1019 807c 8d 98 01 STA enemy01_speed 1020 807f a9 00 LDA #0 1021 8081 8d 6a 01 STA enemy_direction 1022 8084 8d 6b 01 STA enemy_movement 1023 8087 .L0131 ;; rMovement_1 = 1 : rMovement_2 = 1 : rDirection = 1 1024 8087 1025 8087 a9 01 LDA #1 1026 8089 8d 7e 01 STA rMovement_1 1027 808c 8d 7f 01 STA rMovement_2 1028 808f 8d 80 01 STA rDirection 1029 8092 .L0132 ;; power_upX = 5 : power_upY = 32 : power_up_Flag = 0 1030 8092 1031 8092 a9 05 LDA #5 1032 8094 8d 6c 01 STA power_upX 1033 8097 a9 20 LDA #32 1034 8099 8d 6d 01 STA power_upY 1035 809c a9 00 LDA #0 1036 809e 8d 6e 01 STA power_up_Flag 1037 80a1 .L0133 ;; p_bullet1x = 200 : p_bullet1y = - 10 : p_bullet2x = 200 : p_bullet2y = - 10 1038 80a1 1039 80a1 a9 00 LDA #0 1040 80a3 8d 50 01 STA var16 1041 80a6 a9 c8 LDA #200 1042 80a8 8d 48 01 STA p_bullet1x 1043 80ab a2 00 LDX #0 1044 80ad 8e 54 01 STX var20 1045 80b0 a9 f6 LDA #246 1046 80b2 8d 4c 01 STA p_bullet1y 1047 80b5 a9 00 LDA #0 1048 80b7 8d 51 01 STA var17 1049 80ba a9 c8 LDA #200 1050 80bc 8d 49 01 STA p_bullet2x 1051 80bf a2 00 LDX #0 1052 80c1 8e 55 01 STX var21 1053 80c4 a9 f6 LDA #246 1054 80c6 8d 4d 01 STA p_bullet2y 1055 80c9 .L0134 ;; p_bullet3x = 200 : p_bullet3y = - 10 : p_bullet4x = 200 : p_bullet4y = - 10 1056 80c9 1057 80c9 a9 00 LDA #0 1058 80cb 8d 52 01 STA var18 1059 80ce a9 c8 LDA #200 1060 80d0 8d 4a 01 STA p_bullet3x 1061 80d3 a2 00 LDX #0 1062 80d5 8e 56 01 STX var22 1063 80d8 a9 f6 LDA #246 1064 80da 8d 4e 01 STA p_bullet3y 1065 80dd a9 00 LDA #0 1066 80df 8d 53 01 STA var19 1067 80e2 a9 c8 LDA #200 1068 80e4 8d 4b 01 STA p_bullet4x 1069 80e7 a2 00 LDX #0 1070 80e9 8e 57 01 STX var23 1071 80ec a9 f6 LDA #246 1072 80ee 8d 4f 01 STA p_bullet4y 1073 80f1 .L0135 ;; p_twinlaser1_x = 200 : p_twinlaser1_y = - 10 : p_twinlaser2_x = 200 : p_twinlaser2_y = - 10 1074 80f1 1075 80f1 a9 00 LDA #0 1076 80f3 8d 89 01 STA var73 1077 80f6 a9 c8 LDA #200 1078 80f8 8d 81 01 STA p_twinlaser1_x 1079 80fb a2 00 LDX #0 1080 80fd 8e 8d 01 STX var77 1081 8100 a9 f6 LDA #246 1082 8102 8d 85 01 STA p_twinlaser1_y 1083 8105 a9 00 LDA #0 1084 8107 8d 8a 01 STA var74 1085 810a a9 c8 LDA #200 1086 810c 8d 82 01 STA p_twinlaser2_x 1087 810f a2 00 LDX #0 1088 8111 8e 8e 01 STX var78 1089 8114 a9 f6 LDA #246 1090 8116 8d 86 01 STA p_twinlaser2_y 1091 8119 .L0136 ;; p_twinlaser3_x = 200 : p_twinlaser3_y = - 10 : p_twinlaser4_x = 200 : p_twinlaser4_y = - 10 1092 8119 1093 8119 a9 00 LDA #0 1094 811b 8d 8b 01 STA var75 1095 811e a9 c8 LDA #200 1096 8120 8d 83 01 STA p_twinlaser3_x 1097 8123 a2 00 LDX #0 1098 8125 8e 8f 01 STX var79 1099 8128 a9 f6 LDA #246 1100 812a 8d 87 01 STA p_twinlaser3_y 1101 812d a9 00 LDA #0 1102 812f 8d 8c 01 STA var76 1103 8132 a9 c8 LDA #200 1104 8134 8d 84 01 STA p_twinlaser4_x 1105 8137 a2 00 LDX #0 1106 8139 8e 90 01 STX var80 1107 813c a9 f6 LDA #246 1108 813e 8d 88 01 STA p_twinlaser4_y 1109 8141 .L0137 ;; extra_shipX = 0 : extra_shipY = 0 : extra_shipFlag = 0 1110 8141 1111 8141 a9 00 LDA #0 1112 8143 8d 6f 01 STA extra_shipX 1113 8146 8d 70 01 STA extra_shipY 1114 8149 8d 71 01 STA extra_shipFlag 1115 814c .L0138 ;; max_bullets = 10 : twinlaser_flag = 0 1116 814c 1117 814c a9 0a LDA #10 1118 814e 8d 95 01 STA max_bullets 1119 8151 a9 00 LDA #0 1120 8153 8d 97 01 STA twinlaser_flag 1121 8156 .L0139 ;; lives = 3 1122 8156 1123 8156 a9 03 LDA #3 1124 8158 8d 73 01 STA lives 1125 815b . 1126 815b ;; 1127 815b 1128 815b .L0140 ;; gosub titlescreen 1129 815b 1130 815b 20 ce 8d jsr .titlescreen 1131 815e 1132 815e .L0141 ;; gosub initialise_gamescreen 1133 815e 1134 815e 20 db 8e jsr .initialise_gamescreen 1135 8161 1136 8161 . 1137 8161 ;; 1138 8161 1139 8161 .main 1140 8161 ;; main 1141 8161 1142 8161 .L0142 ;; frame_counter = frame_counter + 1 1143 8161 1144 8161 ad 40 01 LDA frame_counter 1145 8164 18 CLC 1146 8165 69 01 ADC #1 1147 8167 8d 40 01 STA frame_counter 1148 816a .L0143 ;; if frame_counter > 10 then frame_counter = 0 1149 816a 1150 816a a9 0a LDA #10 1151 816c cd 40 01 CMP frame_counter 1152 816f b0 05 BCS .skipL0143 1153 8171 .condpart0 1154 8171 a9 00 LDA #0 1155 8173 8d 40 01 STA frame_counter 1156 8176 .skipL0143 1157 8176 ._main_Loop 1158 8176 ;; _main_Loop 1159 8176 1160 8176 .L0144 ;; Timer = Timer - 1 1161 8176 1162 8176 ad 58 01 LDA Timer 1163 8179 38 SEC 1164 817a e9 01 SBC #1 1165 817c 8d 58 01 STA Timer 1166 817f .L0145 ;; if Timer = then gosub shoot_enemy_bullet : Timer = FIRINGRATE 1167 817f 1168 817f ; complex condition detected 1169 817f a9 00 LDA # 1170 8181 48 PHA 1171 8182 ba TSX 1172 8183 68 PLA 1173 8184 ad 58 01 LDA Timer 1174 8187 dd 01 01 CMP $101,x 1175 818a d0 08 BNE .skipL0145 1176 818c .condpart1 1177 818c 20 ef 8e jsr .shoot_enemy_bullet 1178 818f a9 0c LDA #FIRINGRATE 1179 8191 8d 58 01 STA Timer 1180 8194 .skipL0145 1181 8194 .L0146 ;; if switchreset then reboot 1182 8194 1183 8194 20 85 f4 jsr checkresetswitch 1184 8197 d0 03 BNE .skipL0146 1185 8199 .condpart2 1186 8199 4c 72 f5 JMP START 1187 819c .skipL0146 1188 819c . 1189 819c ;; 1190 819c 1191 819c .L0147 ;; rMovement_1 = ( rand & 4 ) 1192 819c 1193 819c ; complex statement detected 1194 819c 20 f0 f3 jsr randomize 1195 819f 29 04 AND #4 1196 81a1 8d 7e 01 STA rMovement_1 1197 81a4 .L0148 ;; rMovement_2 = ( rand & 5 ) + 2 1198 81a4 1199 81a4 ; complex statement detected 1200 81a4 20 f0 f3 jsr randomize 1201 81a7 29 05 AND #5 1202 81a9 18 CLC 1203 81aa 69 02 ADC #2 1204 81ac 8d 7f 01 STA rMovement_2 1205 81af .L0149 ;; rDirection = ( rand & 4 ) 1206 81af 1207 81af ; complex statement detected 1208 81af 20 f0 f3 jsr randomize 1209 81b2 29 04 AND #4 1210 81b4 8d 80 01 STA rDirection 1211 81b7 . 1212 81b7 ;; 1213 81b7 1214 81b7 .L0150 ;; if joy0up && joyposup = - 2 then gosub SetBulletHome 1215 81b7 1216 81b7 a9 10 lda #$10 1217 81b9 2c 80 02 bit SWCHA 1218 81bc d0 10 BNE .skipL0150 1219 81be .condpart3 1220 81be ; complex condition detected 1221 81be a9 fe LDA #254 1222 81c0 48 PHA 1223 81c1 ba TSX 1224 81c2 68 PLA 1225 81c3 ad 44 01 LDA joyposup 1226 81c6 dd 01 01 CMP $101,x 1227 81c9 d0 03 BNE .skip3then 1228 81cb .condpart4 1229 81cb 20 97 8b jsr .SetBulletHome 1230 81ce 1231 81ce .skip3then 1232 81ce .skipL0150 1233 81ce .L0151 ;; if joy0down && joyposdown = - 2 then gosub SetBulletHome 1234 81ce 1235 81ce a9 20 lda #$20 1236 81d0 2c 80 02 bit SWCHA 1237 81d3 d0 10 BNE .skipL0151 1238 81d5 .condpart5 1239 81d5 ; complex condition detected 1240 81d5 a9 fe LDA #254 1241 81d7 48 PHA 1242 81d8 ba TSX 1243 81d9 68 PLA 1244 81da ad 45 01 LDA joyposdown 1245 81dd dd 01 01 CMP $101,x 1246 81e0 d0 03 BNE .skip5then 1247 81e2 .condpart6 1248 81e2 20 97 8b jsr .SetBulletHome 1249 81e5 1250 81e5 .skip5then 1251 81e5 .skipL0151 1252 81e5 .L0152 ;; if joy0up && joyposleft = - 2 then gosub SetBulletHome 1253 81e5 1254 81e5 a9 10 lda #$10 1255 81e7 2c 80 02 bit SWCHA 1256 81ea d0 10 BNE .skipL0152 1257 81ec .condpart7 1258 81ec ; complex condition detected 1259 81ec a9 fe LDA #254 1260 81ee 48 PHA 1261 81ef ba TSX 1262 81f0 68 PLA 1263 81f1 ad 46 01 LDA joyposleft 1264 81f4 dd 01 01 CMP $101,x 1265 81f7 d0 03 BNE .skip7then 1266 81f9 .condpart8 1267 81f9 20 97 8b jsr .SetBulletHome 1268 81fc 1269 81fc .skip7then 1270 81fc .skipL0152 1271 81fc .L0153 ;; if joy0down && joyposright = - 2 then gosub SetBulletHome 1272 81fc 1273 81fc a9 20 lda #$20 1274 81fe 2c 80 02 bit SWCHA 1275 8201 d0 10 BNE .skipL0153 1276 8203 .condpart9 1277 8203 ; complex condition detected 1278 8203 a9 fe LDA #254 1279 8205 48 PHA 1280 8206 ba TSX 1281 8207 68 PLA 1282 8208 ad 47 01 LDA joyposright 1283 820b dd 01 01 CMP $101,x 1284 820e d0 03 BNE .skip9then 1285 8210 .condpart10 1286 8210 20 97 8b jsr .SetBulletHome 1287 8213 1288 8213 .skip9then 1289 8213 .skipL0153 1290 8213 .L0154 ;; if joy0up && joyposup = - 2 then gosub SetLaserHome 1291 8213 1292 8213 a9 10 lda #$10 1293 8215 2c 80 02 bit SWCHA 1294 8218 d0 10 BNE .skipL0154 1295 821a .condpart11 1296 821a ; complex condition detected 1297 821a a9 fe LDA #254 1298 821c 48 PHA 1299 821d ba TSX 1300 821e 68 PLA 1301 821f ad 44 01 LDA joyposup 1302 8222 dd 01 01 CMP $101,x 1303 8225 d0 03 BNE .skip11then 1304 8227 .condpart12 1305 8227 20 d1 8b jsr .SetLaserHome 1306 822a 1307 822a .skip11then 1308 822a .skipL0154 1309 822a .L0155 ;; if joy0down && joyposdown = - 2 then gosub SetLaserHome 1310 822a 1311 822a a9 20 lda #$20 1312 822c 2c 80 02 bit SWCHA 1313 822f d0 10 BNE .skipL0155 1314 8231 .condpart13 1315 8231 ; complex condition detected 1316 8231 a9 fe LDA #254 1317 8233 48 PHA 1318 8234 ba TSX 1319 8235 68 PLA 1320 8236 ad 45 01 LDA joyposdown 1321 8239 dd 01 01 CMP $101,x 1322 823c d0 03 BNE .skip13then 1323 823e .condpart14 1324 823e 20 d1 8b jsr .SetLaserHome 1325 8241 1326 8241 .skip13then 1327 8241 .skipL0155 1328 8241 .L0156 ;; if joy0up && joyposleft = - 2 then gosub SetLaserHome 1329 8241 1330 8241 a9 10 lda #$10 1331 8243 2c 80 02 bit SWCHA 1332 8246 d0 10 BNE .skipL0156 1333 8248 .condpart15 1334 8248 ; complex condition detected 1335 8248 a9 fe LDA #254 1336 824a 48 PHA 1337 824b ba TSX 1338 824c 68 PLA 1339 824d ad 46 01 LDA joyposleft 1340 8250 dd 01 01 CMP $101,x 1341 8253 d0 03 BNE .skip15then 1342 8255 .condpart16 1343 8255 20 d1 8b jsr .SetLaserHome 1344 8258 1345 8258 .skip15then 1346 8258 .skipL0156 1347 8258 .L0157 ;; if joy0down && joyposright = - 2 then gosub SetLaserHome 1348 8258 1349 8258 a9 20 lda #$20 1350 825a 2c 80 02 bit SWCHA 1351 825d d0 10 BNE .skipL0157 1352 825f .condpart17 1353 825f ; complex condition detected 1354 825f a9 fe LDA #254 1355 8261 48 PHA 1356 8262 ba TSX 1357 8263 68 PLA 1358 8264 ad 47 01 LDA joyposright 1359 8267 dd 01 01 CMP $101,x 1360 826a d0 03 BNE .skip17then 1361 826c .condpart18 1362 826c 20 d1 8b jsr .SetLaserHome 1363 826f 1364 826f .skip17then 1365 826f .skipL0157 1366 826f .L0158 ;; if joy0up then playerY = playerY - 1 : joyposup = 1 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 1367 826f 1368 826f a9 10 lda #$10 1369 8271 2c 80 02 bit SWCHA 1370 8274 d0 19 BNE .skipL0158 1371 8276 .condpart19 1372 8276 ad 42 01 LDA playerY 1373 8279 38 SEC 1374 827a e9 01 SBC #1 1375 827c 8d 42 01 STA playerY 1376 827f a9 01 LDA #1 1377 8281 8d 44 01 STA joyposup 1378 8284 a9 00 LDA #0 1379 8286 8d 45 01 STA joyposdown 1380 8289 8d 46 01 STA joyposleft 1381 828c 8d 47 01 STA joyposright 1382 828f .skipL0158 1383 828f .L0159 ;; if joy0down then playerY = playerY + 1 : joyposup = 0 : joyposdown = 1 : joyposleft = 0 : joyposright = 0 1384 828f 1385 828f a9 20 lda #$20 1386 8291 2c 80 02 bit SWCHA 1387 8294 d0 1b BNE .skipL0159 1388 8296 .condpart20 1389 8296 ad 42 01 LDA playerY 1390 8299 18 CLC 1391 829a 69 01 ADC #1 1392 829c 8d 42 01 STA playerY 1393 829f a9 00 LDA #0 1394 82a1 8d 44 01 STA joyposup 1395 82a4 a9 01 LDA #1 1396 82a6 8d 45 01 STA joyposdown 1397 82a9 a9 00 LDA #0 1398 82ab 8d 46 01 STA joyposleft 1399 82ae 8d 47 01 STA joyposright 1400 82b1 .skipL0159 1401 82b1 .L0160 ;; if joy0left then playerX = playerX - 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 1 : joyposright = 0 1402 82b1 1403 82b1 2c 80 02 bit SWCHA 1404 82b4 70 1b BVS .skipL0160 1405 82b6 .condpart21 1406 82b6 ad 41 01 LDA playerX 1407 82b9 38 SEC 1408 82ba e9 01 SBC #1 1409 82bc 8d 41 01 STA playerX 1410 82bf a9 00 LDA #0 1411 82c1 8d 44 01 STA joyposup 1412 82c4 8d 45 01 STA joyposdown 1413 82c7 a9 01 LDA #1 1414 82c9 8d 46 01 STA joyposleft 1415 82cc a9 00 LDA #0 1416 82ce 8d 47 01 STA joyposright 1417 82d1 .skipL0160 1418 82d1 .L0161 ;; if joy0right then playerX = playerX + 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 1 1419 82d1 1420 82d1 2c 80 02 bit SWCHA 1421 82d4 30 19 BMI .skipL0161 1422 82d6 .condpart22 1423 82d6 ad 41 01 LDA playerX 1424 82d9 18 CLC 1425 82da 69 01 ADC #1 1426 82dc 8d 41 01 STA playerX 1427 82df a9 00 LDA #0 1428 82e1 8d 44 01 STA joyposup 1429 82e4 8d 45 01 STA joyposdown 1430 82e7 8d 46 01 STA joyposleft 1431 82ea a9 01 LDA #1 1432 82ec 8d 47 01 STA joyposright 1433 82ef .skipL0161 1434 82ef . 1435 82ef ;; 1436 82ef 1437 82ef .L0162 ;; if joy0fire && joyposup = 1 && joyposdown = 1 && joyposleft = 1 && joyposright = 1 then p_bullet1y = p_bullet1y - 5 : p_bullet2y = p_bullet2y - 5 : p_bullet3y = p_bullet3y - 5 : p_bullet4y = p_bullet4y - 5 1438 82ef 1439 82ef 2c 02 21 bit sINPT1 1440 82f2 10 34 BPL .skipL0162 1441 82f4 .condpart23 1442 82f4 ad 44 01 LDA joyposup 1443 82f7 c9 01 CMP #1 1444 82f9 d0 2d BNE .skip23then 1445 82fb .condpart24 1446 82fb ad 45 01 LDA joyposdown 1447 82fe c9 01 CMP #1 1448 8300 d0 26 BNE .skip24then 1449 8302 .condpart25 1450 8302 ad 46 01 LDA joyposleft 1451 8305 c9 01 CMP #1 1452 8307 d0 1f BNE .skip25then 1453 8309 .condpart26 1454 8309 ad 47 01 LDA joyposright 1455 830c c9 01 CMP #1 1456 830e d0 18 BNE .skip26then 1457 8310 .condpart27 1458 8310 38 SEC 1459 8311 e9 05 SBC #5 1460 8313 8d 4c 01 STA p_bullet1y 1461 8316 38 SEC 1462 8317 e9 05 SBC #5 1463 8319 8d 4d 01 STA p_bullet2y 1464 831c 38 SEC 1465 831d e9 05 SBC #5 1466 831f 8d 4e 01 STA p_bullet3y 1467 8322 38 SEC 1468 8323 e9 05 SBC #5 1469 8325 8d 4f 01 STA p_bullet4y 1470 8328 .skip26then 1471 8328 .skip25then 1472 8328 .skip24then 1473 8328 .skip23then 1474 8328 .skipL0162 1475 8328 . 1476 8328 ;; 1477 8328 1478 8328 .L0163 ;; if playerX > 152 then playerX = playerX - 1 1479 8328 1480 8328 a9 98 LDA #152 1481 832a cd 41 01 CMP playerX 1482 832d b0 09 BCS .skipL0163 1483 832f .condpart28 1484 832f ad 41 01 LDA playerX 1485 8332 38 SEC 1486 8333 e9 01 SBC #1 1487 8335 8d 41 01 STA playerX 1488 8338 .skipL0163 1489 8338 .L0164 ;; if playerX < 1 then playerX = playerX + 1 1490 8338 1491 8338 ad 41 01 LDA playerX 1492 833b c9 01 CMP #1 1493 833d b0 09 BCS .skipL0164 1494 833f .condpart29 1495 833f ad 41 01 LDA playerX 1496 8342 18 CLC 1497 8343 69 01 ADC #1 1498 8345 8d 41 01 STA playerX 1499 8348 .skipL0164 1500 8348 .L0165 ;; if playerY > 177 then playerY = playerY - 1 1501 8348 1502 8348 a9 b1 LDA #177 1503 834a cd 42 01 CMP playerY 1504 834d b0 09 BCS .skipL0165 1505 834f .condpart30 1506 834f ad 42 01 LDA playerY 1507 8352 38 SEC 1508 8353 e9 01 SBC #1 1509 8355 8d 42 01 STA playerY 1510 8358 .skipL0165 1511 8358 .L0166 ;; if playerY < 1 then playerY = playerY + 1 1512 8358 1513 8358 ad 42 01 LDA playerY 1514 835b c9 01 CMP #1 1515 835d b0 09 BCS .skipL0166 1516 835f .condpart31 1517 835f ad 42 01 LDA playerY 1518 8362 18 CLC 1519 8363 69 01 ADC #1 1520 8365 8d 42 01 STA playerY 1521 8368 .skipL0166 1522 8368 . 1523 8368 ;; 1524 8368 1525 8368 .L0167 ;; gosub check_collisions 1526 8368 1527 8368 20 37 85 jsr .check_collisions 1528 836b 1529 836b .L0168 ;; if isDead_flag then goto lose_a_life 1530 836b 1531 836b ad 76 01 LDA isDead_flag 1532 836e f0 03 BEQ .skipL0168 1533 8370 .condpart32 1534 8370 4c 0b 8c jmp .lose_a_life 1535 8373 1536 8373 .skipL0168 1537 8373 . 1538 8373 ;; 1539 8373 1540 8373 .L0169 ;; if power_upX > 155 then power_upX = power_upX - 5 1541 8373 1542 8373 a9 9b LDA #155 1543 8375 cd 6c 01 CMP power_upX 1544 8378 b0 09 BCS .skipL0169 1545 837a .condpart33 1546 837a ad 6c 01 LDA power_upX 1547 837d 38 SEC 1548 837e e9 05 SBC #5 1549 8380 8d 6c 01 STA power_upX 1550 8383 .skipL0169 1551 8383 .L0170 ;; if power_upX < 1 then power_upX = power_upX + 5 1552 8383 1553 8383 ad 6c 01 LDA power_upX 1554 8386 c9 01 CMP #1 1555 8388 b0 09 BCS .skipL0170 1556 838a .condpart34 1557 838a ad 6c 01 LDA power_upX 1558 838d 18 CLC 1559 838e 69 05 ADC #5 1560 8390 8d 6c 01 STA power_upX 1561 8393 .skipL0170 1562 8393 .L0171 ;; if power_upY > 191 then power_upY = power_upY - 5 1563 8393 1564 8393 a9 bf LDA #191 1565 8395 cd 6d 01 CMP power_upY 1566 8398 b0 09 BCS .skipL0171 1567 839a .condpart35 1568 839a ad 6d 01 LDA power_upY 1569 839d 38 SEC 1570 839e e9 05 SBC #5 1571 83a0 8d 6d 01 STA power_upY 1572 83a3 .skipL0171 1573 83a3 .L0172 ;; if power_upY < 1 then power_upY = power_upY + 5 1574 83a3 1575 83a3 ad 6d 01 LDA power_upY 1576 83a6 c9 01 CMP #1 1577 83a8 b0 09 BCS .skipL0172 1578 83aa .condpart36 1579 83aa ad 6d 01 LDA power_upY 1580 83ad 18 CLC 1581 83ae 69 05 ADC #5 1582 83b0 8d 6d 01 STA power_upY 1583 83b3 .skipL0172 1584 83b3 .L0173 ;; if enemy01_xpos > 160 then enemy01_xpos = enemy01_xpos - 1 1585 83b3 1586 83b3 a9 a0 LDA #160 1587 83b5 cd 59 01 CMP enemy01_xpos 1588 83b8 b0 09 BCS .skipL0173 1589 83ba .condpart37 1590 83ba ad 59 01 LDA enemy01_xpos 1591 83bd 38 SEC 1592 83be e9 01 SBC #1 1593 83c0 8d 59 01 STA enemy01_xpos 1594 83c3 .skipL0173 1595 83c3 .L0174 ;; if enemy01_xpos < 1 then enemy01_xpos = enemy01_xpos + 1 1596 83c3 1597 83c3 ad 59 01 LDA enemy01_xpos 1598 83c6 c9 01 CMP #1 1599 83c8 b0 09 BCS .skipL0174 1600 83ca .condpart38 1601 83ca ad 59 01 LDA enemy01_xpos 1602 83cd 18 CLC 1603 83ce 69 01 ADC #1 1604 83d0 8d 59 01 STA enemy01_xpos 1605 83d3 .skipL0174 1606 83d3 .L0175 ;; if enemy01_ypos > 220 then enemy01_ypos = enemy01_ypos - 1 1607 83d3 1608 83d3 a9 dc LDA #220 1609 83d5 cd 5a 01 CMP enemy01_ypos 1610 83d8 b0 09 BCS .skipL0175 1611 83da .condpart39 1612 83da ad 5a 01 LDA enemy01_ypos 1613 83dd 38 SEC 1614 83de e9 01 SBC #1 1615 83e0 8d 5a 01 STA enemy01_ypos 1616 83e3 .skipL0175 1617 83e3 .L0176 ;; if enemy01_ypos < - 16 then enemy01_ypos = enemy01_ypos + 1 1618 83e3 1619 83e3 ; complex condition detected 1620 83e3 a9 f0 LDA #240 1621 83e5 48 PHA 1622 83e6 ba TSX 1623 83e7 68 PLA 1624 83e8 ad 5a 01 LDA enemy01_ypos 1625 83eb dd 01 01 CMP $101,x 1626 83ee b0 09 BCS .skipL0176 1627 83f0 .condpart40 1628 83f0 ad 5a 01 LDA enemy01_ypos 1629 83f3 18 CLC 1630 83f4 69 01 ADC #1 1631 83f6 8d 5a 01 STA enemy01_ypos 1632 83f9 .skipL0176 1633 83f9 .L0177 ;; if extra_shipX > 160 then extra_shipX = extra_shipX - 1 1634 83f9 1635 83f9 a9 a0 LDA #160 1636 83fb cd 6f 01 CMP extra_shipX 1637 83fe b0 09 BCS .skipL0177 1638 8400 .condpart41 1639 8400 ad 6f 01 LDA extra_shipX 1640 8403 38 SEC 1641 8404 e9 01 SBC #1 1642 8406 8d 6f 01 STA extra_shipX 1643 8409 .skipL0177 1644 8409 .L0178 ;; if extra_shipX < 1 then extra_shipX = extra_shipX + 1 1645 8409 1646 8409 ad 6f 01 LDA extra_shipX 1647 840c c9 01 CMP #1 1648 840e b0 09 BCS .skipL0178 1649 8410 .condpart42 1650 8410 ad 6f 01 LDA extra_shipX 1651 8413 18 CLC 1652 8414 69 01 ADC #1 1653 8416 8d 6f 01 STA extra_shipX 1654 8419 .skipL0178 1655 8419 .L0179 ;; if extra_shipY > 191 then extra_shipY = extra_shipY - 1 1656 8419 1657 8419 a9 bf LDA #191 1658 841b cd 70 01 CMP extra_shipY 1659 841e b0 09 BCS .skipL0179 1660 8420 .condpart43 1661 8420 ad 70 01 LDA extra_shipY 1662 8423 38 SEC 1663 8424 e9 01 SBC #1 1664 8426 8d 70 01 STA extra_shipY 1665 8429 .skipL0179 1666 8429 .L0180 ;; if extra_shipY < 1 then extra_shipY = extra_shipY + 1 1667 8429 1668 8429 ad 70 01 LDA extra_shipY 1669 842c c9 01 CMP #1 1670 842e b0 09 BCS .skipL0180 1671 8430 .condpart44 1672 8430 ad 70 01 LDA extra_shipY 1673 8433 18 CLC 1674 8434 69 01 ADC #1 1675 8436 8d 70 01 STA extra_shipY 1676 8439 .skipL0180 1677 8439 . 1678 8439 ;; 1679 8439 1680 8439 . 1681 8439 ;; 1682 8439 1683 8439 .L0181 ;; z = 15 1684 8439 1685 8439 a9 0f LDA #15 1686 843b 85 ff STA z 1687 843d .despawn_Check 1688 843d ;; despawn_Check 1689 843d 1690 843d .L0182 ;; if enemy_shot_xpos[z] > 160 || enemy_shot_ypos[z] > 192 then enemy_shot_active[z] = FALSE 1691 843d 1692 843d a9 a0 LDA #160 1693 843f a6 ff LDX z 1694 8441 d5 e6 CMP enemy_shot_xpos,x 1695 8443 b0 03 BCS .skipL0182 1696 8445 .condpart45 1697 8445 4c 50 84 jmp .condpart46 1698 8448 .skipL0182 1699 8448 a9 c0 LDA #192 1700 844a a6 ff LDX z 1701 844c d5 e8 CMP enemy_shot_ypos,x 1702 844e b0 06 BCS .skip12OR 1703 8450 .condpart46 1704 8450 a9 00 LDA #FALSE 1705 8452 a6 ff LDX z 1706 8454 95 ee STA enemy_shot_active,x 1707 8456 .skip12OR 1708 8456 .L0183 ;; z = z - 1 1709 8456 1710 8456 a5 ff LDA z 1711 8458 38 SEC 1712 8459 e9 01 SBC #1 1713 845b 85 ff STA z 1714 845d .L0184 ;; if z < 15 then goto despawn_Check 1715 845d 1716 845d a5 ff LDA z 1717 845f c9 0f CMP #15 1718 8461 b0 03 BCS .skipL0184 1719 8463 .condpart47 1720 8463 4c 3d 84 jmp .despawn_Check 1721 8466 1722 8466 .skipL0184 1723 8466 . 1724 8466 ;; 1725 8466 1726 8466 .L0185 ;; z = 15 1727 8466 1728 8466 a9 0f LDA #15 1729 8468 85 ff STA z 1730 846a .plot_Bullet 1731 846a ;; plot_Bullet 1732 846a 1733 846a .L0186 ;; x = enemy_shot_xpos[z] 1734 846a 1735 846a a6 ff LDX z 1736 846c b5 e6 LDA enemy_shot_xpos,x 1737 846e 85 fd STA x 1738 8470 .L0187 ;; y = enemy_shot_ypos[z] 1739 8470 1740 8470 a6 ff LDX z 1741 8472 b5 e8 LDA enemy_shot_ypos,x 1742 8474 85 fe STA y 1743 8476 .L0188 ;; if enemy_shot_active = TRUE then plotsprite vertical_shooting_enemyshot 2 x y 1744 8476 1745 8476 a5 ee LDA enemy_shot_active 1746 8478 c9 01 CMP #TRUE 1747 847a d0 1b BNE .skipL0188 1748 847c .condpart48 1749 847c a9 32 lda #vertical_shooting_enemyshot 1753 8482 85 43 sta temp2 1754 8484 1755 8484 a9 5f lda #(64|vertical_shooting_enemyshot_width_twoscompliment) 1756 8486 85 44 sta temp3 1757 8488 1758 8488 a5 fd lda x 1759 848a 85 45 sta temp4 1760 848c 1761 848c a5 fe lda y 1762 848e 1763 848e 85 46 sta temp5 1764 8490 1765 8490 a9 40 lda #(vertical_shooting_enemyshot_mode|%01000000) 1766 8492 85 47 sta temp6 1767 8494 1768 8494 20 93 f2 jsr plotsprite 1769 8497 .skipL0188 1770 8497 .L0189 ;; z = z - 1 1771 8497 1772 8497 a5 ff LDA z 1773 8499 38 SEC 1774 849a e9 01 SBC #1 1775 849c 85 ff STA z 1776 849e .L0190 ;; if z < 15 then goto plot_Bullet 1777 849e 1778 849e a5 ff LDA z 1779 84a0 c9 0f CMP #15 1780 84a2 b0 03 BCS .skipL0190 1781 84a4 .condpart49 1782 84a4 4c 6a 84 jmp .plot_Bullet 1783 84a7 1784 84a7 .skipL0190 1785 84a7 . 1786 84a7 ;; 1787 84a7 1788 84a7 .L0191 ;; restorescreen 1789 84a7 1790 84a7 20 91 f0 jsr restorescreen 1791 84aa .L0192 ;; gosub _draw_player_bullets 1792 84aa 1793 84aa 20 14 8b jsr ._draw_player_bullets 1794 84ad 1795 84ad .L0193 ;; gosub draw_sprites 1796 84ad 1797 84ad 20 c0 90 jsr .draw_sprites 1798 84b0 1799 84b0 .L0194 ;; gosub draw_scores 1800 84b0 1801 84b0 20 c5 84 jsr .draw_scores 1802 84b3 1803 84b3 .L0195 ;; gosub check_fire_button 1804 84b3 1805 84b3 20 a7 89 jsr .check_fire_button 1806 84b6 1807 84b6 .L0196 ;; gosub move_player_bullets 1808 84b6 1809 84b6 20 4a 8a jsr .move_player_bullets 1810 84b9 1811 84b9 .L0197 ;; gosub check_bullet_time 1812 84b9 1813 84b9 20 88 8a jsr .check_bullet_time 1814 84bc 1815 84bc .L0198 ;; gosub check_bullet_boundary 1816 84bc 1817 84bc 20 be 8a jsr .check_bullet_boundary 1818 84bf 1819 84bf . 1820 84bf ;; 1821 84bf 1822 84bf .L0199 ;; drawscreen 1823 84bf 1824 84bf 20 b3 f0 jsr drawscreen 1825 84c2 .L0200 ;; goto _main_Loop 1826 84c2 1827 84c2 4c 76 81 jmp ._main_Loop 1828 84c5 1829 84c5 . 1830 84c5 ;; 1831 84c5 1832 84c5 . 1833 84c5 ;; 1834 84c5 1835 84c5 .draw_scores 1836 84c5 ;; draw_scores 1837 84c5 1838 84c5 .L0201 ;; plotvalue vertical_shooting_font 0 score0 6 25 1 1839 84c5 1840 84c5 a9 00 lda #vertical_shooting_font 1844 84cb 85 43 sta temp2 1845 84cd 1846 84cd ad 06 21 lda charactermode 1847 84d0 85 4a sta temp9 1848 84d2 a9 60 lda #(vertical_shooting_font_mode | %01100000) 1849 84d4 8d 06 21 sta charactermode 1850 84d7 a9 1a lda #26 ; width in two's complement 1851 84d9 09 00 ora #0 ; palette left shifted 5 bits 1852 84db 85 44 sta temp3 1853 84dd a9 19 lda #25 1854 84df 85 45 sta temp4 1855 84e1 1856 84e1 a9 01 lda #1 1857 84e3 85 46 sta temp5 1858 84e5 1859 84e5 a9 06 lda #6 1860 84e7 85 47 sta temp6 1861 84e9 1862 84e9 a9 a6 lda #score0 1866 84ef 85 49 sta temp8 1867 84f1 1868 84f1 20 81 f3 jsr plotvalue 1869 84f1 00 01 USED_PLOTVALUE = 1 1870 84f4 a5 4a lda temp9 1871 84f6 8d 06 21 sta charactermode 1872 84f9 .L0202 ;; plotvalue vertical_shooting_font 0 lives 1 153 1 1873 84f9 1874 84f9 a9 00 lda #vertical_shooting_font 1878 84ff 85 43 sta temp2 1879 8501 1880 8501 ad 06 21 lda charactermode 1881 8504 85 4a sta temp9 1882 8506 a9 60 lda #(vertical_shooting_font_mode | %01100000) 1883 8508 8d 06 21 sta charactermode 1884 850b a9 1f lda #31 ; width in two's complement 1885 850d 09 00 ora #0 ; palette left shifted 5 bits 1886 850f 85 44 sta temp3 1887 8511 a9 99 lda #153 1888 8513 85 45 sta temp4 1889 8515 1890 8515 a9 01 lda #1 1891 8517 85 46 sta temp5 1892 8519 1893 8519 a9 01 lda #1 1894 851b 85 47 sta temp6 1895 851d 1896 851d a9 73 lda #lives 1900 8523 85 49 sta temp8 1901 8525 1902 8525 20 81 f3 jsr plotvalue 1903 8525 00 01 USED_PLOTVALUE = 1 1904 8528 a5 4a lda temp9 1905 852a 8d 06 21 sta charactermode 1906 852d .L0203 ;; return 1907 852d 1908 852d ba tsx 1909 852e bd 02 01 lda $102,x 1910 8531 f0 01 beq bankswitchret1 1911 8533 60 RTS 1912 8534 bankswitchret1 1913 8534 4c 72 f4 JMP BS_return 1914 8537 . 1915 8537 ;; 1916 8537 1917 8537 .check_collisions 1918 8537 ;; check_collisions 1919 8537 1920 8537 .L0204 ;; customTemp1 = enemy01_xpos + 16 1921 8537 1922 8537 ad 59 01 LDA enemy01_xpos 1923 853a 18 CLC 1924 853b 69 10 ADC #16 1925 853d 8d 99 01 STA customTemp1 1926 8540 .L0205 ;; customTemp2 = enemy01_ypos + 16 1927 8540 1928 8540 ad 5a 01 LDA enemy01_ypos 1929 8543 18 CLC 1930 8544 69 10 ADC #16 1931 8546 8d 9a 01 STA customTemp2 1932 8549 .L0206 ;; if boxcollision ( playerX , playerY , 8 , 16 , enemy_shot_xpos , enemy_shot_ypos , 4 , 8 ) then enemy_shot_xpos = 200 : enemy_shot_ypos = 200 : player_Flag = 1 : lives = lives - 0 : playsfx sfx_explosion : isDead_flag = 1 : goto _checkCollisionsExit 1933 8549 1934 8549 1935 8549 18 clc ; one clc only. If we overflow we're screwed anyway. 1936 854a a0 07 ldy #(8-1) 1937 854c 84 44 sty temp3 1938 854e a0 0f ldy #(16-1) 1939 8550 84 45 sty temp4 1940 8552 a5 e6 lda enemy_shot_xpos 1941 8554 69 30 adc #48 1942 8556 85 46 sta temp5 1943 8558 a5 e8 lda enemy_shot_ypos 1944 855a 69 20 adc #((256-WSCREENHEIGHT)/2) 1945 855c 85 47 sta temp6 1946 855e a0 03 ldy #(4-1) 1947 8560 84 48 sty temp7 1948 8562 a0 07 ldy #(8-1) 1949 8564 84 49 sty temp8 1950 8566 ad 42 01 lda playerY 1951 8569 69 20 adc #((256-WSCREENHEIGHT)/2) 1952 856b a8 tay 1953 856c ad 41 01 lda playerX 1954 856f 69 30 adc #48 1955 8571 20 c9 f3 jsr boxcollision 1956 8574 1957 8574 90 35 BCC .skipL0206 1958 8576 .condpart50 1959 8576 a9 c8 LDA #200 1960 8578 85 e6 STA enemy_shot_xpos 1961 857a 85 e8 STA enemy_shot_ypos 1962 857c a9 01 LDA #1 1963 857e 8d 5b 01 STA player_Flag 1964 8581 ad 73 01 LDA lives 1965 8584 38 SEC 1966 8585 e9 00 SBC #0 1967 8587 8d 73 01 STA lives 1968 858a ifnconst NOTIALOCKMUTE 1969 858a a9 01 lda #1 1970 858c 85 de sta sfxschedulelock 1971 858e a9 5c lda #sfx_explosion 1974 8594 85 e1 sta sfxinstrumenthi 1975 8596 a9 00 lda #0 1976 8598 85 e2 sta sfxpitchoffset ; no pitch modification 1977 859a 85 e3 sta sfxnoteindex ; not a musical note 1978 859c 20 4b f2 jsr schedulesfx 1979 859f a9 00 lda #0 1980 85a1 85 de sta sfxschedulelock 1981 85a3 endif ; NOTIALOCKMUTE 1982 85a3 a9 01 LDA #1 1983 85a5 8d 76 01 STA isDead_flag 1984 85a8 4c 93 89 jmp ._checkCollisionsExit 1985 85ab 1986 85ab .skipL0206 1987 85ab .L0207 ;; if boxcollision ( playerX , playerY , 8 , 16 , power_upX , power_upY , 8 , 8 ) then power_upX = 208 : power_upY = 208 : player_Flag = 1 : power_up_Flag = 1 : playsfx sfx_bling : score0 = score0 + 1 : gosub power_up_obtained 1988 85ab 1989 85ab 1990 85ab 18 clc ; one clc only. If we overflow we're screwed anyway. 1991 85ac a0 07 ldy #(8-1) 1992 85ae 84 44 sty temp3 1993 85b0 a0 0f ldy #(16-1) 1994 85b2 84 45 sty temp4 1995 85b4 ad 6c 01 lda power_upX 1996 85b7 69 30 adc #48 1997 85b9 85 46 sta temp5 1998 85bb ad 6d 01 lda power_upY 1999 85be 69 20 adc #((256-WSCREENHEIGHT)/2) 2000 85c0 85 47 sta temp6 2001 85c2 a0 07 ldy #(8-1) 2002 85c4 84 48 sty temp7 2003 85c6 a0 07 ldy #(8-1) 2004 85c8 84 49 sty temp8 2005 85ca ad 42 01 lda playerY 2006 85cd 69 20 adc #((256-WSCREENHEIGHT)/2) 2007 85cf a8 tay 2008 85d0 ad 41 01 lda playerX 2009 85d3 69 30 adc #48 2010 85d5 20 c9 f3 jsr boxcollision 2011 85d8 2012 85d8 90 47 BCC .skipL0207 2013 85da .condpart51 2014 85da a9 d0 LDA #208 2015 85dc 8d 6c 01 STA power_upX 2016 85df 8d 6d 01 STA power_upY 2017 85e2 a9 01 LDA #1 2018 85e4 8d 5b 01 STA player_Flag 2019 85e7 8d 6e 01 STA power_up_Flag 2020 85ea ifnconst NOTIALOCKMUTE 2021 85ea a9 01 lda #1 2022 85ec 85 de sta sfxschedulelock 2023 85ee a9 99 lda #sfx_bling 2026 85f4 85 e1 sta sfxinstrumenthi 2027 85f6 a9 00 lda #0 2028 85f8 85 e2 sta sfxpitchoffset ; no pitch modification 2029 85fa 85 e3 sta sfxnoteindex ; not a musical note 2030 85fc 20 4b f2 jsr schedulesfx 2031 85ff a9 00 lda #0 2032 8601 85 de sta sfxschedulelock 2033 8603 endif ; NOTIALOCKMUTE 2034 8603 f8 SED 2035 8604 18 CLC 2036 8605 ad a8 01 LDA score0+2 2037 8608 69 01 ADC #$01 2038 860a 8d a8 01 STA score0+2 2039 860d ad a7 01 LDA score0+1 2040 8610 69 00 ADC #$00 2041 8612 8d a7 01 STA score0+1 2042 8615 ad a6 01 LDA score0 2043 8618 69 00 ADC #$00 2044 861a 8d a6 01 STA score0 2045 861d d8 CLD 2046 861e 20 aa 90 jsr .power_up_obtained 2047 8621 2048 8621 .skipL0207 2049 8621 .L0208 ;; if boxcollision ( playerX , playerY , 8 , 16 , enemy01_xpos , enemy01_ypos , 8 , 16 ) then enemy01_xpos = 200 : enemy01_ypos = 200 : player_Flag = 1 : lives = lives - 0 : playsfx sfx_explosion : isDead_flag = 1 : goto _checkCollisionsExit 2050 8621 2051 8621 2052 8621 18 clc ; one clc only. If we overflow we're screwed anyway. 2053 8622 a0 07 ldy #(8-1) 2054 8624 84 44 sty temp3 2055 8626 a0 0f ldy #(16-1) 2056 8628 84 45 sty temp4 2057 862a ad 59 01 lda enemy01_xpos 2058 862d 69 30 adc #48 2059 862f 85 46 sta temp5 2060 8631 ad 5a 01 lda enemy01_ypos 2061 8634 69 20 adc #((256-WSCREENHEIGHT)/2) 2062 8636 85 47 sta temp6 2063 8638 a0 07 ldy #(8-1) 2064 863a 84 48 sty temp7 2065 863c a0 0f ldy #(16-1) 2066 863e 84 49 sty temp8 2067 8640 ad 42 01 lda playerY 2068 8643 69 20 adc #((256-WSCREENHEIGHT)/2) 2069 8645 a8 tay 2070 8646 ad 41 01 lda playerX 2071 8649 69 30 adc #48 2072 864b 20 c9 f3 jsr boxcollision 2073 864e 2074 864e 90 37 BCC .skipL0208 2075 8650 .condpart52 2076 8650 a9 c8 LDA #200 2077 8652 8d 59 01 STA enemy01_xpos 2078 8655 8d 5a 01 STA enemy01_ypos 2079 8658 a9 01 LDA #1 2080 865a 8d 5b 01 STA player_Flag 2081 865d ad 73 01 LDA lives 2082 8660 38 SEC 2083 8661 e9 00 SBC #0 2084 8663 8d 73 01 STA lives 2085 8666 ifnconst NOTIALOCKMUTE 2086 8666 a9 01 lda #1 2087 8668 85 de sta sfxschedulelock 2088 866a a9 5c lda #sfx_explosion 2091 8670 85 e1 sta sfxinstrumenthi 2092 8672 a9 00 lda #0 2093 8674 85 e2 sta sfxpitchoffset ; no pitch modification 2094 8676 85 e3 sta sfxnoteindex ; not a musical note 2095 8678 20 4b f2 jsr schedulesfx 2096 867b a9 00 lda #0 2097 867d 85 de sta sfxschedulelock 2098 867f endif ; NOTIALOCKMUTE 2099 867f a9 01 LDA #1 2100 8681 8d 76 01 STA isDead_flag 2101 8684 4c 93 89 jmp ._checkCollisionsExit 2102 8687 2103 8687 .skipL0208 2104 8687 .L0209 ;; 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 2105 8687 2106 8687 2107 8687 18 clc ; one clc only. If we overflow we're screwed anyway. 2108 8688 a0 07 ldy #(8-1) 2109 868a 84 44 sty temp3 2110 868c a0 0f ldy #(16-1) 2111 868e 84 45 sty temp4 2112 8690 ad 6f 01 lda extra_shipX 2113 8693 69 30 adc #48 2114 8695 85 46 sta temp5 2115 8697 ad 70 01 lda extra_shipY 2116 869a 69 20 adc #((256-WSCREENHEIGHT)/2) 2117 869c 85 47 sta temp6 2118 869e a0 07 ldy #(8-1) 2119 86a0 84 48 sty temp7 2120 86a2 a0 07 ldy #(8-1) 2121 86a4 84 49 sty temp8 2122 86a6 ad 42 01 lda playerY 2123 86a9 69 20 adc #((256-WSCREENHEIGHT)/2) 2124 86ab a8 tay 2125 86ac ad 41 01 lda playerX 2126 86af 69 30 adc #48 2127 86b1 20 c9 f3 jsr boxcollision 2128 86b4 2129 86b4 90 2f BCC .skipL0209 2130 86b6 .condpart53 2131 86b6 a9 c8 LDA #200 2132 86b8 8d 6f 01 STA extra_shipX 2133 86bb 8d 70 01 STA extra_shipY 2134 86be a9 01 LDA #1 2135 86c0 8d 71 01 STA extra_shipFlag 2136 86c3 ad 73 01 LDA lives 2137 86c6 18 CLC 2138 86c7 69 01 ADC #1 2139 86c9 8d 73 01 STA lives 2140 86cc ifnconst NOTIALOCKMUTE 2141 86cc a9 01 lda #1 2142 86ce 85 de sta sfxschedulelock 2143 86d0 a9 99 lda #sfx_bling 2146 86d6 85 e1 sta sfxinstrumenthi 2147 86d8 a9 00 lda #0 2148 86da 85 e2 sta sfxpitchoffset ; no pitch modification 2149 86dc 85 e3 sta sfxnoteindex ; not a musical note 2150 86de 20 4b f2 jsr schedulesfx 2151 86e1 a9 00 lda #0 2152 86e3 85 de sta sfxschedulelock 2153 86e5 endif ; NOTIALOCKMUTE 2154 86e5 .skipL0209 2155 86e5 .L0210 ;; if boxcollision ( p_bullet1x , p_bullet1y , 4 , 8 , enemy01_xpos , enemy01_ypos , 8 , 16 ) then p_bullet1x = - 8 : p_bullet1y = 0 : enemy01_xpos = 208 : enemy01_ypos = 200 : enemy01_Flag = 1 : playsfx sfx_explosion 2156 86e5 2157 86e5 2158 86e5 18 clc ; one clc only. If we overflow we're screwed anyway. 2159 86e6 a0 03 ldy #(4-1) 2160 86e8 84 44 sty temp3 2161 86ea a0 07 ldy #(8-1) 2162 86ec 84 45 sty temp4 2163 86ee ad 59 01 lda enemy01_xpos 2164 86f1 69 30 adc #48 2165 86f3 85 46 sta temp5 2166 86f5 ad 5a 01 lda enemy01_ypos 2167 86f8 69 20 adc #((256-WSCREENHEIGHT)/2) 2168 86fa 85 47 sta temp6 2169 86fc a0 07 ldy #(8-1) 2170 86fe 84 48 sty temp7 2171 8700 a0 0f ldy #(16-1) 2172 8702 84 49 sty temp8 2173 8704 ad 4c 01 lda p_bullet1y 2174 8707 69 20 adc #((256-WSCREENHEIGHT)/2) 2175 8709 a8 tay 2176 870a ad 48 01 lda p_bullet1x 2177 870d 69 30 adc #48 2178 870f 20 c9 f3 jsr boxcollision 2179 8712 2180 8712 90 3c BCC .skipL0210 2181 8714 .condpart54 2182 8714 a2 00 LDX #0 2183 8716 8e 50 01 STX var16 2184 8719 a9 f8 LDA #248 2185 871b 8d 48 01 STA p_bullet1x 2186 871e a9 00 LDA #0 2187 8720 8d 54 01 STA var20 2188 8723 a9 00 LDA #0 2189 8725 8d 4c 01 STA p_bullet1y 2190 8728 a9 d0 LDA #208 2191 872a 8d 59 01 STA enemy01_xpos 2192 872d a9 c8 LDA #200 2193 872f 8d 5a 01 STA enemy01_ypos 2194 8732 a9 01 LDA #1 2195 8734 8d 5c 01 STA enemy01_Flag 2196 8737 ifnconst NOTIALOCKMUTE 2197 8737 a9 01 lda #1 2198 8739 85 de sta sfxschedulelock 2199 873b a9 5c lda #sfx_explosion 2202 8741 85 e1 sta sfxinstrumenthi 2203 8743 a9 00 lda #0 2204 8745 85 e2 sta sfxpitchoffset ; no pitch modification 2205 8747 85 e3 sta sfxnoteindex ; not a musical note 2206 8749 20 4b f2 jsr schedulesfx 2207 874c a9 00 lda #0 2208 874e 85 de sta sfxschedulelock 2209 8750 endif ; NOTIALOCKMUTE 2210 8750 .skipL0210 2211 8750 .L0211 ;; if boxcollision ( p_twinlaser1_x , p_twinlaser1_y , 4 , 16 , enemy01_xpos , enemy01_ypos , 8 , 16 ) then p_twinlaser1_x = - 8 : p_twinlaser1_y = 0 : enemy01_xpos = 208 : enemy01_ypos = 200 : enemy01_Flag = 1 : playsfx sfx_explosion 2212 8750 2213 8750 2214 8750 18 clc ; one clc only. If we overflow we're screwed anyway. 2215 8751 a0 03 ldy #(4-1) 2216 8753 84 44 sty temp3 2217 8755 a0 0f ldy #(16-1) 2218 8757 84 45 sty temp4 2219 8759 ad 59 01 lda enemy01_xpos 2220 875c 69 30 adc #48 2221 875e 85 46 sta temp5 2222 8760 ad 5a 01 lda enemy01_ypos 2223 8763 69 20 adc #((256-WSCREENHEIGHT)/2) 2224 8765 85 47 sta temp6 2225 8767 a0 07 ldy #(8-1) 2226 8769 84 48 sty temp7 2227 876b a0 0f ldy #(16-1) 2228 876d 84 49 sty temp8 2229 876f ad 85 01 lda p_twinlaser1_y 2230 8772 69 20 adc #((256-WSCREENHEIGHT)/2) 2231 8774 a8 tay 2232 8775 ad 81 01 lda p_twinlaser1_x 2233 8778 69 30 adc #48 2234 877a 20 c9 f3 jsr boxcollision 2235 877d 2236 877d 90 3c BCC .skipL0211 2237 877f .condpart55 2238 877f a2 00 LDX #0 2239 8781 8e 89 01 STX var73 2240 8784 a9 f8 LDA #248 2241 8786 8d 81 01 STA p_twinlaser1_x 2242 8789 a9 00 LDA #0 2243 878b 8d 8d 01 STA var77 2244 878e a9 00 LDA #0 2245 8790 8d 85 01 STA p_twinlaser1_y 2246 8793 a9 d0 LDA #208 2247 8795 8d 59 01 STA enemy01_xpos 2248 8798 a9 c8 LDA #200 2249 879a 8d 5a 01 STA enemy01_ypos 2250 879d a9 01 LDA #1 2251 879f 8d 5c 01 STA enemy01_Flag 2252 87a2 ifnconst NOTIALOCKMUTE 2253 87a2 a9 01 lda #1 2254 87a4 85 de sta sfxschedulelock 2255 87a6 a9 5c lda #sfx_explosion 2258 87ac 85 e1 sta sfxinstrumenthi 2259 87ae a9 00 lda #0 2260 87b0 85 e2 sta sfxpitchoffset ; no pitch modification 2261 87b2 85 e3 sta sfxnoteindex ; not a musical note 2262 87b4 20 4b f2 jsr schedulesfx 2263 87b7 a9 00 lda #0 2264 87b9 85 de sta sfxschedulelock 2265 87bb endif ; NOTIALOCKMUTE 2266 87bb .skipL0211 2267 87bb .L0212 ;; if p_bullet1x > enemy01_xpos && p_bullet1x < customTemp1 && p_bullet1y > enemy01_ypos && p_bullet1y < customTemp2 then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion : goto collisions_done 2268 87bb 2269 87bb ad 59 01 LDA enemy01_xpos 2270 87be cd 48 01 CMP p_bullet1x 2271 87c1 b0 57 BCS .skipL0212 2272 87c3 .condpart56 2273 87c3 ad 48 01 LDA p_bullet1x 2274 87c6 cd 99 01 CMP customTemp1 2275 87c9 b0 4f BCS .skip56then 2276 87cb .condpart57 2277 87cb ad 5a 01 LDA enemy01_ypos 2278 87ce cd 4c 01 CMP p_bullet1y 2279 87d1 b0 47 BCS .skip57then 2280 87d3 .condpart58 2281 87d3 ad 4c 01 LDA p_bullet1y 2282 87d6 cd 9a 01 CMP customTemp2 2283 87d9 b0 3f BCS .skip58then 2284 87db .condpart59 2285 87db a9 01 LDA #1 2286 87dd 8d 5c 01 STA enemy01_Flag 2287 87e0 8d 72 01 STA explosion_aniframe 2288 87e3 f8 SED 2289 87e4 18 CLC 2290 87e5 ad a8 01 LDA score0+2 2291 87e8 69 01 ADC #$01 2292 87ea 8d a8 01 STA score0+2 2293 87ed ad a7 01 LDA score0+1 2294 87f0 69 00 ADC #$00 2295 87f2 8d a7 01 STA score0+1 2296 87f5 ad a6 01 LDA score0 2297 87f8 69 00 ADC #$00 2298 87fa 8d a6 01 STA score0 2299 87fd d8 CLD 2300 87fe ifnconst NOTIALOCKMUTE 2301 87fe a9 01 lda #1 2302 8800 85 de sta sfxschedulelock 2303 8802 a9 5c lda #sfx_explosion 2306 8808 85 e1 sta sfxinstrumenthi 2307 880a a9 00 lda #0 2308 880c 85 e2 sta sfxpitchoffset ; no pitch modification 2309 880e 85 e3 sta sfxnoteindex ; not a musical note 2310 8810 20 4b f2 jsr schedulesfx 2311 8813 a9 00 lda #0 2312 8815 85 de sta sfxschedulelock 2313 8817 endif ; NOTIALOCKMUTE 2314 8817 4c 9d 89 jmp .collisions_done 2315 881a 2316 881a .skip58then 2317 881a .skip57then 2318 881a .skip56then 2319 881a .skipL0212 2320 881a .L0213 ;; if p_bullet2x > enemy01_xpos && p_bullet2x < customTemp1 && p_bullet2y > enemy01_ypos && p_bullet2y < customTemp2 then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion : goto collisions_done 2321 881a 2322 881a ad 59 01 LDA enemy01_xpos 2323 881d cd 49 01 CMP p_bullet2x 2324 8820 b0 57 BCS .skipL0213 2325 8822 .condpart60 2326 8822 ad 49 01 LDA p_bullet2x 2327 8825 cd 99 01 CMP customTemp1 2328 8828 b0 4f BCS .skip60then 2329 882a .condpart61 2330 882a ad 5a 01 LDA enemy01_ypos 2331 882d cd 4d 01 CMP p_bullet2y 2332 8830 b0 47 BCS .skip61then 2333 8832 .condpart62 2334 8832 ad 4d 01 LDA p_bullet2y 2335 8835 cd 9a 01 CMP customTemp2 2336 8838 b0 3f BCS .skip62then 2337 883a .condpart63 2338 883a a9 01 LDA #1 2339 883c 8d 5c 01 STA enemy01_Flag 2340 883f 8d 72 01 STA explosion_aniframe 2341 8842 f8 SED 2342 8843 18 CLC 2343 8844 ad a8 01 LDA score0+2 2344 8847 69 01 ADC #$01 2345 8849 8d a8 01 STA score0+2 2346 884c ad a7 01 LDA score0+1 2347 884f 69 00 ADC #$00 2348 8851 8d a7 01 STA score0+1 2349 8854 ad a6 01 LDA score0 2350 8857 69 00 ADC #$00 2351 8859 8d a6 01 STA score0 2352 885c d8 CLD 2353 885d ifnconst NOTIALOCKMUTE 2354 885d a9 01 lda #1 2355 885f 85 de sta sfxschedulelock 2356 8861 a9 5c lda #sfx_explosion 2359 8867 85 e1 sta sfxinstrumenthi 2360 8869 a9 00 lda #0 2361 886b 85 e2 sta sfxpitchoffset ; no pitch modification 2362 886d 85 e3 sta sfxnoteindex ; not a musical note 2363 886f 20 4b f2 jsr schedulesfx 2364 8872 a9 00 lda #0 2365 8874 85 de sta sfxschedulelock 2366 8876 endif ; NOTIALOCKMUTE 2367 8876 4c 9d 89 jmp .collisions_done 2368 8879 2369 8879 .skip62then 2370 8879 .skip61then 2371 8879 .skip60then 2372 8879 .skipL0213 2373 8879 .L0214 ;; if p_bullet3x > enemy01_xpos && p_bullet3x < customTemp1 && p_bullet3y > enemy01_ypos && p_bullet3y < customTemp2 then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion : goto collisions_done 2374 8879 2375 8879 ad 59 01 LDA enemy01_xpos 2376 887c cd 4a 01 CMP p_bullet3x 2377 887f b0 57 BCS .skipL0214 2378 8881 .condpart64 2379 8881 ad 4a 01 LDA p_bullet3x 2380 8884 cd 99 01 CMP customTemp1 2381 8887 b0 4f BCS .skip64then 2382 8889 .condpart65 2383 8889 ad 5a 01 LDA enemy01_ypos 2384 888c cd 4e 01 CMP p_bullet3y 2385 888f b0 47 BCS .skip65then 2386 8891 .condpart66 2387 8891 ad 4e 01 LDA p_bullet3y 2388 8894 cd 9a 01 CMP customTemp2 2389 8897 b0 3f BCS .skip66then 2390 8899 .condpart67 2391 8899 a9 01 LDA #1 2392 889b 8d 5c 01 STA enemy01_Flag 2393 889e 8d 72 01 STA explosion_aniframe 2394 88a1 f8 SED 2395 88a2 18 CLC 2396 88a3 ad a8 01 LDA score0+2 2397 88a6 69 01 ADC #$01 2398 88a8 8d a8 01 STA score0+2 2399 88ab ad a7 01 LDA score0+1 2400 88ae 69 00 ADC #$00 2401 88b0 8d a7 01 STA score0+1 2402 88b3 ad a6 01 LDA score0 2403 88b6 69 00 ADC #$00 2404 88b8 8d a6 01 STA score0 2405 88bb d8 CLD 2406 88bc ifnconst NOTIALOCKMUTE 2407 88bc a9 01 lda #1 2408 88be 85 de sta sfxschedulelock 2409 88c0 a9 5c lda #sfx_explosion 2412 88c6 85 e1 sta sfxinstrumenthi 2413 88c8 a9 00 lda #0 2414 88ca 85 e2 sta sfxpitchoffset ; no pitch modification 2415 88cc 85 e3 sta sfxnoteindex ; not a musical note 2416 88ce 20 4b f2 jsr schedulesfx 2417 88d1 a9 00 lda #0 2418 88d3 85 de sta sfxschedulelock 2419 88d5 endif ; NOTIALOCKMUTE 2420 88d5 4c 9d 89 jmp .collisions_done 2421 88d8 2422 88d8 .skip66then 2423 88d8 .skip65then 2424 88d8 .skip64then 2425 88d8 .skipL0214 2426 88d8 .L0215 ;; if p_bullet4x > enemy01_xpos && p_bullet4x < customTemp1 && p_bullet4y > enemy01_ypos && p_bullet4y < customTemp2 then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion : goto collisions_done 2427 88d8 2428 88d8 ad 59 01 LDA enemy01_xpos 2429 88db cd 4b 01 CMP p_bullet4x 2430 88de b0 57 BCS .skipL0215 2431 88e0 .condpart68 2432 88e0 ad 4b 01 LDA p_bullet4x 2433 88e3 cd 99 01 CMP customTemp1 2434 88e6 b0 4f BCS .skip68then 2435 88e8 .condpart69 2436 88e8 ad 5a 01 LDA enemy01_ypos 2437 88eb cd 4f 01 CMP p_bullet4y 2438 88ee b0 47 BCS .skip69then 2439 88f0 .condpart70 2440 88f0 ad 4f 01 LDA p_bullet4y 2441 88f3 cd 9a 01 CMP customTemp2 2442 88f6 b0 3f BCS .skip70then 2443 88f8 .condpart71 2444 88f8 a9 01 LDA #1 2445 88fa 8d 5c 01 STA enemy01_Flag 2446 88fd 8d 72 01 STA explosion_aniframe 2447 8900 f8 SED 2448 8901 18 CLC 2449 8902 ad a8 01 LDA score0+2 2450 8905 69 01 ADC #$01 2451 8907 8d a8 01 STA score0+2 2452 890a ad a7 01 LDA score0+1 2453 890d 69 00 ADC #$00 2454 890f 8d a7 01 STA score0+1 2455 8912 ad a6 01 LDA score0 2456 8915 69 00 ADC #$00 2457 8917 8d a6 01 STA score0 2458 891a d8 CLD 2459 891b ifnconst NOTIALOCKMUTE 2460 891b a9 01 lda #1 2461 891d 85 de sta sfxschedulelock 2462 891f a9 5c lda #sfx_explosion 2465 8925 85 e1 sta sfxinstrumenthi 2466 8927 a9 00 lda #0 2467 8929 85 e2 sta sfxpitchoffset ; no pitch modification 2468 892b 85 e3 sta sfxnoteindex ; not a musical note 2469 892d 20 4b f2 jsr schedulesfx 2470 8930 a9 00 lda #0 2471 8932 85 de sta sfxschedulelock 2472 8934 endif ; NOTIALOCKMUTE 2473 8934 4c 9d 89 jmp .collisions_done 2474 8937 2475 8937 .skip70then 2476 8937 .skip69then 2477 8937 .skip68then 2478 8937 .skipL0215 2479 8937 .L0216 ;; if p_twinlaser1_x > enemy01_xpos && p_twinlaser1_x < customTemp1 && p_twinlaser1_y > enemy01_ypos && p_twinlaser1_y < customTemp2 then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 2 : playsfx sfx_explosion 2480 8937 2481 8937 ad 59 01 LDA enemy01_xpos 2482 893a cd 81 01 CMP p_twinlaser1_x 2483 893d b0 54 BCS .skipL0216 2484 893f .condpart72 2485 893f ad 81 01 LDA p_twinlaser1_x 2486 8942 cd 99 01 CMP customTemp1 2487 8945 b0 4c BCS .skip72then 2488 8947 .condpart73 2489 8947 ad 5a 01 LDA enemy01_ypos 2490 894a cd 85 01 CMP p_twinlaser1_y 2491 894d b0 44 BCS .skip73then 2492 894f .condpart74 2493 894f ad 85 01 LDA p_twinlaser1_y 2494 8952 cd 9a 01 CMP customTemp2 2495 8955 b0 3c BCS .skip74then 2496 8957 .condpart75 2497 8957 a9 01 LDA #1 2498 8959 8d 5c 01 STA enemy01_Flag 2499 895c 8d 72 01 STA explosion_aniframe 2500 895f f8 SED 2501 8960 18 CLC 2502 8961 ad a8 01 LDA score0+2 2503 8964 69 02 ADC #$02 2504 8966 8d a8 01 STA score0+2 2505 8969 ad a7 01 LDA score0+1 2506 896c 69 00 ADC #$00 2507 896e 8d a7 01 STA score0+1 2508 8971 ad a6 01 LDA score0 2509 8974 69 00 ADC #$00 2510 8976 8d a6 01 STA score0 2511 8979 d8 CLD 2512 897a ifnconst NOTIALOCKMUTE 2513 897a a9 01 lda #1 2514 897c 85 de sta sfxschedulelock 2515 897e a9 5c lda #sfx_explosion 2518 8984 85 e1 sta sfxinstrumenthi 2519 8986 a9 00 lda #0 2520 8988 85 e2 sta sfxpitchoffset ; no pitch modification 2521 898a 85 e3 sta sfxnoteindex ; not a musical note 2522 898c 20 4b f2 jsr schedulesfx 2523 898f a9 00 lda #0 2524 8991 85 de sta sfxschedulelock 2525 8993 endif ; NOTIALOCKMUTE 2526 8993 .skip74then 2527 8993 .skip73then 2528 8993 .skip72then 2529 8993 .skipL0216 2530 8993 . 2531 8993 ;; 2532 8993 2533 8993 ._checkCollisionsExit 2534 8993 ;; _checkCollisionsExit 2535 8993 2536 8993 .L0217 ;; return 2537 8993 2538 8993 ba tsx 2539 8994 bd 02 01 lda $102,x 2540 8997 f0 01 beq bankswitchret2 2541 8999 60 RTS 2542 899a bankswitchret2 2543 899a 4c 72 f4 JMP BS_return 2544 899d . 2545 899d ;; 2546 899d 2547 899d .collisions_done 2548 899d ;; collisions_done 2549 899d 2550 899d .L0218 ;; return 2551 899d 2552 899d ba tsx 2553 899e bd 02 01 lda $102,x 2554 89a1 f0 01 beq bankswitchret3 2555 89a3 60 RTS 2556 89a4 bankswitchret3 2557 89a4 4c 72 f4 JMP BS_return 2558 89a7 . 2559 89a7 ;; 2560 89a7 2561 89a7 .check_fire_button 2562 89a7 ;; check_fire_button 2563 89a7 2564 89a7 .L0219 ;; if fire_debounce > 0 && joy0fire then return 2565 89a7 2566 89a7 a9 00 LDA #0 2567 89a9 cd 43 01 CMP fire_debounce 2568 89ac b0 0f BCS .skipL0219 2569 89ae .condpart76 2570 89ae 2c 02 21 bit sINPT1 2571 89b1 10 0a BPL .skip76then 2572 89b3 .condpart77 2573 89b3 ba tsx 2574 89b4 bd 02 01 lda $102,x 2575 89b7 f0 01 beq bankswitchret4 2576 89b9 60 RTS 2577 89ba bankswitchret4 2578 89ba 4c 72 f4 JMP BS_return 2579 89bd .skip76then 2580 89bd .skipL0219 2581 89bd .L0220 ;; if !joy0fire then fire_debounce = 0 : return 2582 89bd 2583 89bd 2c 02 21 bit sINPT1 2584 89c0 30 0f BMI .skipL0220 2585 89c2 .condpart78 2586 89c2 a9 00 LDA #0 2587 89c4 8d 43 01 STA fire_debounce 2588 89c7 ba tsx 2589 89c8 bd 02 01 lda $102,x 2590 89cb f0 01 beq bankswitchret5 2591 89cd 60 RTS 2592 89ce bankswitchret5 2593 89ce 4c 72 f4 JMP BS_return 2594 89d1 .skipL0220 2595 89d1 .L0221 ;; temp5 = 255 2596 89d1 2597 89d1 a9 ff LDA #255 2598 89d3 85 46 STA temp5 2599 89d5 .L0222 ;; for temp1 = 0 to 2 2600 89d5 2601 89d5 a9 00 LDA #0 2602 89d7 85 42 STA temp1 2603 89d9 .L0222fortemp1 2604 89d9 .L0223 ;; if p_bullet1x[temp1]! = 200 then temp5 = temp1 2605 89d9 2606 89d9 a6 42 LDX temp1 2607 89db bd 48 01 LDA p_bullet1x,x 2608 89de c9 c8 CMP #200 2609 89e0 d0 04 BNE .skipL0223 2610 89e2 .condpart79 2611 89e2 a5 42 LDA temp1 2612 89e4 85 46 STA temp5 2613 89e6 .skipL0223 2614 89e6 .L0224 ;; next 2615 89e6 2616 89e6 a5 42 LDA temp1 2617 89e8 c9 02 CMP #2 2618 89ea e6 42 INC temp1 2619 89ec if ((* - .L0222fortemp1) < 127) && ((* - .L0222fortemp1) > -128) 2620 89ec 90 eb bcc .L0222fortemp1 2621 89ee - else 2622 89ee - bcs .0skipL0222fortemp1 2623 89ee - jmp .L0222fortemp1 2624 89ee -.0skipL0222fortemp1 2625 89ee endif 2626 89ee .L0225 ;; if temp5 = 255 then return 2627 89ee 2628 89ee a5 46 LDA temp5 2629 89f0 c9 ff CMP #255 2630 89f2 d0 0a BNE .skipL0225 2631 89f4 .condpart80 2632 89f4 ba tsx 2633 89f5 bd 02 01 lda $102,x 2634 89f8 f0 01 beq bankswitchret6 2635 89fa 60 RTS 2636 89fb bankswitchret6 2637 89fb 4c 72 f4 JMP BS_return 2638 89fe .skipL0225 2639 89fe .L0226 ;; playsfx sfx_pulsecannon 2640 89fe 2641 89fe ifnconst NOTIALOCKMUTE 2642 89fe a9 01 lda #1 2643 8a00 85 de sta sfxschedulelock 2644 8a02 a9 d2 lda #sfx_pulsecannon 2647 8a08 85 e1 sta sfxinstrumenthi 2648 8a0a a9 00 lda #0 2649 8a0c 85 e2 sta sfxpitchoffset ; no pitch modification 2650 8a0e 85 e3 sta sfxnoteindex ; not a musical note 2651 8a10 20 4b f2 jsr schedulesfx 2652 8a13 a9 00 lda #0 2653 8a15 85 de sta sfxschedulelock 2654 8a17 endif ; NOTIALOCKMUTE 2655 8a17 .L0227 ;; fire_debounce = 255 2656 8a17 2657 8a17 a9 ff LDA #255 2658 8a19 8d 43 01 STA fire_debounce 2659 8a1c .L0228 ;; p_bullet1time[temp5] = 200 2660 8a1c 2661 8a1c a9 c8 LDA #200 2662 8a1e a6 46 LDX temp5 2663 8a20 9d 77 01 STA p_bullet1time,x 2664 8a23 .L0229 ;; p_bullet1x[temp5] = playerX + 8 2665 8a23 2666 8a23 ad 41 01 LDA playerX 2667 8a26 18 CLC 2668 8a27 69 08 ADC #8 2669 8a29 a6 46 LDX temp5 2670 8a2b 9d 48 01 STA p_bullet1x,x 2671 8a2e .L0230 ;; p_bullet1y[temp5] = playerY + 0 2672 8a2e 2673 8a2e ad 42 01 LDA playerY 2674 8a31 18 CLC 2675 8a32 69 00 ADC #0 2676 8a34 a6 46 LDX temp5 2677 8a36 9d 4c 01 STA p_bullet1y,x 2678 8a39 . 2679 8a39 ;; 2680 8a39 2681 8a39 .L0231 ;; temp5 = temp5 - 6 2682 8a39 2683 8a39 a5 46 LDA temp5 2684 8a3b 38 SEC 2685 8a3c e9 06 SBC #6 2686 8a3e 85 46 STA temp5 2687 8a40 .L0232 ;; return 2688 8a40 2689 8a40 ba tsx 2690 8a41 bd 02 01 lda $102,x 2691 8a44 f0 01 beq bankswitchret7 2692 8a46 60 RTS 2693 8a47 bankswitchret7 2694 8a47 4c 72 f4 JMP BS_return 2695 8a4a . 2696 8a4a ;; 2697 8a4a 2698 8a4a .move_player_bullets 2699 8a4a ;; move_player_bullets 2700 8a4a 2701 8a4a .L0233 ;; if p_bullet1y <> 200 then p_bullet1y = p_bullet1y - 5 2702 8a4a 2703 8a4a ad 4c 01 LDA p_bullet1y 2704 8a4d c9 c8 CMP #200 2705 8a4f f0 06 BEQ .skipL0233 2706 8a51 .condpart81 2707 8a51 38 SEC 2708 8a52 e9 05 SBC #5 2709 8a54 8d 4c 01 STA p_bullet1y 2710 8a57 .skipL0233 2711 8a57 .L0234 ;; if p_bullet2y <> 200 then p_bullet2y = p_bullet2y - 5 2712 8a57 2713 8a57 ad 4d 01 LDA p_bullet2y 2714 8a5a c9 c8 CMP #200 2715 8a5c f0 06 BEQ .skipL0234 2716 8a5e .condpart82 2717 8a5e 38 SEC 2718 8a5f e9 05 SBC #5 2719 8a61 8d 4d 01 STA p_bullet2y 2720 8a64 .skipL0234 2721 8a64 .L0235 ;; if p_bullet3y <> 200 then p_bullet3y = p_bullet3y - 5 2722 8a64 2723 8a64 ad 4e 01 LDA p_bullet3y 2724 8a67 c9 c8 CMP #200 2725 8a69 f0 06 BEQ .skipL0235 2726 8a6b .condpart83 2727 8a6b 38 SEC 2728 8a6c e9 05 SBC #5 2729 8a6e 8d 4e 01 STA p_bullet3y 2730 8a71 .skipL0235 2731 8a71 .L0236 ;; if p_bullet4y <> 200 then p_bullet4y = p_bullet4y - 5 2732 8a71 2733 8a71 ad 4f 01 LDA p_bullet4y 2734 8a74 c9 c8 CMP #200 2735 8a76 f0 06 BEQ .skipL0236 2736 8a78 .condpart84 2737 8a78 38 SEC 2738 8a79 e9 05 SBC #5 2739 8a7b 8d 4f 01 STA p_bullet4y 2740 8a7e .skipL0236 2741 8a7e .L0237 ;; return 2742 8a7e 2743 8a7e ba tsx 2744 8a7f bd 02 01 lda $102,x 2745 8a82 f0 01 beq bankswitchret8 2746 8a84 60 RTS 2747 8a85 bankswitchret8 2748 8a85 4c 72 f4 JMP BS_return 2749 8a88 . 2750 8a88 ;; 2751 8a88 2752 8a88 .check_bullet_time 2753 8a88 ;; check_bullet_time 2754 8a88 2755 8a88 .L0238 ;; for temp1 = 0 to 2 2756 8a88 2757 8a88 a9 00 LDA #0 2758 8a8a 85 42 STA temp1 2759 8a8c .L0238fortemp1 2760 8a8c .L0239 ;; if p_bullet1time[temp1] > 0 then p_bullet1time[temp1] = p_bullet1time[temp1] - 1 else p_bullet1y[temp1] = 200 2761 8a8c 2762 8a8c a9 00 LDA #0 2763 8a8e a6 42 LDX temp1 2764 8a90 dd 77 01 CMP p_bullet1time,x 2765 8a93 b0 10 BCS .skipL0239 2766 8a95 .condpart85 2767 8a95 a6 42 LDX temp1 2768 8a97 bd 77 01 LDA p_bullet1time,x 2769 8a9a 38 SEC 2770 8a9b e9 01 SBC #1 2771 8a9d a6 42 LDX temp1 2772 8a9f 9d 77 01 STA p_bullet1time,x 2773 8aa2 4c ac 8a jmp .skipelse0 2774 8aa5 .skipL0239 2775 8aa5 a9 c8 LDA #200 2776 8aa7 a6 42 LDX temp1 2777 8aa9 9d 4c 01 STA p_bullet1y,x 2778 8aac .skipelse0 2779 8aac .L0240 ;; next 2780 8aac 2781 8aac a5 42 LDA temp1 2782 8aae c9 02 CMP #2 2783 8ab0 e6 42 INC temp1 2784 8ab2 if ((* - .L0238fortemp1) < 127) && ((* - .L0238fortemp1) > -128) 2785 8ab2 90 d8 bcc .L0238fortemp1 2786 8ab4 - else 2787 8ab4 - bcs .1skipL0238fortemp1 2788 8ab4 - jmp .L0238fortemp1 2789 8ab4 -.1skipL0238fortemp1 2790 8ab4 endif 2791 8ab4 .L0241 ;; return 2792 8ab4 2793 8ab4 ba tsx 2794 8ab5 bd 02 01 lda $102,x 2795 8ab8 f0 01 beq bankswitchret9 2796 8aba 60 RTS 2797 8abb bankswitchret9 2798 8abb 4c 72 f4 JMP BS_return 2799 8abe . 2800 8abe ;; 2801 8abe 2802 8abe .check_bullet_boundary 2803 8abe ;; check_bullet_boundary 2804 8abe 2805 8abe .L0242 ;; for temp1 = 0 to 2 2806 8abe 2807 8abe a9 00 LDA #0 2808 8ac0 85 42 STA temp1 2809 8ac2 .L0242fortemp1 2810 8ac2 .L0243 ;; temp_x = p_bullet1x[temp1] 2811 8ac2 2812 8ac2 a6 42 LDX temp1 2813 8ac4 bd 48 01 LDA p_bullet1x,x 2814 8ac7 8d 7c 01 STA temp_x 2815 8aca .L0244 ;; temp_y = p_bullet1y[temp2] 2816 8aca 2817 8aca a6 43 LDX temp2 2818 8acc bd 4c 01 LDA p_bullet1y,x 2819 8acf 8d 7d 01 STA temp_y 2820 8ad2 .L0245 ;; if temp_x < 1 || temp_x > 167 then p_bullet1y[temp1] = 200 2821 8ad2 2822 8ad2 ad 7c 01 LDA temp_x 2823 8ad5 c9 01 CMP #1 2824 8ad7 b0 03 BCS .skipL0245 2825 8ad9 .condpart86 2826 8ad9 4c e3 8a jmp .condpart87 2827 8adc .skipL0245 2828 8adc a9 a7 LDA #167 2829 8ade cd 7c 01 CMP temp_x 2830 8ae1 b0 07 BCS .skip29OR 2831 8ae3 .condpart87 2832 8ae3 a9 c8 LDA #200 2833 8ae5 a6 42 LDX temp1 2834 8ae7 9d 4c 01 STA p_bullet1y,x 2835 8aea .skip29OR 2836 8aea .L0246 ;; if temp_y < 1 || temp_y > 207 then p_bullet1y[temp1] = 200 2837 8aea 2838 8aea ad 7d 01 LDA temp_y 2839 8aed c9 01 CMP #1 2840 8aef b0 03 BCS .skipL0246 2841 8af1 .condpart88 2842 8af1 4c fb 8a jmp .condpart89 2843 8af4 .skipL0246 2844 8af4 a9 cf LDA #207 2845 8af6 cd 7d 01 CMP temp_y 2846 8af9 b0 07 BCS .skip30OR 2847 8afb .condpart89 2848 8afb a9 c8 LDA #200 2849 8afd a6 42 LDX temp1 2850 8aff 9d 4c 01 STA p_bullet1y,x 2851 8b02 .skip30OR 2852 8b02 .L0247 ;; next 2853 8b02 2854 8b02 a5 42 LDA temp1 2855 8b04 c9 02 CMP #2 2856 8b06 e6 42 INC temp1 2857 8b08 if ((* - .L0242fortemp1) < 127) && ((* - .L0242fortemp1) > -128) 2858 8b08 90 b8 bcc .L0242fortemp1 2859 8b0a - else 2860 8b0a - bcs .2skipL0242fortemp1 2861 8b0a - jmp .L0242fortemp1 2862 8b0a -.2skipL0242fortemp1 2863 8b0a endif 2864 8b0a .L0248 ;; return 2865 8b0a 2866 8b0a ba tsx 2867 8b0b bd 02 01 lda $102,x 2868 8b0e f0 01 beq bankswitchret10 2869 8b10 60 RTS 2870 8b11 bankswitchret10 2871 8b11 4c 72 f4 JMP BS_return 2872 8b14 . 2873 8b14 ;; 2874 8b14 2875 8b14 ._draw_player_bullets 2876 8b14 ;; _draw_player_bullets 2877 8b14 2878 8b14 .L0249 ;; for temp_Loop = 0 to 2 2879 8b14 2880 8b14 a9 00 LDA #0 2881 8b16 8d 7b 01 STA temp_Loop 2882 8b19 .L0249fortemp_Loop 2883 8b19 .L0250 ;; temp_x = p_bullet1x[temp_Loop] 2884 8b19 2885 8b19 ae 7b 01 LDX temp_Loop 2886 8b1c bd 48 01 LDA p_bullet1x,x 2887 8b1f 8d 7c 01 STA temp_x 2888 8b22 .L0251 ;; temp_y = p_bullet1y[temp_Loop] 2889 8b22 2890 8b22 ae 7b 01 LDX temp_Loop 2891 8b25 bd 4c 01 LDA p_bullet1y,x 2892 8b28 8d 7d 01 STA temp_y 2893 8b2b .L0252 ;; if temp_x <> 200 then plotsprite vertical_shooting_bullet 0 temp_x temp_y 2894 8b2b 2895 8b2b ad 7c 01 LDA temp_x 2896 8b2e c9 c8 CMP #200 2897 8b30 f0 1d BEQ .skipL0252 2898 8b32 .condpart90 2899 8b32 a9 31 lda #vertical_shooting_bullet 2903 8b38 85 43 sta temp2 2904 8b3a 2905 8b3a a9 1f lda #(0|vertical_shooting_bullet_width_twoscompliment) 2906 8b3c 85 44 sta temp3 2907 8b3e 2908 8b3e ad 7c 01 lda temp_x 2909 8b41 85 45 sta temp4 2910 8b43 2911 8b43 ad 7d 01 lda temp_y 2912 8b46 2913 8b46 85 46 sta temp5 2914 8b48 2915 8b48 a9 40 lda #(vertical_shooting_bullet_mode|%01000000) 2916 8b4a 85 47 sta temp6 2917 8b4c 2918 8b4c 20 93 f2 jsr plotsprite 2919 8b4f .skipL0252 2920 8b4f .L0253 ;; if temp_x <> 200 then plotsprite vertical_shooting_laser 0 temp_x temp_y 2921 8b4f 2922 8b4f ad 7c 01 LDA temp_x 2923 8b52 c9 c8 CMP #200 2924 8b54 f0 2d BEQ .skipL0253 2925 8b56 .condpart91 2926 8b56 a9 ba lda #vertical_shooting_laser 2930 8b5c 85 43 sta temp2 2931 8b5e 2932 8b5e a9 1f lda #(0|vertical_shooting_laser_width_twoscompliment) 2933 8b60 85 44 sta temp3 2934 8b62 2935 8b62 ad 7c 01 lda temp_x 2936 8b65 85 45 sta temp4 2937 8b67 2938 8b67 ad 7d 01 lda temp_y 2939 8b6a 2940 8b6a 85 46 sta temp5 2941 8b6c 2942 8b6c a9 40 lda #(vertical_shooting_laser_mode|%01000000) 2943 8b6e 85 47 sta temp6 2944 8b70 2945 8b70 20 93 f2 jsr plotsprite 2946 8b73 ; +tall sprite replot 2947 8b73 18 clc 2948 8b74 a5 42 lda temp1 2949 8b76 69 01 adc #vertical_shooting_laser_width 2950 8b78 85 42 sta temp1 2951 8b7a a5 46 lda temp5 2952 8b7c 69 08 adc #WZONEHEIGHT 2953 8b7e 85 46 sta temp5 2954 8b80 20 93 f2 jsr plotsprite 2955 8b83 .skipL0253 2956 8b83 .L0254 ;; next 2957 8b83 2958 8b83 ad 7b 01 LDA temp_Loop 2959 8b86 c9 02 CMP #2 2960 8b88 ee 7b 01 INC temp_Loop 2961 8b8b if ((* - .L0249fortemp_Loop) < 127) && ((* - .L0249fortemp_Loop) > -128) 2962 8b8b 90 8c bcc .L0249fortemp_Loop 2963 8b8d - else 2964 8b8d - bcs .3skipL0249fortemp_Loop 2965 8b8d - jmp .L0249fortemp_Loop 2966 8b8d -.3skipL0249fortemp_Loop 2967 8b8d endif 2968 8b8d .L0255 ;; return 2969 8b8d 2970 8b8d ba tsx 2971 8b8e bd 02 01 lda $102,x 2972 8b91 f0 01 beq bankswitchret11 2973 8b93 60 RTS 2974 8b94 bankswitchret11 2975 8b94 4c 72 f4 JMP BS_return 2976 8b97 . 2977 8b97 ;; 2978 8b97 2979 8b97 . 2980 8b97 ;; 2981 8b97 2982 8b97 .SetBulletHome 2983 8b97 ;; SetBulletHome 2984 8b97 2985 8b97 .L0256 ;; p_bullet1x = playerX + 4 : p_bullet1y = playerY - 2 : p_bullet2x = playerX + 4 : p_bullet2y = playerY - 2 2986 8b97 2987 8b97 18 CLC 2988 8b98 69 04 ADC #4 2989 8b9a 8d 48 01 STA p_bullet1x 2990 8b9d 38 SEC 2991 8b9e e9 02 SBC #2 2992 8ba0 8d 4c 01 STA p_bullet1y 2993 8ba3 18 CLC 2994 8ba4 69 04 ADC #4 2995 8ba6 8d 49 01 STA p_bullet2x 2996 8ba9 38 SEC 2997 8baa e9 02 SBC #2 2998 8bac 8d 4d 01 STA p_bullet2y 2999 8baf .L0257 ;; p_bullet3x = playerX + 4 : p_bullet3y = playerY - 2 : p_bullet4x = playerX + 4 : p_bullet4y = playerY - 2 3000 8baf 3001 8baf 18 CLC 3002 8bb0 69 04 ADC #4 3003 8bb2 8d 4a 01 STA p_bullet3x 3004 8bb5 38 SEC 3005 8bb6 e9 02 SBC #2 3006 8bb8 8d 4e 01 STA p_bullet3y 3007 8bbb 18 CLC 3008 8bbc 69 04 ADC #4 3009 8bbe 8d 4b 01 STA p_bullet4x 3010 8bc1 38 SEC 3011 8bc2 e9 02 SBC #2 3012 8bc4 8d 4f 01 STA p_bullet4y 3013 8bc7 .L0258 ;; return 3014 8bc7 3015 8bc7 ba tsx 3016 8bc8 bd 02 01 lda $102,x 3017 8bcb f0 01 beq bankswitchret12 3018 8bcd 60 RTS 3019 8bce bankswitchret12 3020 8bce 4c 72 f4 JMP BS_return 3021 8bd1 . 3022 8bd1 ;; 3023 8bd1 3024 8bd1 .SetLaserHome 3025 8bd1 ;; SetLaserHome 3026 8bd1 3027 8bd1 .L0259 ;; p_twinlaser1_x = playerX + 4 : p_twinlaser1_y = playerY - 2 : p_twinlaser2_x = playerX + 4 : p_twinlaser2_x = playerY - 2 3028 8bd1 3029 8bd1 18 CLC 3030 8bd2 69 04 ADC #4 3031 8bd4 8d 81 01 STA p_twinlaser1_x 3032 8bd7 38 SEC 3033 8bd8 e9 02 SBC #2 3034 8bda 8d 85 01 STA p_twinlaser1_y 3035 8bdd 18 CLC 3036 8bde 69 04 ADC #4 3037 8be0 8d 82 01 STA p_twinlaser2_x 3038 8be3 38 SEC 3039 8be4 e9 02 SBC #2 3040 8be6 8d 82 01 STA p_twinlaser2_x 3041 8be9 .L0260 ;; p_twinlaser3_x = playerX + 4 : p_twinlaser3_y = playerY - 2 : p_twinlaser4_x = playerX + 4 : p_twinlaser4_x = playerY - 2 3042 8be9 3043 8be9 18 CLC 3044 8bea 69 04 ADC #4 3045 8bec 8d 83 01 STA p_twinlaser3_x 3046 8bef 38 SEC 3047 8bf0 e9 02 SBC #2 3048 8bf2 8d 87 01 STA p_twinlaser3_y 3049 8bf5 18 CLC 3050 8bf6 69 04 ADC #4 3051 8bf8 8d 84 01 STA p_twinlaser4_x 3052 8bfb 38 SEC 3053 8bfc e9 02 SBC #2 3054 8bfe 8d 84 01 STA p_twinlaser4_x 3055 8c01 .L0261 ;; return 3056 8c01 3057 8c01 ba tsx 3058 8c02 bd 02 01 lda $102,x 3059 8c05 f0 01 beq bankswitchret13 3060 8c07 60 RTS 3061 8c08 bankswitchret13 3062 8c08 4c 72 f4 JMP BS_return 3063 8c0b . 3064 8c0b ;; 3065 8c0b 3066 8c0b .lose_a_life 3067 8c0b ;; lose_a_life 3068 8c0b 3069 8c0b .L0262 ;; lives = lives - 1 : isDead_flag = 0 3070 8c0b 3071 8c0b ad 73 01 LDA lives 3072 8c0e 38 SEC 3073 8c0f e9 01 SBC #1 3074 8c11 8d 73 01 STA lives 3075 8c14 a9 00 LDA #0 3076 8c16 8d 76 01 STA isDead_flag 3077 8c19 .L0263 ;; if enemy01_Flag <> 1 then enemy01_xpos = 32 : enemy01_ypos = 0 3078 8c19 3079 8c19 ad 5c 01 LDA enemy01_Flag 3080 8c1c c9 01 CMP #1 3081 8c1e f0 0a BEQ .skipL0263 3082 8c20 .condpart92 3083 8c20 a9 20 LDA #32 3084 8c22 8d 59 01 STA enemy01_xpos 3085 8c25 a9 00 LDA #0 3086 8c27 8d 5a 01 STA enemy01_ypos 3087 8c2a .skipL0263 3088 8c2a .L0264 ;; if enemy_shotFlag <> 1 then enemy_shot_xpos = 0 : enemy_shot_ypos = 0 3089 8c2a 3090 8c2a ad 96 01 LDA enemy_shotFlag 3091 8c2d c9 01 CMP #1 3092 8c2f f0 06 BEQ .skipL0264 3093 8c31 .condpart93 3094 8c31 a9 00 LDA #0 3095 8c33 85 e6 STA enemy_shot_xpos 3096 8c35 85 e8 STA enemy_shot_ypos 3097 8c37 .skipL0264 3098 8c37 .L0265 ;; if player_Flag = 1 && explosion_aniframe = 200 && lives > 0 then playerX = 80 : playerY = 144 : player_Flag = 0 : explosion_aniframe = 0 : twinlaser_flag = 0 : goto main 3099 8c37 3100 8c37 ad 5b 01 LDA player_Flag 3101 8c3a c9 01 CMP #1 3102 8c3c d0 26 BNE .skipL0265 3103 8c3e .condpart94 3104 8c3e ad 72 01 LDA explosion_aniframe 3105 8c41 c9 c8 CMP #200 3106 8c43 d0 1f BNE .skip94then 3107 8c45 .condpart95 3108 8c45 a9 00 LDA #0 3109 8c47 cd 73 01 CMP lives 3110 8c4a b0 18 BCS .skip95then 3111 8c4c .condpart96 3112 8c4c a9 50 LDA #80 3113 8c4e 8d 41 01 STA playerX 3114 8c51 a9 90 LDA #144 3115 8c53 8d 42 01 STA playerY 3116 8c56 a9 00 LDA #0 3117 8c58 8d 5b 01 STA player_Flag 3118 8c5b 8d 72 01 STA explosion_aniframe 3119 8c5e 8d 97 01 STA twinlaser_flag 3120 8c61 4c 61 81 jmp .main 3121 8c64 3122 8c64 .skip95then 3123 8c64 .skip94then 3124 8c64 .skipL0265 3125 8c64 .L0266 ;; joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 3126 8c64 3127 8c64 a9 00 LDA #0 3128 8c66 8d 44 01 STA joyposup 3129 8c69 8d 45 01 STA joyposdown 3130 8c6c 8d 46 01 STA joyposleft 3131 8c6f 8d 47 01 STA joyposright 3132 8c72 .L0267 ;; p_bullet1x = 0 : p_bullet1y = 0 : p_bullet2x = 0 : p_bullet2y = 0 : p_bullet3x = 0 : p_bullet3y = 0 : p_bullet4x = 0 : p_bullet4y = 0 3133 8c72 3134 8c72 a9 00 LDA #0 3135 8c74 8d 50 01 STA var16 3136 8c77 a9 00 LDA #0 3137 8c79 8d 48 01 STA p_bullet1x 3138 8c7c a9 00 LDA #0 3139 8c7e 8d 54 01 STA var20 3140 8c81 a9 00 LDA #0 3141 8c83 8d 4c 01 STA p_bullet1y 3142 8c86 a9 00 LDA #0 3143 8c88 8d 51 01 STA var17 3144 8c8b a9 00 LDA #0 3145 8c8d 8d 49 01 STA p_bullet2x 3146 8c90 a9 00 LDA #0 3147 8c92 8d 55 01 STA var21 3148 8c95 a9 00 LDA #0 3149 8c97 8d 4d 01 STA p_bullet2y 3150 8c9a a9 00 LDA #0 3151 8c9c 8d 52 01 STA var18 3152 8c9f a9 00 LDA #0 3153 8ca1 8d 4a 01 STA p_bullet3x 3154 8ca4 a9 00 LDA #0 3155 8ca6 8d 56 01 STA var22 3156 8ca9 a9 00 LDA #0 3157 8cab 8d 4e 01 STA p_bullet3y 3158 8cae a9 00 LDA #0 3159 8cb0 8d 53 01 STA var19 3160 8cb3 a9 00 LDA #0 3161 8cb5 8d 4b 01 STA p_bullet4x 3162 8cb8 a9 00 LDA #0 3163 8cba 8d 57 01 STA var23 3164 8cbd a9 00 LDA #0 3165 8cbf 8d 4f 01 STA p_bullet4y 3166 8cc2 .L0268 ;; p_twinlaser1_x = 0 : p_twinlaser1_y = 0 : p_twinlaser2_x = 0 : p_twinlaser2_y = 0 3167 8cc2 3168 8cc2 a9 00 LDA #0 3169 8cc4 8d 89 01 STA var73 3170 8cc7 a9 00 LDA #0 3171 8cc9 8d 81 01 STA p_twinlaser1_x 3172 8ccc a9 00 LDA #0 3173 8cce 8d 8d 01 STA var77 3174 8cd1 a9 00 LDA #0 3175 8cd3 8d 85 01 STA p_twinlaser1_y 3176 8cd6 a9 00 LDA #0 3177 8cd8 8d 8a 01 STA var74 3178 8cdb a9 00 LDA #0 3179 8cdd 8d 82 01 STA p_twinlaser2_x 3180 8ce0 a9 00 LDA #0 3181 8ce2 8d 8e 01 STA var78 3182 8ce5 a9 00 LDA #0 3183 8ce7 8d 86 01 STA p_twinlaser2_y 3184 8cea .L0269 ;; p_twinlaser3_x = 0 : p_twinlaser3_y = 0 : p_twinlaser4_x = 0 : p_twinlaser4_y = 0 3185 8cea 3186 8cea a9 00 LDA #0 3187 8cec 8d 8b 01 STA var75 3188 8cef a9 00 LDA #0 3189 8cf1 8d 83 01 STA p_twinlaser3_x 3190 8cf4 a9 00 LDA #0 3191 8cf6 8d 8f 01 STA var79 3192 8cf9 a9 00 LDA #0 3193 8cfb 8d 87 01 STA p_twinlaser3_y 3194 8cfe a9 00 LDA #0 3195 8d00 8d 8c 01 STA var76 3196 8d03 a9 00 LDA #0 3197 8d05 8d 84 01 STA p_twinlaser4_x 3198 8d08 a9 00 LDA #0 3199 8d0a 8d 90 01 STA var80 3200 8d0d a9 00 LDA #0 3201 8d0f 8d 88 01 STA p_twinlaser4_y 3202 8d12 .L0270 ;; enemy01_ypos = 0 : enemy01_ypos = 0 : enemy01_Flag = 0 3203 8d12 3204 8d12 a9 00 LDA #0 3205 8d14 8d 5a 01 STA enemy01_ypos 3206 8d17 8d 5a 01 STA enemy01_ypos 3207 8d1a 8d 5c 01 STA enemy01_Flag 3208 8d1d .L0271 ;; player_Flag = 0 : gameover_flag = 0 3209 8d1d 3210 8d1d a9 00 LDA #0 3211 8d1f 8d 5b 01 STA player_Flag 3212 8d22 8d 75 01 STA gameover_flag 3213 8d25 .L0272 ;; power_up_Flag = 0 : twinlaser_flag = 0 3214 8d25 3215 8d25 a9 00 LDA #0 3216 8d27 8d 6e 01 STA power_up_Flag 3217 8d2a 8d 97 01 STA twinlaser_flag 3218 8d2d . 3219 8d2d ;; 3220 8d2d 3221 8d2d .lose_a_lifeloop 3222 8d2d ;; lose_a_lifeloop 3223 8d2d 3224 8d2d . 3225 8d2d ;; 3226 8d2d 3227 8d2d .L0273 ;; gosub draw_scores 3228 8d2d 3229 8d2d 20 c5 84 jsr .draw_scores 3230 8d30 3231 8d30 .L0274 ;; drawscreen 3232 8d30 3233 8d30 20 b3 f0 jsr drawscreen 3234 8d33 .L0275 ;; if joy0fire then fire_debounce = 2 3235 8d33 3236 8d33 2c 02 21 bit sINPT1 3237 8d36 10 05 BPL .skipL0275 3238 8d38 .condpart97 3239 8d38 a9 02 LDA #2 3240 8d3a 8d 43 01 STA fire_debounce 3241 8d3d .skipL0275 3242 8d3d .L0276 ;; if !joy0fire then fire_debounce = 1 3243 8d3d 3244 8d3d 2c 02 21 bit sINPT1 3245 8d40 30 05 BMI .skipL0276 3246 8d42 .condpart98 3247 8d42 a9 01 LDA #1 3248 8d44 8d 43 01 STA fire_debounce 3249 8d47 .skipL0276 3250 8d47 .L0277 ;; if fire_debounce = 1 && lives > 0 then clearscreen : goto main 3251 8d47 3252 8d47 ad 43 01 LDA fire_debounce 3253 8d4a c9 01 CMP #1 3254 8d4c d0 0d BNE .skipL0277 3255 8d4e .condpart99 3256 8d4e a9 00 LDA #0 3257 8d50 cd 73 01 CMP lives 3258 8d53 b0 06 BCS .skip99then 3259 8d55 .condpart100 3260 8d55 20 7f f0 jsr clearscreen 3261 8d58 4c 61 81 jmp .main 3262 8d5b 3263 8d5b .skip99then 3264 8d5b .skipL0277 3265 8d5b .L0278 ;; if fire_debounce = 1 && lives < 1 then clearscreen : goto gameover 3266 8d5b 3267 8d5b ad 43 01 LDA fire_debounce 3268 8d5e c9 01 CMP #1 3269 8d60 d0 0d BNE .skipL0278 3270 8d62 .condpart101 3271 8d62 ad 73 01 LDA lives 3272 8d65 c9 01 CMP #1 3273 8d67 b0 06 BCS .skip101then 3274 8d69 .condpart102 3275 8d69 20 7f f0 jsr clearscreen 3276 8d6c 4c 72 8d jmp .gameover 3277 8d6f 3278 8d6f .skip101then 3279 8d6f .skipL0278 3280 8d6f .L0279 ;; goto lose_a_lifeloop 3281 8d6f 3282 8d6f 4c 2d 8d jmp .lose_a_lifeloop 3283 8d72 3284 8d72 . 3285 8d72 ;; 3286 8d72 3287 8d72 .gameover 3288 8d72 ;; gameover 3289 8d72 3290 8d72 .L0280 ;; gameover_flag = 0 3291 8d72 3292 8d72 a9 00 LDA #0 3293 8d74 8d 75 01 STA gameover_flag 3294 8d77 .L0281 ;; fire_debounce = 1 3295 8d77 3296 8d77 a9 01 LDA #1 3297 8d79 8d 43 01 STA fire_debounce 3298 8d7c . 3299 8d7c ;; 3300 8d7c 3301 8d7c .gameover_loop 3302 8d7c ;; gameover_loop 3303 8d7c 3304 8d7c .L0282 ;; if lives = 0 then gameover_flag = 1 : clearscreen 3305 8d7c 3306 8d7c ad 73 01 LDA lives 3307 8d7f c9 00 CMP #0 3308 8d81 d0 08 BNE .skipL0282 3309 8d83 .condpart103 3310 8d83 a9 01 LDA #1 3311 8d85 8d 75 01 STA gameover_flag 3312 8d88 20 7f f0 jsr clearscreen 3313 8d8b .skipL0282 3314 8d8b .L0283 ;; plotchars 'game^over!' 0 40 16 3315 8d8b 3316 8d8b 4c 98 8d JMP skipalphadata13 3317 8d8e alphadata13 3318 8d8e 11 .byte.b (alphadata13 3333 8d9e 85 43 sta temp2 3334 8da0 3335 8da0 a9 16 lda #22 ; width in two's complement 3336 8da2 09 00 ora #0 ; palette left shifted 5 bits 3337 8da4 85 44 sta temp3 3338 8da6 a9 28 lda #40 3339 8da8 85 45 sta temp4 3340 8daa 3341 8daa a9 10 lda #16 3342 8dac 3343 8dac 85 46 sta temp5 3344 8dae 3345 8dae 20 4c f3 jsr plotcharacters 3346 8db1 .L0284 ;; if joy0fire && !fire_debounce then clearscreen : goto plot 3347 8db1 3348 8db1 2c 02 21 bit sINPT1 3349 8db4 10 0b BPL .skipL0284 3350 8db6 .condpart104 3351 8db6 ad 43 01 LDA fire_debounce 3352 8db9 d0 06 BNE .skip104then 3353 8dbb .condpart105 3354 8dbb 20 7f f0 jsr clearscreen 3355 8dbe 4c 43 80 jmp .plot 3356 8dc1 3357 8dc1 .skip104then 3358 8dc1 .skipL0284 3359 8dc1 .L0285 ;; if !joy0fire then fire_debounce = 0 3360 8dc1 3361 8dc1 2c 02 21 bit sINPT1 3362 8dc4 30 05 BMI .skipL0285 3363 8dc6 .condpart106 3364 8dc6 a9 00 LDA #0 3365 8dc8 8d 43 01 STA fire_debounce 3366 8dcb .skipL0285 3367 8dcb .L0286 ;; goto gameover_loop 3368 8dcb 3369 8dcb 4c 7c 8d jmp .gameover_loop 3370 8dce 3371 8dce . 3372 8dce ;; 3373 8dce 3374 8dce .titlescreen 3375 8dce ;; titlescreen 3376 8dce 3377 8dce .L0287 ;; plotchars 'new^vertical^shooting' 1 38 4 3378 8dce 3379 8dce 4c e6 8d JMP skipalphadata14 3380 8dd1 alphadata14 3381 8dd1 18 .byte.b (alphadata14 3407 8dec 85 43 sta temp2 3408 8dee 3409 8dee a9 0b lda #11 ; width in two's complement 3410 8df0 09 20 ora #32 ; palette left shifted 5 bits 3411 8df2 85 44 sta temp3 3412 8df4 a9 26 lda #38 3413 8df6 85 45 sta temp4 3414 8df8 3415 8df8 a9 04 lda #4 3416 8dfa 3417 8dfa 85 46 sta temp5 3418 8dfc 3419 8dfc 20 4c f3 jsr plotcharacters 3420 8dff .L0288 ;; plotchars 'demo' 1 72 5 3421 8dff 3422 8dff 4c 06 8e JMP skipalphadata15 3423 8e02 alphadata15 3424 8e02 0e .byte.b (alphadata15 3433 8e0c 85 43 sta temp2 3434 8e0e 3435 8e0e a9 1c lda #28 ; width in two's complement 3436 8e10 09 20 ora #32 ; palette left shifted 5 bits 3437 8e12 85 44 sta temp3 3438 8e14 a9 48 lda #72 3439 8e16 85 45 sta temp4 3440 8e18 3441 8e18 a9 05 lda #5 3442 8e1a 3443 8e1a 85 46 sta temp5 3444 8e1c 3445 8e1c 20 4c f3 jsr plotcharacters 3446 8e1f .L0289 ;; plotchars 'by^shane^skekel.' 1 48 7 3447 8e1f 3448 8e1f 4c 32 8e JMP skipalphadata16 3449 8e22 alphadata16 3450 8e22 0c .byte.b (alphadata16 3471 8e38 85 43 sta temp2 3472 8e3a 3473 8e3a a9 10 lda #16 ; width in two's complement 3474 8e3c 09 20 ora #32 ; palette left shifted 5 bits 3475 8e3e 85 44 sta temp3 3476 8e40 a9 30 lda #48 3477 8e42 85 45 sta temp4 3478 8e44 3479 8e44 a9 07 lda #7 3480 8e46 3481 8e46 85 46 sta temp5 3482 8e48 3483 8e48 20 4c f3 jsr plotcharacters 3484 8e4b .L0290 ;; plotchars 'push^fire^to^begin.' 2 42 16 3485 8e4b 3486 8e4b 4c 61 8e JMP skipalphadata17 3487 8e4e alphadata17 3488 8e4e 1a .byte.b (alphadata17 3512 8e67 85 43 sta temp2 3513 8e69 3514 8e69 a9 0d lda #13 ; width in two's complement 3515 8e6b 09 40 ora #64 ; palette left shifted 5 bits 3516 8e6d 85 44 sta temp3 3517 8e6f a9 2a lda #42 3518 8e71 85 45 sta temp4 3519 8e73 3520 8e73 a9 10 lda #16 3521 8e75 3522 8e75 85 46 sta temp5 3523 8e77 3524 8e77 20 4c f3 jsr plotcharacters 3525 8e7a .L0291 ;; savescreen 3526 8e7a 3527 8e7a 20 a3 f0 jsr savescreen 3528 8e7d .L0292 ;; drawscreen 3529 8e7d 3530 8e7d 20 b3 f0 jsr drawscreen 3531 8e80 .L0293 ;; fire_debounce = 1 3532 8e80 3533 8e80 a9 01 LDA #1 3534 8e82 8d 43 01 STA fire_debounce 3535 8e85 . 3536 8e85 ;; 3537 8e85 3538 8e85 .titlescreenloop 3539 8e85 ;; titlescreenloop 3540 8e85 3541 8e85 .L0294 ;; restorescreen 3542 8e85 3543 8e85 20 91 f0 jsr restorescreen 3544 8e88 .L0295 ;; if switchreset then reboot 3545 8e88 3546 8e88 20 85 f4 jsr checkresetswitch 3547 8e8b d0 03 BNE .skipL0295 3548 8e8d .condpart107 3549 8e8d 4c 72 f5 JMP START 3550 8e90 .skipL0295 3551 8e90 .L0296 ;; if joy0fire then clearscreen : savescreen : lives = $04 : score0 = 0 : playsfx sfx_bling : goto main 3552 8e90 3553 8e90 2c 02 21 bit sINPT1 3554 8e93 10 36 BPL .skipL0296 3555 8e95 .condpart108 3556 8e95 20 7f f0 jsr clearscreen 3557 8e98 20 a3 f0 jsr savescreen 3558 8e9b a9 04 LDA #$04 3559 8e9d 8d 73 01 STA lives 3560 8ea0 a9 00 LDA #$00 3561 8ea2 8d a8 01 STA score0+2 3562 8ea5 a9 00 LDA #$00 3563 8ea7 8d a7 01 STA score0+1 3564 8eaa a9 00 LDA #$00 3565 8eac 8d a6 01 STA score0 3566 8eaf ifnconst NOTIALOCKMUTE 3567 8eaf a9 01 lda #1 3568 8eb1 85 de sta sfxschedulelock 3569 8eb3 a9 99 lda #sfx_bling 3572 8eb9 85 e1 sta sfxinstrumenthi 3573 8ebb a9 00 lda #0 3574 8ebd 85 e2 sta sfxpitchoffset ; no pitch modification 3575 8ebf 85 e3 sta sfxnoteindex ; not a musical note 3576 8ec1 20 4b f2 jsr schedulesfx 3577 8ec4 a9 00 lda #0 3578 8ec6 85 de sta sfxschedulelock 3579 8ec8 endif ; NOTIALOCKMUTE 3580 8ec8 4c 61 81 jmp .main 3581 8ecb 3582 8ecb .skipL0296 3583 8ecb .L0297 ;; if !joy0fire then fire_debounce = 0 3584 8ecb 3585 8ecb 2c 02 21 bit sINPT1 3586 8ece 30 05 BMI .skipL0297 3587 8ed0 .condpart109 3588 8ed0 a9 00 LDA #0 3589 8ed2 8d 43 01 STA fire_debounce 3590 8ed5 .skipL0297 3591 8ed5 .L0298 ;; drawscreen 3592 8ed5 3593 8ed5 20 b3 f0 jsr drawscreen 3594 8ed8 .L0299 ;; goto titlescreenloop 3595 8ed8 3596 8ed8 4c 85 8e jmp .titlescreenloop 3597 8edb 3598 8edb . 3599 8edb ;; 3600 8edb 3601 8edb . 3602 8edb ;; 3603 8edb 3604 8edb .initialise_gamescreen 3605 8edb ;; initialise_gamescreen 3606 8edb 3607 8edb .L0300 ;; clearscreen 3608 8edb 3609 8edb 20 7f f0 jsr clearscreen 3610 8ede .L0301 ;; BACKGRND = $00 3611 8ede 3612 8ede a9 00 LDA #$00 3613 8ee0 85 20 STA BACKGRND 3614 8ee2 . 3615 8ee2 ;; 3616 8ee2 3617 8ee2 .L0302 ;; savescreen 3618 8ee2 3619 8ee2 20 a3 f0 jsr savescreen 3620 8ee5 .L0303 ;; return 3621 8ee5 3622 8ee5 ba tsx 3623 8ee6 bd 02 01 lda $102,x 3624 8ee9 f0 01 beq bankswitchret19 3625 8eeb 60 RTS 3626 8eec bankswitchret19 3627 8eec 4c 72 f4 JMP BS_return 3628 8eef . 3629 8eef ;; 3630 8eef 3631 8eef .shoot_enemy_bullet 3632 8eef ;; shoot_enemy_bullet 3633 8eef 3634 8eef . 3635 8eef ;; 3636 8eef 3637 8eef .L0304 ;; z = 15 3638 8eef 3639 8eef a9 0f LDA #15 3640 8ef1 85 ff STA z 3641 8ef3 .check_enemyshot 3642 8ef3 ;; check_enemyshot 3643 8ef3 3644 8ef3 . 3645 8ef3 ;; 3646 8ef3 3647 8ef3 . 3648 8ef3 ;; 3649 8ef3 3650 8ef3 . 3651 8ef3 ;; 3652 8ef3 3653 8ef3 . 3654 8ef3 ;; 3655 8ef3 3656 8ef3 . 3657 8ef3 ;; 3658 8ef3 3659 8ef3 .L0305 ;; if enemy_shotFlag = TRUE then goto skip_enemy_shot 3660 8ef3 3661 8ef3 ad 96 01 LDA enemy_shotFlag 3662 8ef6 c9 01 CMP #TRUE 3663 8ef8 d0 03 BNE .skipL0305 3664 8efa .condpart110 3665 8efa 4c 20 90 jmp .skip_enemy_shot 3666 8efd 3667 8efd .skipL0305 3668 8efd .L0306 ;; enemy_shotFlag = TRUE 3669 8efd 3670 8efd a9 01 LDA #TRUE 3671 8eff 8d 96 01 STA enemy_shotFlag 3672 8f02 .L0307 ;; enemy_shot_xpos = enemy01_xpos + 2 3673 8f02 3674 8f02 ad 59 01 LDA enemy01_xpos 3675 8f05 18 CLC 3676 8f06 69 02 ADC #2 3677 8f08 85 e6 STA enemy_shot_xpos 3678 8f0a .L0308 ;; enemy_shot_ypos = enemy01_ypos + 4 3679 8f0a 3680 8f0a ad 5a 01 LDA enemy01_ypos 3681 8f0d 18 CLC 3682 8f0e 69 04 ADC #4 3683 8f10 85 e8 STA enemy_shot_ypos 3684 8f12 . 3685 8f12 ;; 3686 8f12 3687 8f12 .L0309 ;; Temp_XSu = 0 3688 8f12 3689 8f12 a9 00 LDA #0 3690 8f14 85 f0 STA Temp_XSu 3691 8f16 .L0310 ;; Temp_YSu = 0 3692 8f16 3693 8f16 a9 00 LDA #0 3694 8f18 85 f2 STA Temp_YSu 3695 8f1a . 3696 8f1a ;; 3697 8f1a 3698 8f1a . 3699 8f1a ;; 3700 8f1a 3701 8f1a . 3702 8f1a ;; 3703 8f1a 3704 8f1a . 3705 8f1a ;; 3706 8f1a 3707 8f1a . 3708 8f1a ;; 3709 8f1a 3710 8f1a .L0311 ;; if playerX = enemy_shot_xpos then Temp_XSf = 0 3711 8f1a 3712 8f1a ad 41 01 LDA playerX 3713 8f1d c5 e6 CMP enemy_shot_xpos 3714 8f1f d0 04 BNE .skipL0311 3715 8f21 .condpart111 3716 8f21 a9 00 LDA #0 3717 8f23 85 f1 STA Temp_XSf 3718 8f25 .skipL0311 3719 8f25 .L0312 ;; if playerX > enemy_shot_xpos then Temp_XSf = playerX - enemy_shot_xpos 3720 8f25 3721 8f25 a5 e6 LDA enemy_shot_xpos 3722 8f27 cd 41 01 CMP playerX 3723 8f2a b0 08 BCS .skipL0312 3724 8f2c .condpart112 3725 8f2c ad 41 01 LDA playerX 3726 8f2f 38 SEC 3727 8f30 e5 e6 SBC enemy_shot_xpos 3728 8f32 85 f1 STA Temp_XSf 3729 8f34 .skipL0312 3730 8f34 .L0313 ;; if playerX < enemy_shot_xpos then Temp_XSf = enemy_shot_xpos - playerX 3731 8f34 3732 8f34 ad 41 01 LDA playerX 3733 8f37 c5 e6 CMP enemy_shot_xpos 3734 8f39 b0 08 BCS .skipL0313 3735 8f3b .condpart113 3736 8f3b a5 e6 LDA enemy_shot_xpos 3737 8f3d 38 SEC 3738 8f3e ed 41 01 SBC playerX 3739 8f41 85 f1 STA Temp_XSf 3740 8f43 .skipL0313 3741 8f43 . 3742 8f43 ;; 3743 8f43 3744 8f43 . 3745 8f43 ;; 3746 8f43 3747 8f43 . 3748 8f43 ;; 3749 8f43 3750 8f43 . 3751 8f43 ;; 3752 8f43 3753 8f43 . 3754 8f43 ;; 3755 8f43 3756 8f43 .L0314 ;; if playerY = enemy_shot_ypos then Temp_YSf = 0 3757 8f43 3758 8f43 ad 42 01 LDA playerY 3759 8f46 c5 e8 CMP enemy_shot_ypos 3760 8f48 d0 04 BNE .skipL0314 3761 8f4a .condpart114 3762 8f4a a9 00 LDA #0 3763 8f4c 85 f3 STA Temp_YSf 3764 8f4e .skipL0314 3765 8f4e .L0315 ;; if playerY > enemy_shot_ypos then Temp_YSf = playerY - enemy_shot_ypos 3766 8f4e 3767 8f4e a5 e8 LDA enemy_shot_ypos 3768 8f50 cd 42 01 CMP playerY 3769 8f53 b0 08 BCS .skipL0315 3770 8f55 .condpart115 3771 8f55 ad 42 01 LDA playerY 3772 8f58 38 SEC 3773 8f59 e5 e8 SBC enemy_shot_ypos 3774 8f5b 85 f3 STA Temp_YSf 3775 8f5d .skipL0315 3776 8f5d .L0316 ;; if playerY < enemy_shot_ypos then Temp_YSf = enemy_shot_ypos - playerY 3777 8f5d 3778 8f5d ad 42 01 LDA playerY 3779 8f60 c5 e8 CMP enemy_shot_ypos 3780 8f62 b0 08 BCS .skipL0316 3781 8f64 .condpart116 3782 8f64 a5 e8 LDA enemy_shot_ypos 3783 8f66 38 SEC 3784 8f67 ed 42 01 SBC playerY 3785 8f6a 85 f3 STA Temp_YSf 3786 8f6c .skipL0316 3787 8f6c . 3788 8f6c ;; 3789 8f6c 3790 8f6c . 3791 8f6c ;; 3792 8f6c 3793 8f6c . 3794 8f6c ;; 3795 8f6c 3796 8f6c . 3797 8f6c ;; 3798 8f6c 3799 8f6c . 3800 8f6c ;; 3801 8f6c 3802 8f6c . 3803 8f6c ;; 3804 8f6c 3805 8f6c . 3806 8f6c ;; 3807 8f6c 3808 8f6c .L0317 ;; if Temp_YSf = 0 && Temp_XSf = 0 then enemy_shotFlag = FALSE : return 3809 8f6c 3810 8f6c a5 f3 LDA Temp_YSf 3811 8f6e c9 00 CMP #0 3812 8f70 d0 15 BNE .skipL0317 3813 8f72 .condpart117 3814 8f72 a5 f1 LDA Temp_XSf 3815 8f74 c9 00 CMP #0 3816 8f76 d0 0f BNE .skip117then 3817 8f78 .condpart118 3818 8f78 a9 00 LDA #FALSE 3819 8f7a 8d 96 01 STA enemy_shotFlag 3820 8f7d ba tsx 3821 8f7e bd 02 01 lda $102,x 3822 8f81 f0 01 beq bankswitchret20 3823 8f83 60 RTS 3824 8f84 bankswitchret20 3825 8f84 4c 72 f4 JMP BS_return 3826 8f87 .skip117then 3827 8f87 .skipL0317 3828 8f87 . 3829 8f87 ;; 3830 8f87 3831 8f87 . 3832 8f87 ;; 3833 8f87 3834 8f87 . 3835 8f87 ;; 3836 8f87 3837 8f87 . 3838 8f87 ;; 3839 8f87 3840 8f87 .L0318 ;; if playerX <= enemy_shot_xpos then enemy_shot_direction = enemy_shot_direction | %00000010 else enemy_shot_direction = enemy_shot_direction & %11111101 3841 8f87 3842 8f87 a5 e6 LDA enemy_shot_xpos 3843 8f89 cd 41 01 CMP playerX 3844 8f8c 90 09 BCC .skipL0318 3845 8f8e .condpart119 3846 8f8e a5 ef LDA enemy_shot_direction 3847 8f90 09 02 ORA #%00000010 3848 8f92 85 ef STA enemy_shot_direction 3849 8f94 4c 9d 8f jmp .skipelse1 3850 8f97 .skipL0318 3851 8f97 a5 ef LDA enemy_shot_direction 3852 8f99 29 fd AND #%11111101 3853 8f9b 85 ef STA enemy_shot_direction 3854 8f9d .skipelse1 3855 8f9d .L0319 ;; if playerY <= enemy_shot_ypos then enemy_shot_direction = enemy_shot_direction | %00000001 else enemy_shot_direction = enemy_shot_direction & %11111110 3856 8f9d 3857 8f9d a5 e8 LDA enemy_shot_ypos 3858 8f9f cd 42 01 CMP playerY 3859 8fa2 90 09 BCC .skipL0319 3860 8fa4 .condpart120 3861 8fa4 a5 ef LDA enemy_shot_direction 3862 8fa6 09 01 ORA #%00000001 3863 8fa8 85 ef STA enemy_shot_direction 3864 8faa 4c b3 8f jmp .skipelse2 3865 8fad .skipL0319 3866 8fad a5 ef LDA enemy_shot_direction 3867 8faf 29 fe AND #%11111110 3868 8fb1 85 ef STA enemy_shot_direction 3869 8fb3 .skipelse2 3870 8fb3 . 3871 8fb3 ;; 3872 8fb3 3873 8fb3 .L0320 ;; Temp_XSu = 0 3874 8fb3 3875 8fb3 a9 00 LDA #0 3876 8fb5 85 f0 STA Temp_XSu 3877 8fb7 .L0321 ;; Temp_YSu = 0 3878 8fb7 3879 8fb7 a9 00 LDA #0 3880 8fb9 85 f2 STA Temp_YSu 3881 8fbb . 3882 8fbb ;; 3883 8fbb 3884 8fbb .L0322 ;; Total_XSu = 0 3885 8fbb 3886 8fbb a9 00 LDA #0 3887 8fbd 8d 5e 01 STA Total_XSu 3888 8fc0 .L0323 ;; Total_XSf = 0 3889 8fc0 3890 8fc0 a9 00 LDA #0 3891 8fc2 8d 5f 01 STA Total_XSf 3892 8fc5 .L0324 ;; Total_YSu = 0 3893 8fc5 3894 8fc5 a9 00 LDA #0 3895 8fc7 8d 60 01 STA Total_YSu 3896 8fca .L0325 ;; Total_YSf = 0 3897 8fca 3898 8fca a9 00 LDA #0 3899 8fcc 8d 61 01 STA Total_YSf 3900 8fcf . 3901 8fcf ;; 3902 8fcf 3903 8fcf .es_SpeedIncrease 3904 8fcf ;; es_SpeedIncrease 3905 8fcf 3906 8fcf .L0326 ;; Total_speedX = Total_speedX + Temp_X_speed 3907 8fcf 3908 8fcf ad 5f 01 LDA Total_XSf 3909 8fd2 18 CLC 3910 8fd3 65 f1 ADC Temp_XSf 3911 8fd5 8d 5f 01 STA Total_XSf 3912 8fd8 ad 5e 01 LDA Total_speedX 3913 8fdb 65 f0 ADC Temp_X_speed 3914 8fdd 8d 5e 01 STA Total_speedX 3915 8fe0 .L0327 ;; Total_speedY = Total_speedY + Temp_Y_speed 3916 8fe0 3917 8fe0 ad 61 01 LDA Total_YSf 3918 8fe3 18 CLC 3919 8fe4 65 f3 ADC Temp_YSf 3920 8fe6 8d 61 01 STA Total_YSf 3921 8fe9 ad 60 01 LDA Total_speedY 3922 8fec 65 f2 ADC Temp_Y_speed 3923 8fee 8d 60 01 STA Total_speedY 3924 8ff1 .L0328 ;; if Total_XSu = 0 && Total_YSu = 0 then goto es_SpeedIncrease 3925 8ff1 3926 8ff1 ad 5e 01 LDA Total_XSu 3927 8ff4 c9 00 CMP #0 3928 8ff6 d0 0a BNE .skipL0328 3929 8ff8 .condpart121 3930 8ff8 ad 60 01 LDA Total_YSu 3931 8ffb c9 00 CMP #0 3932 8ffd d0 03 BNE .skip121then 3933 8fff .condpart122 3934 8fff 4c cf 8f jmp .es_SpeedIncrease 3935 9002 3936 9002 .skip121then 3937 9002 .skipL0328 3938 9002 . 3939 9002 ;; 3940 9002 3941 9002 . 3942 9002 ;; 3943 9002 3944 9002 . 3945 9002 ;; 3946 9002 3947 9002 . 3948 9002 ;; 3949 9002 3950 9002 . 3951 9002 ;; 3952 9002 3953 9002 . 3954 9002 ;; 3955 9002 3956 9002 .L0329 ;; enemy_shot_Xf = Total_XSu 3957 9002 3958 9002 ad 5e 01 LDA Total_XSu 3959 9005 85 e7 STA enemy_shot_Xf 3960 9007 .L0330 ;; enemy_shot_Sxf = Total_XSf 3961 9007 3962 9007 ad 5f 01 LDA Total_XSf 3963 900a 85 eb STA enemy_shot_Sxf 3964 900c .L0331 ;; enemy_shot_Yf = Total_YSu 3965 900c 3966 900c ad 60 01 LDA Total_YSu 3967 900f 85 e9 STA enemy_shot_Yf 3968 9011 .L0332 ;; enemy_shot_Syf = Total_YSf 3969 9011 3970 9011 ad 61 01 LDA Total_YSf 3971 9014 85 ed STA enemy_shot_Syf 3972 9016 .L0333 ;; return 3973 9016 3974 9016 ba tsx 3975 9017 bd 02 01 lda $102,x 3976 901a f0 01 beq bankswitchret21 3977 901c 60 RTS 3978 901d bankswitchret21 3979 901d 4c 72 f4 JMP BS_return 3980 9020 . 3981 9020 ;; 3982 9020 3983 9020 .skip_enemy_shot 3984 9020 ;; skip_enemy_shot 3985 9020 3986 9020 .L0334 ;; z = z - 1 3987 9020 3988 9020 a5 ff LDA z 3989 9022 38 SEC 3990 9023 e9 01 SBC #1 3991 9025 85 ff STA z 3992 9027 .L0335 ;; if z < 15 then shoot_enemy_bullet 3993 9027 3994 9027 a5 ff LDA z 3995 9029 c9 0f CMP #15 3996 902b - if ((* - .shoot_enemy_bullet) < 127) && ((* - .shoot_enemy_bullet) > -128) 3997 902b - bcc .shoot_enemy_bullet 3998 902b else 3999 902b b0 03 bcs .4skipshoot_enemy_bullet 4000 902d 4c ef 8e jmp .shoot_enemy_bullet 4001 9030 .4skipshoot_enemy_bullet 4002 9030 endif 4003 9030 .L0336 ;; return 4004 9030 4005 9030 ba tsx 4006 9031 bd 02 01 lda $102,x 4007 9034 f0 01 beq bankswitchret22 4008 9036 60 RTS 4009 9037 bankswitchret22 4010 9037 4c 72 f4 JMP BS_return 4011 903a . 4012 903a ;; 4013 903a 4014 903a .move_enemyshot 4015 903a ;; move_enemyshot 4016 903a 4017 903a . 4018 903a ;; 4019 903a 4020 903a .L0337 ;; z = 15 4021 903a 4022 903a a9 0f LDA #15 4023 903c 85 ff STA z 4024 903e .update_enemyshot 4025 903e ;; update_enemyshot 4026 903e 4027 903e . 4028 903e ;; 4029 903e 4030 903e . 4031 903e ;; 4032 903e 4033 903e . 4034 903e ;; 4035 903e 4036 903e . 4037 903e ;; 4038 903e 4039 903e . 4040 903e ;; 4041 903e 4042 903e . 4043 903e ;; 4044 903e 4045 903e . 4046 903e ;; 4047 903e 4048 903e . 4049 903e ;; 4050 903e 4051 903e . 4052 903e ;; 4053 903e 4054 903e . 4055 903e ;; 4056 903e 4057 903e . 4058 903e ;; 4059 903e 4060 903e .L0338 ;; if ( enemy_shot_direction & 1 ) = 1 then Mob_Pos_Y = Mob_Pos_Y - Mob_SpeedY else Mob_Pos_Y = Mob_Pos_Y + Mob_SpeedY 4061 903e 4062 903e ; complex condition detected 4063 903e ; complex statement detected 4064 903e a5 ef LDA enemy_shot_direction 4065 9040 29 01 AND #1 4066 9042 c9 01 CMP #1 4067 9044 d0 16 BNE .skipL0338 4068 9046 .condpart123 4069 9046 ad 69 01 LDA var41 4070 9049 38 SEC 4071 904a ed 65 01 SBC var37 4072 904d 8d 69 01 STA var41 4073 9050 ad 68 01 LDA Mob_Pos_Y 4074 9053 ed 64 01 SBC Mob_SpeedY 4075 9056 8d 68 01 STA Mob_Pos_Y 4076 9059 4c 6f 90 jmp .skipelse3 4077 905c .skipL0338 4078 905c ad 69 01 LDA var41 4079 905f 18 CLC 4080 9060 6d 65 01 ADC var37 4081 9063 8d 69 01 STA var41 4082 9066 ad 68 01 LDA Mob_Pos_Y 4083 9069 6d 64 01 ADC Mob_SpeedY 4084 906c 8d 68 01 STA Mob_Pos_Y 4085 906f .skipelse3 4086 906f .L0339 ;; if ( enemy_shot_direction & 2 ) = 2 then Mob_Pos_X = Mob_Pos_X - Mob_SpeedX else Mob_Pos_X = Mob_Pos_X + Mob_SpeedX 4087 906f 4088 906f ; complex condition detected 4089 906f ; complex statement detected 4090 906f a5 ef LDA enemy_shot_direction 4091 9071 29 02 AND #2 4092 9073 c9 02 CMP #2 4093 9075 d0 16 BNE .skipL0339 4094 9077 .condpart124 4095 9077 ad 67 01 LDA var39 4096 907a 38 SEC 4097 907b ed 63 01 SBC var35 4098 907e 8d 67 01 STA var39 4099 9081 ad 66 01 LDA Mob_Pos_X 4100 9084 ed 62 01 SBC Mob_SpeedX 4101 9087 8d 66 01 STA Mob_Pos_X 4102 908a 4c a0 90 jmp .skipelse4 4103 908d .skipL0339 4104 908d ad 67 01 LDA var39 4105 9090 18 CLC 4106 9091 6d 63 01 ADC var35 4107 9094 8d 67 01 STA var39 4108 9097 ad 66 01 LDA Mob_Pos_X 4109 909a 6d 62 01 ADC Mob_SpeedX 4110 909d 8d 66 01 STA Mob_Pos_X 4111 90a0 .skipelse4 4112 90a0 . 4113 90a0 ;; 4114 90a0 4115 90a0 . 4116 90a0 ;; 4117 90a0 4118 90a0 . 4119 90a0 ;; 4120 90a0 4121 90a0 . 4122 90a0 ;; 4123 90a0 4124 90a0 . 4125 90a0 ;; 4126 90a0 4127 90a0 . 4128 90a0 ;; 4129 90a0 4130 90a0 .L0340 ;; return 4131 90a0 4132 90a0 ba tsx 4133 90a1 bd 02 01 lda $102,x 4134 90a4 f0 01 beq bankswitchret23 4135 90a6 60 RTS 4136 90a7 bankswitchret23 4137 90a7 4c 72 f4 JMP BS_return 4138 90aa . 4139 90aa ;; 4140 90aa 4141 90aa .power_up_obtained 4142 90aa ;; power_up_obtained 4143 90aa 4144 90aa .L0341 ;; if power_up_Flag = 1 then twinlaser_flag = 1 4145 90aa 4146 90aa ad 6e 01 LDA power_up_Flag 4147 90ad c9 01 CMP #1 4148 90af d0 05 BNE .skipL0341 4149 90b1 .condpart125 4150 90b1 a9 01 LDA #1 4151 90b3 8d 97 01 STA twinlaser_flag 4152 90b6 .skipL0341 4153 90b6 .L0342 ;; return 4154 90b6 4155 90b6 ba tsx 4156 90b7 bd 02 01 lda $102,x 4157 90ba f0 01 beq bankswitchret24 4158 90bc 60 RTS 4159 90bd bankswitchret24 4160 90bd 4c 72 f4 JMP BS_return 4161 90c0 . 4162 90c0 ;; 4163 90c0 4164 90c0 .draw_sprites 4165 90c0 ;; draw_sprites 4166 90c0 4167 90c0 .L0343 ;; plotsprite vertical_shooting_ship 0 playerX playerY 4168 90c0 4169 90c0 a9 2d lda #vertical_shooting_ship 4173 90c6 85 43 sta temp2 4174 90c8 4175 90c8 a9 1e lda #(0|vertical_shooting_ship_width_twoscompliment) 4176 90ca 85 44 sta temp3 4177 90cc 4178 90cc ad 41 01 lda playerX 4179 90cf 85 45 sta temp4 4180 90d1 4181 90d1 ad 42 01 lda playerY 4182 90d4 4183 90d4 85 46 sta temp5 4184 90d6 4185 90d6 a9 40 lda #(vertical_shooting_ship_mode|%01000000) 4186 90d8 85 47 sta temp6 4187 90da 4188 90da 20 93 f2 jsr plotsprite 4189 90dd ; +tall sprite replot 4190 90dd 18 clc 4191 90de a5 42 lda temp1 4192 90e0 69 02 adc #vertical_shooting_ship_width 4193 90e2 85 42 sta temp1 4194 90e4 a5 46 lda temp5 4195 90e6 69 08 adc #WZONEHEIGHT 4196 90e8 85 46 sta temp5 4197 90ea 20 93 f2 jsr plotsprite 4198 90ed .L0344 ;; plotsprite vertical_shooting_bullet 1 p_bullet1x p_bullet1y 4199 90ed 4200 90ed a9 31 lda #vertical_shooting_bullet 4204 90f3 85 43 sta temp2 4205 90f5 4206 90f5 a9 3f lda #(32|vertical_shooting_bullet_width_twoscompliment) 4207 90f7 85 44 sta temp3 4208 90f9 4209 90f9 ad 48 01 lda p_bullet1x 4210 90fc 85 45 sta temp4 4211 90fe 4212 90fe ad 4c 01 lda p_bullet1y 4213 9101 4214 9101 85 46 sta temp5 4215 9103 4216 9103 a9 40 lda #(vertical_shooting_bullet_mode|%01000000) 4217 9105 85 47 sta temp6 4218 9107 4219 9107 20 93 f2 jsr plotsprite 4220 910a . 4221 910a ;; 4222 910a 4223 910a .L0345 ;; plotsprite vertical_shooting_powerup 3 power_upX power_upY 4224 910a 4225 910a a9 33 lda #vertical_shooting_powerup 4229 9110 85 43 sta temp2 4230 9112 4231 9112 a9 7e lda #(96|vertical_shooting_powerup_width_twoscompliment) 4232 9114 85 44 sta temp3 4233 9116 4234 9116 ad 6c 01 lda power_upX 4235 9119 85 45 sta temp4 4236 911b 4237 911b ad 6d 01 lda power_upY 4238 911e 4239 911e 85 46 sta temp5 4240 9120 4241 9120 a9 40 lda #(vertical_shooting_powerup_mode|%01000000) 4242 9122 85 47 sta temp6 4243 9124 4244 9124 20 93 f2 jsr plotsprite 4245 9127 .L0346 ;; plotsprite vertical_shooting_enemy01 2 enemy01_xpos enemy01_ypos 4246 9127 4247 9127 a9 35 lda #vertical_shooting_enemy01 4251 912d 85 43 sta temp2 4252 912f 4253 912f a9 5e lda #(64|vertical_shooting_enemy01_width_twoscompliment) 4254 9131 85 44 sta temp3 4255 9133 4256 9133 ad 59 01 lda enemy01_xpos 4257 9136 85 45 sta temp4 4258 9138 4259 9138 ad 5a 01 lda enemy01_ypos 4260 913b 4261 913b 85 46 sta temp5 4262 913d 4263 913d a9 40 lda #(vertical_shooting_enemy01_mode|%01000000) 4264 913f 85 47 sta temp6 4265 9141 4266 9141 20 93 f2 jsr plotsprite 4267 9144 ; +tall sprite replot 4268 9144 18 clc 4269 9145 a5 42 lda temp1 4270 9147 69 02 adc #vertical_shooting_enemy01_width 4271 9149 85 42 sta temp1 4272 914b a5 46 lda temp5 4273 914d 69 08 adc #WZONEHEIGHT 4274 914f 85 46 sta temp5 4275 9151 20 93 f2 jsr plotsprite 4276 9154 .L0347 ;; plotsprite vertical_shooting_1up 0 extra_shipX extra_shipY 4277 9154 4278 9154 a9 00 lda #vertical_shooting_1up 4282 915a 85 43 sta temp2 4283 915c 4284 915c a9 1e lda #(0|vertical_shooting_1up_width_twoscompliment) 4285 915e 85 44 sta temp3 4286 9160 4287 9160 ad 6f 01 lda extra_shipX 4288 9163 85 45 sta temp4 4289 9165 4290 9165 ad 70 01 lda extra_shipY 4291 9168 4292 9168 85 46 sta temp5 4293 916a 4294 916a a9 40 lda #(vertical_shooting_1up_mode|%01000000) 4295 916c 85 47 sta temp6 4296 916e 4297 916e 20 93 f2 jsr plotsprite 4298 9171 .L0348 ;; plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 4299 9171 4300 9171 a9 02 lda #vertical_shooting_explosion_01 4312 9182 85 43 sta temp2 4313 9184 4314 9184 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 4315 9186 85 44 sta temp3 4316 9188 4317 9188 ad 41 01 lda playerX 4318 918b 85 45 sta temp4 4319 918d 4320 918d ad 42 01 lda playerY 4321 9190 85 46 sta temp5 4322 9192 4323 9192 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 4324 9194 85 47 sta temp6 4325 9196 4326 9196 20 93 f2 jsr plotsprite 4327 9199 ; +tall sprite replot 4328 9199 18 clc 4329 919a a5 42 lda temp1 4330 919c 69 02 adc #vertical_shooting_explosion_01_width 4331 919e 85 42 sta temp1 4332 91a0 a5 46 lda temp5 4333 91a2 69 08 adc #WZONEHEIGHT 4334 91a4 85 46 sta temp5 4335 91a6 20 93 f2 jsr plotsprite 4336 91a9 .L0349 ;; plotsprite vertical_shooting_explosion_01 3 enemy01_xpos enemy01_ypos explosion_aniframe 4337 91a9 4338 91a9 a9 02 lda #vertical_shooting_explosion_01 4350 91ba 85 43 sta temp2 4351 91bc 4352 91bc a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 4353 91be 85 44 sta temp3 4354 91c0 4355 91c0 ad 59 01 lda enemy01_xpos 4356 91c3 85 45 sta temp4 4357 91c5 4358 91c5 ad 5a 01 lda enemy01_ypos 4359 91c8 85 46 sta temp5 4360 91ca 4361 91ca a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 4362 91cc 85 47 sta temp6 4363 91ce 4364 91ce 20 93 f2 jsr plotsprite 4365 91d1 ; +tall sprite replot 4366 91d1 18 clc 4367 91d2 a5 42 lda temp1 4368 91d4 69 02 adc #vertical_shooting_explosion_01_width 4369 91d6 85 42 sta temp1 4370 91d8 a5 46 lda temp5 4371 91da 69 08 adc #WZONEHEIGHT 4372 91dc 85 46 sta temp5 4373 91de 20 93 f2 jsr plotsprite 4374 91e1 .L0350 ;; plotsprite vertical_shooting_laser 0 p_twinlaser1_x p_twinlaser1_y 4375 91e1 4376 91e1 a9 ba lda #vertical_shooting_laser 4380 91e7 85 43 sta temp2 4381 91e9 4382 91e9 a9 1f lda #(0|vertical_shooting_laser_width_twoscompliment) 4383 91eb 85 44 sta temp3 4384 91ed 4385 91ed ad 81 01 lda p_twinlaser1_x 4386 91f0 85 45 sta temp4 4387 91f2 4388 91f2 ad 85 01 lda p_twinlaser1_y 4389 91f5 4390 91f5 85 46 sta temp5 4391 91f7 4392 91f7 a9 40 lda #(vertical_shooting_laser_mode|%01000000) 4393 91f9 85 47 sta temp6 4394 91fb 4395 91fb 20 93 f2 jsr plotsprite 4396 91fe ; +tall sprite replot 4397 91fe 18 clc 4398 91ff a5 42 lda temp1 4399 9201 69 01 adc #vertical_shooting_laser_width 4400 9203 85 42 sta temp1 4401 9205 a5 46 lda temp5 4402 9207 69 08 adc #WZONEHEIGHT 4403 9209 85 46 sta temp5 4404 920b 20 93 f2 jsr plotsprite 4405 920e .L0351 ;; if player_Flag = 1 then plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 4406 920e 4407 920e ad 5b 01 LDA player_Flag 4408 9211 c9 01 CMP #1 4409 9213 d0 38 BNE .skipL0351 4410 9215 .condpart126 4411 9215 a9 02 lda #vertical_shooting_explosion_01 4423 9226 85 43 sta temp2 4424 9228 4425 9228 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 4426 922a 85 44 sta temp3 4427 922c 4428 922c ad 41 01 lda playerX 4429 922f 85 45 sta temp4 4430 9231 4431 9231 ad 42 01 lda playerY 4432 9234 85 46 sta temp5 4433 9236 4434 9236 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 4435 9238 85 47 sta temp6 4436 923a 4437 923a 20 93 f2 jsr plotsprite 4438 923d ; +tall sprite replot 4439 923d 18 clc 4440 923e a5 42 lda temp1 4441 9240 69 02 adc #vertical_shooting_explosion_01_width 4442 9242 85 42 sta temp1 4443 9244 a5 46 lda temp5 4444 9246 69 08 adc #WZONEHEIGHT 4445 9248 85 46 sta temp5 4446 924a 20 93 f2 jsr plotsprite 4447 924d .skipL0351 4448 924d .L0352 ;; if enemy01_Flag = 1 then plotsprite vertical_shooting_explosion_01 3 enemy01_xpos enemy01_ypos explosion_aniframe 4449 924d 4450 924d ad 5c 01 LDA enemy01_Flag 4451 9250 c9 01 CMP #1 4452 9252 d0 38 BNE .skipL0352 4453 9254 .condpart127 4454 9254 a9 02 lda #vertical_shooting_explosion_01 4466 9265 85 43 sta temp2 4467 9267 4468 9267 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 4469 9269 85 44 sta temp3 4470 926b 4471 926b ad 59 01 lda enemy01_xpos 4472 926e 85 45 sta temp4 4473 9270 4474 9270 ad 5a 01 lda enemy01_ypos 4475 9273 85 46 sta temp5 4476 9275 4477 9275 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 4478 9277 85 47 sta temp6 4479 9279 4480 9279 20 93 f2 jsr plotsprite 4481 927c ; +tall sprite replot 4482 927c 18 clc 4483 927d a5 42 lda temp1 4484 927f 69 02 adc #vertical_shooting_explosion_01_width 4485 9281 85 42 sta temp1 4486 9283 a5 46 lda temp5 4487 9285 69 08 adc #WZONEHEIGHT 4488 9287 85 46 sta temp5 4489 9289 20 93 f2 jsr plotsprite 4490 928c .skipL0352 4491 928c .L0353 ;; return 4492 928c 4493 928c ba tsx 4494 928d bd 02 01 lda $102,x 4495 9290 f0 01 beq bankswitchret29 4496 9292 60 RTS 4497 9293 bankswitchret29 4498 9293 4c 72 f4 JMP BS_return 4499 9296 . 4500 9296 ;; 4501 9296 4502 9296 .L0354 ;; data sfx_bling 4503 9296 4504 9296 4c cf 92 JMP .skipL0354 4505 9299 sfx_bling 4506 9299 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4507 929c 4508 929c 1c 04 07 .byte.b $1c,$04,$07 4509 929f 4510 929f 1b 04 07 .byte.b $1b,$04,$07 4511 92a2 4512 92a2 04 0f 05 .byte.b $04,$0f,$05 4513 92a5 4514 92a5 15 04 09 .byte.b $15,$04,$09 4515 92a8 4516 92a8 16 04 07 .byte.b $16,$04,$07 4517 92ab 4518 92ab 03 0f 04 .byte.b $03,$0f,$04 4519 92ae 4520 92ae 11 04 08 .byte.b $11,$04,$08 4521 92b1 4522 92b1 11 04 08 .byte.b $11,$04,$08 4523 92b4 4524 92b4 11 04 04 .byte.b $11,$04,$04 4525 92b7 4526 92b7 0e 04 09 .byte.b $0e,$04,$09 4527 92ba 4528 92ba 0e 04 07 .byte.b $0e,$04,$07 4529 92bd 4530 92bd 0e 04 04 .byte.b $0e,$04,$04 4531 92c0 4532 92c0 1c 04 07 .byte.b $1c,$04,$07 4533 92c3 4534 92c3 1b 04 05 .byte.b $1b,$04,$05 4535 92c6 4536 92c6 1c 04 04 .byte.b $1c,$04,$04 4537 92c9 4538 92c9 1b 04 02 .byte.b $1b,$04,$02 4539 92cc 4540 92cc 00 00 00 .byte.b $00,$00,$00 4541 92cf 4542 92cf .skipL0354 4543 92cf sfx_bling_lo SET #sfx_bling 4545 92cf . 4546 92cf ;; 4547 92cf 4548 92cf .L0355 ;; data sfx_pulsecannon 4549 92cf 4550 92cf 4c 26 93 JMP .skipL0355 4551 92d2 sfx_pulsecannon 4552 92d2 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4553 92d5 4554 92d5 1e 0c 0a .byte.b $1e,$0c,$0a ; first chunk of freq,channel,volume 4555 92d8 4556 92d8 07 06 0f .byte.b $07,$06,$0f 4557 92db 4558 92db 07 06 0f .byte.b $07,$06,$0f 4559 92de 4560 92de 1e 06 0f .byte.b $1e,$06,$0f 4561 92e1 4562 92e1 17 0c 0b .byte.b $17,$0c,$0b 4563 92e4 4564 92e4 1b 0c 0b .byte.b $1b,$0c,$0b 4565 92e7 4566 92e7 1e 0c 0f .byte.b $1e,$0c,$0f 4567 92ea 4568 92ea 07 06 0f .byte.b $07,$06,$0f 4569 92ed 4570 92ed 07 06 0f .byte.b $07,$06,$0f 4571 92f0 4572 92f0 1e 06 08 .byte.b $1e,$06,$08 4573 92f3 4574 92f3 17 0c 06 .byte.b $17,$0c,$06 4575 92f6 4576 92f6 1b 0c 0f .byte.b $1b,$0c,$0f 4577 92f9 4578 92f9 1e 0c 0f .byte.b $1e,$0c,$0f 4579 92fc 4580 92fc 07 06 0f .byte.b $07,$06,$0f 4581 92ff 4582 92ff 07 06 0f .byte.b $07,$06,$0f 4583 9302 4584 9302 0a 06 0a .byte.b $0a,$06,$0a 4585 9305 4586 9305 17 0c 0a .byte.b $17,$0c,$0a 4587 9308 4588 9308 1e 0c 04 .byte.b $1e,$0c,$04 4589 930b 4590 930b 1e 06 09 .byte.b $1e,$06,$09 4591 930e 4592 930e 1b 04 05 .byte.b $1b,$04,$05 4593 9311 4594 9311 07 06 0f .byte.b $07,$06,$0f 4595 9314 4596 9314 0a 06 09 .byte.b $0a,$06,$09 4597 9317 4598 9317 17 0c 0d .byte.b $17,$0c,$0d 4599 931a 4600 931a 1b 0c 09 .byte.b $1b,$0c,$09 4601 931d 4602 931d 0a 06 05 .byte.b $0a,$06,$05 4603 9320 4604 9320 17 0c 03 .byte.b $17,$0c,$03 4605 9323 4606 9323 00 00 00 .byte.b $00,$00,$00 4607 9326 4608 9326 .skipL0355 4609 9326 sfx_pulsecannon_lo SET #sfx_pulsecannon 4611 9326 . 4612 9326 ;; 4613 9326 4614 9326 .L0356 ;; data sfx_plainlaser 4615 9326 4616 9326 4c 59 93 JMP .skipL0356 4617 9329 sfx_plainlaser 4618 9329 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4619 932c 4620 932c 10 04 06 .byte.b $10,$04,$06 ; first chunk of freq,channel,volume 4621 932f 4622 932f 13 04 08 .byte.b $13,$04,$08 4623 9332 4624 9332 16 04 08 .byte.b $16,$04,$08 4625 9335 4626 9335 16 04 07 .byte.b $16,$04,$07 4627 9338 4628 9338 1c 04 09 .byte.b $1c,$04,$09 4629 933b 4630 933b 0b 0c 0f .byte.b $0b,$0c,$0f 4631 933e 4632 933e 0d 0c 0f .byte.b $0d,$0c,$0f 4633 9341 4634 9341 0e 0c 0f .byte.b $0e,$0c,$0f 4635 9344 4636 9344 0e 0c 0f .byte.b $0e,$0c,$0f 4637 9347 4638 9347 12 0c 0f .byte.b $12,$0c,$0f 4639 934a 4640 934a 03 06 0d .byte.b $03,$06,$0d 4641 934d 4642 934d 1e 0c 0a .byte.b $1e,$0c,$0a 4643 9350 4644 9350 1e 0c 0c .byte.b $1e,$0c,$0c 4645 9353 4646 9353 0a 06 04 .byte.b $0a,$06,$04 4647 9356 4648 9356 00 00 00 .byte.b $00,$00,$00 4649 9359 4650 9359 .skipL0356 4651 9359 sfx_plainlaser_lo SET #sfx_plainlaser 4653 9359 . 4654 9359 ;; 4655 9359 4656 9359 .L0357 ;; data sfx_explosion 4657 9359 4658 9359 4c ec 93 JMP .skipL0357 4659 935c sfx_explosion 4660 935c 10 10 00 .byte.b $10,$10,$00 4661 935f 4662 935f 01 08 02 .byte.b $01,$08,$02 4663 9362 4664 9362 0b 0c 05 .byte.b $0b,$0c,$05 4665 9365 4666 9365 04 06 08 .byte.b $04,$06,$08 4667 9368 4668 9368 03 0e 0f .byte.b $03,$0e,$0f 4669 936b 4670 936b 09 06 0f .byte.b $09,$06,$0f 4671 936e 4672 936e 0d 06 0f .byte.b $0d,$06,$0f 4673 9371 4674 9371 04 0e 0f .byte.b $04,$0e,$0f 4675 9374 4676 9374 0f 06 08 .byte.b $0f,$06,$08 4677 9377 4678 9377 09 06 04 .byte.b $09,$06,$04 4679 937a 4680 937a 16 01 03 .byte.b $16,$01,$03 4681 937d 4682 937d 0c 06 04 .byte.b $0c,$06,$04 4683 9380 4684 9380 09 06 05 .byte.b $09,$06,$05 4685 9383 4686 9383 0a 06 03 .byte.b $0a,$06,$03 4687 9386 4688 9386 09 06 05 .byte.b $09,$06,$05 4689 9389 4690 9389 0d 06 08 .byte.b $0d,$06,$08 4691 938c 4692 938c 09 06 04 .byte.b $09,$06,$04 4693 938f 4694 938f 04 0e 06 .byte.b $04,$0e,$06 4695 9392 4696 9392 0f 06 05 .byte.b $0f,$06,$05 4697 9395 4698 9395 0f 06 07 .byte.b $0f,$06,$07 4699 9398 4700 9398 04 0e 07 .byte.b $04,$0e,$07 4701 939b 4702 939b 08 06 06 .byte.b $08,$06,$06 4703 939e 4704 939e 03 0e 08 .byte.b $03,$0e,$08 4705 93a1 4706 93a1 0f 06 06 .byte.b $0f,$06,$06 4707 93a4 4708 93a4 09 06 05 .byte.b $09,$06,$05 4709 93a7 4710 93a7 06 06 05 .byte.b $06,$06,$05 4711 93aa 4712 93aa 03 0e 05 .byte.b $03,$0e,$05 4713 93ad 4714 93ad 0e 06 06 .byte.b $0e,$06,$06 4715 93b0 4716 93b0 02 0e 05 .byte.b $02,$0e,$05 4717 93b3 4718 93b3 0f 06 03 .byte.b $0f,$06,$03 4719 93b6 4720 93b6 0e 06 06 .byte.b $0e,$06,$06 4721 93b9 4722 93b9 09 06 05 .byte.b $09,$06,$05 4723 93bc 4724 93bc 0c 06 05 .byte.b $0c,$06,$05 4725 93bf 4726 93bf 0f 06 03 .byte.b $0f,$06,$03 4727 93c2 4728 93c2 04 0e 08 .byte.b $04,$0e,$08 4729 93c5 4730 93c5 0c 06 03 .byte.b $0c,$06,$03 4731 93c8 4732 93c8 0f 06 03 .byte.b $0f,$06,$03 4733 93cb 4734 93cb 0c 06 06 .byte.b $0c,$06,$06 4735 93ce 4736 93ce 0f 06 04 .byte.b $0f,$06,$04 4737 93d1 4738 93d1 0f 06 05 .byte.b $0f,$06,$05 4739 93d4 4740 93d4 0f 06 03 .byte.b $0f,$06,$03 4741 93d7 4742 93d7 0a 06 04 .byte.b $0a,$06,$04 4743 93da 4744 93da 0f 06 03 .byte.b $0f,$06,$03 4745 93dd 4746 93dd 08 06 03 .byte.b $08,$06,$03 4747 93e0 4748 93e0 0c 06 03 .byte.b $0c,$06,$03 4749 93e3 4750 93e3 0e 06 03 .byte.b $0e,$06,$03 4751 93e6 4752 93e6 08 06 03 .byte.b $08,$06,$03 4753 93e9 4754 93e9 00 00 00 .byte.b $00,$00,$00 4755 93ec 4756 93ec .skipL0357 4757 93ec sfx_explosion_lo SET #sfx_explosion 4759 93ec DMAHOLEEND0 SET . 4760 93ec gameend 4761 93ec DMAHOLEEND0 SET . 3092 bytes of ROM space left in the main area of bank 1. 4762 93ec echo " ",[($A000 - .)]d , "bytes of ROM space left in the main area of bank 1." 4763 93ec - if ($A000 - .) < 0 4764 93ec -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 4765 93ec endif 4766 93ec 4767 a000 ORG $A000,0 ; ************* 4768 a000 4769 a000 RORG $A000 ; ************* 4770 a000 4771 a000 vertical_shooting_font 4772 a000 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4773 a020 00 00 00 00* HEX 00000000000000000000000000 4774 a02d vertical_shooting_ship 4775 a02d 07 d0 HEX 07d0 4776 a02f vertical_shooting_ship_tallsprite_00 4777 a02f 80 02 HEX 8002 4778 a031 vertical_shooting_bullet 4779 a031 28 HEX 28 4780 a032 vertical_shooting_enemyshot 4781 a032 00 HEX 00 4782 a033 vertical_shooting_powerup 4783 a033 28 00 HEX 2800 4784 a035 vertical_shooting_enemy01 4785 a035 09 e0 HEX 09e0 4786 a037 vertical_shooting_enemy01_tallsprite_00 4787 a037 40 03 HEX 4003 4788 a039 4789 a100 ORG $A100,0 ; ************* 4790 a100 4791 a100 RORG $A100 ; ************* 4792 a100 4793 a100 ;vertical_shooting_font 4794 a100 00 54 54 54* HEX 0054545454045454045404445054505440544454104454444410401444501014 4795 a120 10 44 44 10* HEX 10444410544040101040400000 4796 a12d ;vertical_shooting_ship 4797 a12d 07 d0 HEX 07d0 4798 a12f ;vertical_shooting_ship_tallsprite_00 4799 a12f 80 02 HEX 8002 4800 a131 ;vertical_shooting_bullet 4801 a131 28 HEX 28 4802 a132 ;vertical_shooting_enemyshot 4803 a132 88 HEX 88 4804 a133 ;vertical_shooting_powerup 4805 a133 78 08 HEX 7808 4806 a135 ;vertical_shooting_enemy01 4807 a135 09 e0 HEX 09e0 4808 a137 ;vertical_shooting_enemy01_tallsprite_00 4809 a137 50 0f HEX 500f 4810 a139 4811 a200 ORG $A200,0 ; ************* 4812 a200 4813 a200 RORG $A200 ; ************* 4814 a200 4815 a200 ;vertical_shooting_font 4816 a200 00 44 10 40* HEX 0044104004040444044404444440444040444410444440444444404444041044 4817 a220 10 54 44 10* HEX 10544410400010000000100000 4818 a22d ;vertical_shooting_ship 4819 a22d 03 c0 HEX 03c0 4820 a22f ;vertical_shooting_ship_tallsprite_00 4821 a22f a1 4a HEX a14a 4822 a231 ;vertical_shooting_bullet 4823 a231 3c HEX 3c 4824 a232 ;vertical_shooting_enemyshot 4825 a232 10 HEX 10 4826 a233 ;vertical_shooting_powerup 4827 a233 78 1e HEX 781e 4828 a235 ;vertical_shooting_enemy01 4829 a235 19 ec HEX 19ec 4830 a237 ;vertical_shooting_enemy01_tallsprite_00 4831 a237 5a af HEX 5aaf 4832 a239 4833 a300 ORG $A300,0 ; ************* 4834 a300 4835 a300 RORG $A300 ; ************* 4836 a300 4837 a300 ;vertical_shooting_font 4838 a300 00 44 10 40* HEX 0044104004040444044404444440444040444410044440444444404444041044 4839 a320 54 54 44 10* HEX 54544410100000101000000000 4840 a32d ;vertical_shooting_ship 4841 a32d 01 40 HEX 0140 4842 a32f ;vertical_shooting_ship_tallsprite_00 4843 a32f a5 5a HEX a55a 4844 a331 ;vertical_shooting_bullet 4845 a331 3c HEX 3c 4846 a332 ;vertical_shooting_enemyshot 4847 a332 74 HEX 74 4848 a333 ;vertical_shooting_powerup 4849 a333 7a a4 HEX 7aa4 4850 a335 ;vertical_shooting_enemy01 4851 a335 59 ef HEX 59ef 4852 a337 ;vertical_shooting_enemy01_tallsprite_00 4853 a337 59 ef HEX 59ef 4854 a339 4855 a400 ORG $A400,0 ; ************* 4856 a400 4857 a400 RORG $A400 ; ************* 4858 a400 4859 a400 ;vertical_shooting_font 4860 a400 00 44 10 54* HEX 0044105454545454045454545040445454445410045040544444504450101044 4861 a420 44 44 10 10* HEX 44441010100000101000000000 4862 a42d ;vertical_shooting_ship 4863 a42d 01 40 HEX 0140 4864 a42f ;vertical_shooting_ship_tallsprite_00 4865 a42f a5 5a HEX a55a 4866 a431 ;vertical_shooting_bullet 4867 a431 14 HEX 14 4868 a432 ;vertical_shooting_enemyshot 4869 a432 74 HEX 74 4870 a433 ;vertical_shooting_powerup 4871 a433 75 7a HEX 757a 4872 a435 ;vertical_shooting_enemy01 4873 a435 59 6f HEX 596f 4874 a437 ;vertical_shooting_enemy01_tallsprite_00 4875 a437 59 ef HEX 59ef 4876 a439 4877 a500 ORG $A500,0 ; ************* 4878 a500 4879 a500 RORG $A500 ; ************* 4880 a500 4881 a500 ;vertical_shooting_font 4882 a500 00 44 10 04* HEX 0044100404444040044444444440444040404410044440544444444444401044 4883 a520 44 44 44 54* HEX 44444454100000041000000000 4884 a52d ;vertical_shooting_ship 4885 a52d 01 40 HEX 0140 4886 a52f ;vertical_shooting_ship_tallsprite_00 4887 a52f a5 5a HEX a55a 4888 a531 ;vertical_shooting_bullet 4889 a531 14 HEX 14 4890 a532 ;vertical_shooting_enemyshot 4891 a532 74 HEX 74 4892 a533 ;vertical_shooting_powerup 4893 a533 78 1e HEX 781e 4894 a535 ;vertical_shooting_enemy01 4895 a535 5a af HEX 5aaf 4896 a537 ;vertical_shooting_enemy01_tallsprite_00 4897 a537 19 ec HEX 19ec 4898 a539 4899 a600 ORG $A600,0 ; ************* 4900 a600 4901 a600 RORG $A600 ; ************* 4902 a600 4903 a600 ;vertical_shooting_font 4904 a600 00 44 50 04* HEX 0044500404444040044444444440444040404410044440544444444444401044 4905 a620 44 44 44 44* HEX 44444444040000441000001044 4906 a62d ;vertical_shooting_ship 4907 a62d 01 40 HEX 0140 4908 a62f ;vertical_shooting_ship_tallsprite_00 4909 a62f a7 da HEX a7da 4910 a631 ;vertical_shooting_bullet 4911 a631 14 HEX 14 4912 a632 ;vertical_shooting_enemyshot 4913 a632 10 HEX 10 4914 a633 ;vertical_shooting_powerup 4915 a633 7a bc HEX 7abc 4916 a635 ;vertical_shooting_enemy01 4917 a635 50 07 HEX 5007 4918 a637 ;vertical_shooting_enemy01_tallsprite_00 4919 a637 09 e0 HEX 09e0 4920 a639 4921 a700 ORG $A700,0 ; ************* 4922 a700 4923 a700 RORG $A700 ; ************* 4924 a700 4925 a700 ;vertical_shooting_font 4926 a700 00 54 10 54* HEX 0054105454445454545454545054505454544454044440445010501050145444 4927 a720 44 44 44 44* HEX 44444444540000101040401044 4928 a72d ;vertical_shooting_ship 4929 a72d 01 40 HEX 0140 4930 a72f ;vertical_shooting_ship_tallsprite_00 4931 a72f 27 d8 HEX 27d8 4932 a731 ;vertical_shooting_bullet 4933 a731 00 HEX 00 4934 a732 ;vertical_shooting_enemyshot 4935 a732 88 HEX 88 4936 a733 ;vertical_shooting_powerup 4937 a733 55 50 HEX 5550 4938 a735 ;vertical_shooting_enemy01 4939 a735 40 01 HEX 4001 4940 a737 ;vertical_shooting_enemy01_tallsprite_00 4941 a737 09 e0 HEX 09e0 4942 a739 4943 a800 ORG $A800,0 ; ************* 4944 a800 4945 a800 RORG $A800 ; ************* 4946 a800 4947 b000 ORG $B000,0 ; ************* 4948 b000 4949 b000 RORG $B000 ; ************* 4950 b000 4951 b000 vertical_shooting_1up 4952 b000 15 55 HEX 1555 4953 b002 vertical_shooting_explosion_01 4954 b002 02 80 HEX 0280 4955 b004 vertical_shooting_explosion_01_tallsprite_00 4956 b004 00 00 HEX 0000 4957 b006 vertical_shooting_explosion_02 4958 b006 05 50 HEX 0550 4959 b008 vertical_shooting_explosion_02_tallsprite_00 4960 b008 00 00 HEX 0000 4961 b00a vertical_shooting_explosion_03 4962 b00a 15 54 HEX 1554 4963 b00c vertical_shooting_explosion_03_tallsprite_00 4964 b00c 00 00 HEX 0000 4965 b00e vertical_shooting_explosion_04 4966 b00e 07 d0 HEX 07d0 4967 b010 vertical_shooting_explosion_04_tallsprite_00 4968 b010 00 00 HEX 0000 4969 b012 vertical_shooting_explosion_05 4970 b012 0c 30 HEX 0c30 4971 b014 vertical_shooting_explosion_05_tallsprite_00 4972 b014 01 40 HEX 0140 4973 b016 vertical_shooting_explosion_06 4974 b016 00 00 HEX 0000 4975 b018 vertical_shooting_explosion_06_tallsprite_00 4976 b018 01 40 HEX 0140 4977 b01a vertical_shooting_explosion_07 4978 b01a 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4979 b02e vertical_shooting_explosion_07_tallsprite_00 4980 b02e 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4981 b042 vertical_shooting_explosion_08 4982 b042 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4983 b056 vertical_shooting_explosion_08_tallsprite_00 4984 b056 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4985 b06a vertical_shooting_explosion_09 4986 b06a 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4987 b07e vertical_shooting_explosion_09_tallsprite_00 4988 b07e 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4989 b092 vertical_shooting_explosion_10 4990 b092 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4991 b0a6 vertical_shooting_explosion_10_tallsprite_00 4992 b0a6 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4993 b0ba vertical_shooting_laser 4994 b0ba 88 HEX 88 4995 b0bb vertical_shooting_laser_tallsprite_00 4996 b0bb cc HEX cc 4997 b0bc 4998 b100 ORG $B100,0 ; ************* 4999 b100 5000 b100 RORG $B100 ; ************* 5001 b100 5002 b100 ;vertical_shooting_1up 5003 b100 ea a9 HEX eaa9 5004 b102 ;vertical_shooting_explosion_01 5005 b102 01 40 HEX 0140 5006 b104 ;vertical_shooting_explosion_01_tallsprite_00 5007 b104 00 00 HEX 0000 5008 b106 ;vertical_shooting_explosion_02 5009 b106 09 60 HEX 0960 5010 b108 ;vertical_shooting_explosion_02_tallsprite_00 5011 b108 00 00 HEX 0000 5012 b10a ;vertical_shooting_explosion_03 5013 b10a 25 58 HEX 2558 5014 b10c ;vertical_shooting_explosion_03_tallsprite_00 5015 b10c 00 00 HEX 0000 5016 b10e ;vertical_shooting_explosion_04 5017 b10e 05 50 HEX 0550 5018 b110 ;vertical_shooting_explosion_04_tallsprite_00 5019 b110 02 80 HEX 0280 5020 b112 ;vertical_shooting_explosion_05 5021 b112 0b e0 HEX 0be0 5022 b114 ;vertical_shooting_explosion_05_tallsprite_00 5023 b114 01 40 HEX 0140 5024 b116 ;vertical_shooting_explosion_06 5025 b116 0c 30 HEX 0c30 5026 b118 ;vertical_shooting_explosion_06_tallsprite_00 5027 b118 01 40 HEX 0140 5028 b11a ;vertical_shooting_explosion_07 5029 b11a 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5030 b12e ;vertical_shooting_explosion_07_tallsprite_00 5031 b12e 00 00 00 00* HEX 0000000000000140014001400140014001400000 5032 b142 ;vertical_shooting_explosion_08 5033 b142 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5034 b156 ;vertical_shooting_explosion_08_tallsprite_00 5035 b156 00 00 00 00* HEX 0000000000000140014001400140014001400000 5036 b16a ;vertical_shooting_explosion_09 5037 b16a 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5038 b17e ;vertical_shooting_explosion_09_tallsprite_00 5039 b17e 00 00 00 00* HEX 0000000000000140014001400140014001400000 5040 b192 ;vertical_shooting_explosion_10 5041 b192 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5042 b1a6 ;vertical_shooting_explosion_10_tallsprite_00 5043 b1a6 00 00 00 00* HEX 0000000000000140014001400140014001400000 5044 b1ba ;vertical_shooting_laser 5045 b1ba 88 HEX 88 5046 b1bb ;vertical_shooting_laser_tallsprite_00 5047 b1bb cc HEX cc 5048 b1bc 5049 b200 ORG $B200,0 ; ************* 5050 b200 5051 b200 RORG $B200 ; ************* 5052 b200 5053 b200 ;vertical_shooting_1up 5054 b200 d5 58 HEX d558 5055 b202 ;vertical_shooting_explosion_01 5056 b202 00 00 HEX 0000 5057 b204 ;vertical_shooting_explosion_01_tallsprite_00 5058 b204 00 00 HEX 0000 5059 b206 ;vertical_shooting_explosion_02 5060 b206 02 80 HEX 0280 5061 b208 ;vertical_shooting_explosion_02_tallsprite_00 5062 b208 00 00 HEX 0000 5063 b20a ;vertical_shooting_explosion_03 5064 b20a 09 60 HEX 0960 5065 b20c ;vertical_shooting_explosion_03_tallsprite_00 5066 b20c 00 00 HEX 0000 5067 b20e ;vertical_shooting_explosion_04 5068 b20e 05 50 HEX 0550 5069 b210 ;vertical_shooting_explosion_04_tallsprite_00 5070 b210 02 80 HEX 0280 5071 b212 ;vertical_shooting_explosion_05 5072 b212 0a a0 HEX 0aa0 5073 b214 ;vertical_shooting_explosion_05_tallsprite_00 5074 b214 05 50 HEX 0550 5075 b216 ;vertical_shooting_explosion_06 5076 b216 0b e0 HEX 0be0 5077 b218 ;vertical_shooting_explosion_06_tallsprite_00 5078 b218 05 50 HEX 0550 5079 b21a ;vertical_shooting_explosion_07 5080 b21a 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5081 b22e ;vertical_shooting_explosion_07_tallsprite_00 5082 b22e 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5083 b242 ;vertical_shooting_explosion_08 5084 b242 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5085 b256 ;vertical_shooting_explosion_08_tallsprite_00 5086 b256 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5087 b26a ;vertical_shooting_explosion_09 5088 b26a 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5089 b27e ;vertical_shooting_explosion_09_tallsprite_00 5090 b27e 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5091 b292 ;vertical_shooting_explosion_10 5092 b292 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5093 b2a6 ;vertical_shooting_explosion_10_tallsprite_00 5094 b2a6 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5095 b2ba ;vertical_shooting_laser 5096 b2ba 44 HEX 44 5097 b2bb ;vertical_shooting_laser_tallsprite_00 5098 b2bb cc HEX cc 5099 b2bc 5100 b300 ORG $B300,0 ; ************* 5101 b300 5102 b300 RORG $B300 ; ************* 5103 b300 5104 b300 ;vertical_shooting_1up 5105 b300 35 60 HEX 3560 5106 b302 ;vertical_shooting_explosion_01 5107 b302 00 00 HEX 0000 5108 b304 ;vertical_shooting_explosion_01_tallsprite_00 5109 b304 00 00 HEX 0000 5110 b306 ;vertical_shooting_explosion_02 5111 b306 00 00 HEX 0000 5112 b308 ;vertical_shooting_explosion_02_tallsprite_00 5113 b308 00 00 HEX 0000 5114 b30a ;vertical_shooting_explosion_03 5115 b30a 02 80 HEX 0280 5116 b30c ;vertical_shooting_explosion_03_tallsprite_00 5117 b30c 00 00 HEX 0000 5118 b30e ;vertical_shooting_explosion_04 5119 b30e 09 60 HEX 0960 5120 b310 ;vertical_shooting_explosion_04_tallsprite_00 5121 b310 09 60 HEX 0960 5122 b312 ;vertical_shooting_explosion_05 5123 b312 06 90 HEX 0690 5124 b314 ;vertical_shooting_explosion_05_tallsprite_00 5125 b314 06 90 HEX 0690 5126 b316 ;vertical_shooting_explosion_06 5127 b316 06 90 HEX 0690 5128 b318 ;vertical_shooting_explosion_06_tallsprite_00 5129 b318 06 90 HEX 0690 5130 b31a ;vertical_shooting_explosion_07 5131 b31a 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5132 b32e ;vertical_shooting_explosion_07_tallsprite_00 5133 b32e 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5134 b342 ;vertical_shooting_explosion_08 5135 b342 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5136 b356 ;vertical_shooting_explosion_08_tallsprite_00 5137 b356 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5138 b36a ;vertical_shooting_explosion_09 5139 b36a 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5140 b37e ;vertical_shooting_explosion_09_tallsprite_00 5141 b37e 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5142 b392 ;vertical_shooting_explosion_10 5143 b392 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5144 b3a6 ;vertical_shooting_explosion_10_tallsprite_00 5145 b3a6 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5146 b3ba ;vertical_shooting_laser 5147 b3ba 44 HEX 44 5148 b3bb ;vertical_shooting_laser_tallsprite_00 5149 b3bb cc HEX cc 5150 b3bc 5151 b400 ORG $B400,0 ; ************* 5152 b400 5153 b400 RORG $B400 ; ************* 5154 b400 5155 b400 ;vertical_shooting_1up 5156 b400 35 60 HEX 3560 5157 b402 ;vertical_shooting_explosion_01 5158 b402 00 00 HEX 0000 5159 b404 ;vertical_shooting_explosion_01_tallsprite_00 5160 b404 00 00 HEX 0000 5161 b406 ;vertical_shooting_explosion_02 5162 b406 00 00 HEX 0000 5163 b408 ;vertical_shooting_explosion_02_tallsprite_00 5164 b408 00 00 HEX 0000 5165 b40a ;vertical_shooting_explosion_03 5166 b40a 00 00 HEX 0000 5167 b40c ;vertical_shooting_explosion_03_tallsprite_00 5168 b40c 02 80 HEX 0280 5169 b40e ;vertical_shooting_explosion_04 5170 b40e 09 60 HEX 0960 5171 b410 ;vertical_shooting_explosion_04_tallsprite_00 5172 b410 09 60 HEX 0960 5173 b412 ;vertical_shooting_explosion_05 5174 b412 06 90 HEX 0690 5175 b414 ;vertical_shooting_explosion_05_tallsprite_00 5176 b414 06 90 HEX 0690 5177 b416 ;vertical_shooting_explosion_06 5178 b416 06 90 HEX 0690 5179 b418 ;vertical_shooting_explosion_06_tallsprite_00 5180 b418 06 90 HEX 0690 5181 b41a ;vertical_shooting_explosion_07 5182 b41a 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5183 b42e ;vertical_shooting_explosion_07_tallsprite_00 5184 b42e 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5185 b442 ;vertical_shooting_explosion_08 5186 b442 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5187 b456 ;vertical_shooting_explosion_08_tallsprite_00 5188 b456 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5189 b46a ;vertical_shooting_explosion_09 5190 b46a 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5191 b47e ;vertical_shooting_explosion_09_tallsprite_00 5192 b47e 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5193 b492 ;vertical_shooting_explosion_10 5194 b492 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5195 b4a6 ;vertical_shooting_explosion_10_tallsprite_00 5196 b4a6 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5197 b4ba ;vertical_shooting_laser 5198 b4ba 44 HEX 44 5199 b4bb ;vertical_shooting_laser_tallsprite_00 5200 b4bb cc HEX cc 5201 b4bc 5202 b500 ORG $B500,0 ; ************* 5203 b500 5204 b500 RORG $B500 ; ************* 5205 b500 5206 b500 ;vertical_shooting_1up 5207 b500 0d 80 HEX 0d80 5208 b502 ;vertical_shooting_explosion_01 5209 b502 00 00 HEX 0000 5210 b504 ;vertical_shooting_explosion_01_tallsprite_00 5211 b504 00 00 HEX 0000 5212 b506 ;vertical_shooting_explosion_02 5213 b506 00 00 HEX 0000 5214 b508 ;vertical_shooting_explosion_02_tallsprite_00 5215 b508 02 80 HEX 0280 5216 b50a ;vertical_shooting_explosion_03 5217 b50a 00 00 HEX 0000 5218 b50c ;vertical_shooting_explosion_03_tallsprite_00 5219 b50c 09 60 HEX 0960 5220 b50e ;vertical_shooting_explosion_04 5221 b50e 02 80 HEX 0280 5222 b510 ;vertical_shooting_explosion_04_tallsprite_00 5223 b510 05 50 HEX 0550 5224 b512 ;vertical_shooting_explosion_05 5225 b512 05 50 HEX 0550 5226 b514 ;vertical_shooting_explosion_05_tallsprite_00 5227 b514 0a a0 HEX 0aa0 5228 b516 ;vertical_shooting_explosion_06 5229 b516 05 50 HEX 0550 5230 b518 ;vertical_shooting_explosion_06_tallsprite_00 5231 b518 0b e0 HEX 0be0 5232 b51a ;vertical_shooting_explosion_07 5233 b51a 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5234 b52e ;vertical_shooting_explosion_07_tallsprite_00 5235 b52e 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5236 b542 ;vertical_shooting_explosion_08 5237 b542 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5238 b556 ;vertical_shooting_explosion_08_tallsprite_00 5239 b556 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5240 b56a ;vertical_shooting_explosion_09 5241 b56a 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5242 b57e ;vertical_shooting_explosion_09_tallsprite_00 5243 b57e 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5244 b592 ;vertical_shooting_explosion_10 5245 b592 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5246 b5a6 ;vertical_shooting_explosion_10_tallsprite_00 5247 b5a6 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5248 b5ba ;vertical_shooting_laser 5249 b5ba 44 HEX 44 5250 b5bb ;vertical_shooting_laser_tallsprite_00 5251 b5bb 88 HEX 88 5252 b5bc 5253 b600 ORG $B600,0 ; ************* 5254 b600 5255 b600 RORG $B600 ; ************* 5256 b600 5257 b600 ;vertical_shooting_1up 5258 b600 0d 80 HEX 0d80 5259 b602 ;vertical_shooting_explosion_01 5260 b602 00 00 HEX 0000 5261 b604 ;vertical_shooting_explosion_01_tallsprite_00 5262 b604 01 40 HEX 0140 5263 b606 ;vertical_shooting_explosion_02 5264 b606 00 00 HEX 0000 5265 b608 ;vertical_shooting_explosion_02_tallsprite_00 5266 b608 09 60 HEX 0960 5267 b60a ;vertical_shooting_explosion_03 5268 b60a 00 00 HEX 0000 5269 b60c ;vertical_shooting_explosion_03_tallsprite_00 5270 b60c 25 58 HEX 2558 5271 b60e ;vertical_shooting_explosion_04 5272 b60e 02 80 HEX 0280 5273 b610 ;vertical_shooting_explosion_04_tallsprite_00 5274 b610 05 50 HEX 0550 5275 b612 ;vertical_shooting_explosion_05 5276 b612 01 40 HEX 0140 5277 b614 ;vertical_shooting_explosion_05_tallsprite_00 5278 b614 0b e0 HEX 0be0 5279 b616 ;vertical_shooting_explosion_06 5280 b616 01 40 HEX 0140 5281 b618 ;vertical_shooting_explosion_06_tallsprite_00 5282 b618 0c 30 HEX 0c30 5283 b61a ;vertical_shooting_explosion_07 5284 b61a 00 00 00 00* HEX 0000000000000140014001400140014001400000 5285 b62e ;vertical_shooting_explosion_07_tallsprite_00 5286 b62e 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5287 b642 ;vertical_shooting_explosion_08 5288 b642 00 00 00 00* HEX 0000000000000140014001400140014001400000 5289 b656 ;vertical_shooting_explosion_08_tallsprite_00 5290 b656 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5291 b66a ;vertical_shooting_explosion_09 5292 b66a 00 00 00 00* HEX 0000000000000140014001400140014001400000 5293 b67e ;vertical_shooting_explosion_09_tallsprite_00 5294 b67e 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5295 b692 ;vertical_shooting_explosion_10 5296 b692 00 00 00 00* HEX 0000000000000140014001400140014001400000 5297 b6a6 ;vertical_shooting_explosion_10_tallsprite_00 5298 b6a6 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5299 b6ba ;vertical_shooting_laser 5300 b6ba 44 HEX 44 5301 b6bb ;vertical_shooting_laser_tallsprite_00 5302 b6bb 88 HEX 88 5303 b6bc 5304 b700 ORG $B700,0 ; ************* 5305 b700 5306 b700 RORG $B700 ; ************* 5307 b700 5308 b700 ;vertical_shooting_1up 5309 b700 03 00 HEX 0300 5310 b702 ;vertical_shooting_explosion_01 5311 b702 00 00 HEX 0000 5312 b704 ;vertical_shooting_explosion_01_tallsprite_00 5313 b704 02 80 HEX 0280 5314 b706 ;vertical_shooting_explosion_02 5315 b706 00 00 HEX 0000 5316 b708 ;vertical_shooting_explosion_02_tallsprite_00 5317 b708 05 50 HEX 0550 5318 b70a ;vertical_shooting_explosion_03 5319 b70a 00 00 HEX 0000 5320 b70c ;vertical_shooting_explosion_03_tallsprite_00 5321 b70c 15 54 HEX 1554 5322 b70e ;vertical_shooting_explosion_04 5323 b70e 00 00 HEX 0000 5324 b710 ;vertical_shooting_explosion_04_tallsprite_00 5325 b710 07 d0 HEX 07d0 5326 b712 ;vertical_shooting_explosion_05 5327 b712 01 40 HEX 0140 5328 b714 ;vertical_shooting_explosion_05_tallsprite_00 5329 b714 0c 30 HEX 0c30 5330 b716 ;vertical_shooting_explosion_06 5331 b716 01 40 HEX 0140 5332 b718 ;vertical_shooting_explosion_06_tallsprite_00 5333 b718 00 00 HEX 0000 5334 b71a ;vertical_shooting_explosion_07 5335 b71a 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5336 b72e ;vertical_shooting_explosion_07_tallsprite_00 5337 b72e 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5338 b742 ;vertical_shooting_explosion_08 5339 b742 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5340 b756 ;vertical_shooting_explosion_08_tallsprite_00 5341 b756 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5342 b76a ;vertical_shooting_explosion_09 5343 b76a 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5344 b77e ;vertical_shooting_explosion_09_tallsprite_00 5345 b77e 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5346 b792 ;vertical_shooting_explosion_10 5347 b792 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5348 b7a6 ;vertical_shooting_explosion_10_tallsprite_00 5349 b7a6 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5350 b7ba ;vertical_shooting_laser 5351 b7ba 44 HEX 44 5352 b7bb ;vertical_shooting_laser_tallsprite_00 5353 b7bb 88 HEX 88 5354 b7bc 5355 b800 ORG $B800,0 ; ************* 5356 b800 5357 b800 RORG $B800 ; ************* 5358 b800 - if SPACEOVERFLOW > 0 5359 b800 - echo "" 5360 b800 - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 5361 b800 - echo "######## look above for areas with negative ROM space left." 5362 b800 - echo "######## Aborting assembly." 5363 b800 - ERR 5364 b800 endif 5365 b800 5366 b800 5367 b800 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5368 b800 5369 b800 - ifnconst bankswitchmode 5370 b800 - if ( * < $f000 ) 5371 b800 - ORG $F000 5372 b800 - endif 5373 b800 else 5374 b800 ifconst ROM128K 5375 b800 if ( * < $f000 ) 5376 27000 ORG $27000 5377 27000 RORG $F000 5378 27000 endif 5379 27000 endif 5380 27000 - ifconst ROM144K 5381 27000 - if ( * < $f000 ) 5382 27000 - ORG $27000 5383 27000 - RORG $F000 5384 27000 - endif 5385 27000 endif 5386 27000 - ifconst ROM256K 5387 27000 - if ( * < $f000 ) 5388 27000 - ORG $47000 5389 27000 - RORG $F000 5390 27000 - endif 5391 27000 endif 5392 27000 - ifconst ROM272K 5393 27000 - if ( * < $f000 ) 5394 27000 - ORG $47000 5395 27000 - RORG $F000 5396 27000 - endif 5397 27000 endif 5398 27000 - ifconst ROM512K 5399 27000 - if ( * < $f000 ) 5400 27000 - ORG $87000 5401 27000 - RORG $F000 5402 27000 - endif 5403 27000 endif 5404 27000 - ifconst ROM528K 5405 27000 - if ( * < $f000 ) 5406 27000 - ORG $87000 5407 27000 - RORG $F000 5408 27000 - endif 5409 27000 endif 5410 27000 endif 5411 27000 5412 27000 ; all of these "modules" have conditional clauses in them, so even though 5413 27000 ; they're always included here, they don't take up rom unless the user 5414 27000 ; explicitly enables support for the feature. 5415 27000 5416 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_Rewrite4.78b.asm 5418 27000 endif 5419 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_Rewrite4.78b.asm 5421 27000 endif 5422 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_Rewrite4.78b.asm 5424 27000 endif 5425 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_Rewrite4.78b.asm 5427 27000 endif 5428 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5429 27000 5430 27000 ;standard routimes needed for pretty much all games 5431 27000 5432 27000 ; some definitions used with "set debug color" 5433 27000 00 91 DEBUGCALC = $91 5434 27000 00 41 DEBUGWASTE = $41 5435 27000 00 c1 DEBUGDRAW = $C1 5436 27000 5437 27000 ;NMI and IRQ handlers 5438 27000 NMI 5439 27000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 5440 27000 48 pha ; save A 5441 27001 d8 cld 5442 27002 a5 4d lda visibleover 5443 27004 49 ff eor #255 5444 27006 85 4d sta visibleover 5445 27008 - ifconst DEBUGINTERRUPT 5446 27008 - and #$93 5447 27008 - sta BACKGRND 5448 27008 endif 5449 27008 8a txa ; save X 5450 27009 48 pha 5451 2700a 98 tya ; save Y 5452 2700b 48 pha 5453 2700c ce b2 01 dec interruptindex 5454 2700f d0 03 bne skipreallyoffvisible 5455 27011 4c 6b f0 jmp reallyoffvisible 5456 27014 skipreallyoffvisible 5457 27014 a5 4d lda visibleover 5458 27016 d0 03 bne carryontopscreenroutine 5459 27018 - ifconst .bottomscreenroutine 5460 27018 - lda interrupthold 5461 27018 - beq skipbottomroutine 5462 27018 - jsr .bottomscreenroutine 5463 27018 -skipbottomroutine 5464 27018 endif 5465 27018 4c 79 f0 jmp NMIexit 5466 2701b carryontopscreenroutine 5467 2701b - ifconst .topscreenroutine 5468 2701b - lda interrupthold 5469 2701b - beq skiptoproutine 5470 2701b - jsr .topscreenroutine 5471 2701b -skiptoproutine 5472 2701b endif 5473 2701b ifnconst CANARYOFF 5474 2701b ad c1 01 lda canary 5475 2701e f0 07 beq skipcanarytriggered 5476 27020 a9 45 lda #$45 5477 27022 85 20 sta BACKGRND 5478 27024 4c 63 f0 jmp skipbrkolorset ; common crash dump routine, if available 5479 27027 skipcanarytriggered 5480 27027 endif 5481 27027 5482 27027 ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 5483 2702a 5484 2702a ; ** Other important routines that need to regularly run, and can run onscreen. 5485 2702a ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 5486 2702a 5487 2702a - ifconst LONGCONTROLLERREAD 5488 2702a -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 5489 2702a - ldy port1control 5490 2702a - lda longreadtype,y 5491 2702a - beq LLRET1 5492 2702a - tay 5493 2702a - lda longreadroutinehiP1,y 5494 2702a - sta inttemp4 5495 2702a - lda longreadroutineloP1,y 5496 2702a - sta inttemp3 5497 2702a - jmp (inttemp3) 5498 2702a -LLRET1 5499 2702a - ldy port0control 5500 2702a - lda longreadtype,y 5501 2702a - beq LLRET0 5502 2702a - tay 5503 2702a - lda longreadroutinehiP0,y 5504 2702a - sta inttemp4 5505 2702a - lda longreadroutineloP0,y 5506 2702a - sta inttemp3 5507 2702a - jmp (inttemp3) 5508 2702a -LLRET0 5509 2702a - 5510 2702a - 5511 2702a - ifconst PADDLERANGE 5512 2702a -TIMEVAL = PADDLERANGE 5513 2702a - else 5514 2702a -TIMEVAL = 160 5515 2702a - endif 5516 2702a -TIMEOFFSET = 10 5517 2702a - 5518 2702a endif ; LONGCONTROLLERREAD 5519 2702a 5520 2702a 5521 2702a 20 d8 f1 jsr servicesfxchannels 5522 2702d - ifconst MUSICTRACKER 5523 2702d - jsr servicesong 5524 2702d endif ; MUSICTRACKER 5525 2702d 5526 2702d ee a4 01 inc framecounter 5527 27030 ad a4 01 lda framecounter 5528 27033 29 3f and #63 5529 27035 d0 08 bne skipcountdownseconds 5530 27037 ad a5 01 lda countdownseconds 5531 2703a f0 03 beq skipcountdownseconds 5532 2703c ce a5 01 dec countdownseconds 5533 2703f skipcountdownseconds 5534 2703f 5535 2703f a2 01 ldx #1 5536 27041 buttonreadloop 5537 27041 8a txa 5538 27042 48 pha 5539 27043 bc b7 01 ldy port0control,x 5540 27046 b9 bb f1 lda buttonhandlerlo,y 5541 27049 85 da sta inttemp3 5542 2704b b9 b0 f1 lda buttonhandlerhi,y 5543 2704e 85 db sta inttemp4 5544 27050 05 da ora inttemp3 5545 27052 f0 03 beq buttonreadloopreturn 5546 27054 6c da 00 jmp (inttemp3) 5547 27057 buttonreadloopreturn 5548 27057 68 pla 5549 27058 aa tax 5550 27059 ca dex 5551 2705a 10 e5 bpl buttonreadloop 5552 2705c 5553 2705c - ifconst KEYPADSUPPORT 5554 2705c - jsr keypadrowselect 5555 2705c endif ; KEYPADSUPPORT 5556 2705c 5557 2705c 5558 2705c - ifconst DOUBLEBUFFER 5559 2705c - lda doublebufferminimumframeindex 5560 2705c - beq skipdoublebufferminimumframeindexadjust 5561 2705c - dec doublebufferminimumframeindex 5562 2705c -skipdoublebufferminimumframeindexadjust 5563 2705c endif 5564 2705c 5565 2705c 4c 79 f0 jmp NMIexit 5566 2705f 5567 2705f IRQ ; the only source of non-nmi interrupt should be the BRK opcode. 5568 2705f ifnconst BREAKPROTECTOFF 5569 2705f a9 1a lda #$1A 5570 27061 85 20 sta BACKGRND 5571 27063 skipbrkolorset 5572 27063 skipbrkdetected 5573 27063 a9 60 lda #$60 5574 27065 8d 07 21 sta sCTRL 5575 27068 85 3c sta CTRL 5576 2706a ifnconst hiscorefont 5577 2706a 02 .byte.b $02 ; KIL/JAM 5578 2706b - else ; hiscorefont is present 5579 2706b - ifconst CRASHDUMP 5580 2706b - bit MSTAT 5581 2706b - bpl skipbrkdetected ; wait for vblank to ensure we're clear of NMI 5582 2706b - 5583 2706b - ifconst dumpbankswitch 5584 2706b - lda dumpbankswitch 5585 2706b - pha 5586 2706b - endif 5587 2706b - 5588 2706b - ; bankswitch if needed, to get to the hiscore font 5589 2706b - ifconst bankswitchmode 5590 2706b - ifconst included.hiscore.asm.bank 5591 2706b - ifconst MCPDEVCART 5592 2706b - lda #($18 | included.hiscore.asm.bank) 5593 2706b - sta $3000 5594 2706b - else 5595 2706b - lda #(included.hiscore.asm.bank) 5596 2706b - sta $8000 5597 2706b - endif 5598 2706b - endif ; included.hiscore.asm.bank 5599 2706b - endif ; bankswitchmode 5600 2706b - 5601 2706b - ifconst DOUBLEBUFFER 5602 2706b - ;turn off double-buffering, if on... 5603 2706b - lda #>DLLMEM 5604 2706b - sta DPPH 5605 2706b - lda #hiscorefont 5649 2706b - sta CHARBASE 5650 2706b - sta sCHARBASE 5651 2706b - lda #%01000011 ;Enable DMA, mode=320A 5652 2706b - sta CTRL 5653 2706b - sta sCTRL 5654 2706b - .byte $02 ; KIL/JAM 5655 2706b -hiscorehexlut 5656 2706b - ; 0 1 2 3 4 5 6 7 8 9 A B C D E F 5657 2706b - .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 5658 2706b -show2700 5659 2706b - ; lo mode hi width=29 x EODL 5660 2706b - .byte $00, %01100000, $27, 3, 20, 0,0,0 5661 2706b - else ; CRASHDUMP 5662 2706b - .byte $02 ; KIL/JAM 5663 2706b - endif ; crashdump 5664 2706b endif ; hiscorefont 5665 2706b - else 5666 2706b - RTI 5667 2706b endif 5668 2706b 5669 2706b - ifconst LONGCONTROLLERREAD 5670 2706b - 5671 2706b -longreadtype 5672 2706b - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 5673 2706b - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 5674 2706b - .byte 3, 3, 0 ; STMOUSE AMOUSE ATARIVOX 5675 2706b - 5676 2706b -longreadroutineloP0 5677 2706b - .byte LLRET0 ; 0 = no routine 5684 2706b - .byte >paddleport0update ; 1 = paddle 5685 2706b - .byte >trakball0update ; 2 = trackball 5686 2706b - .byte >mouse0update ; 3 = mouse 5687 2706b - 5688 2706b -longreadroutineloP1 5689 2706b - .byte LLRET1 ; 0 = no routine 5696 2706b - .byte >paddleport1update ; 1 = paddle 5697 2706b - .byte >trakball1update ; 2 = trackball 5698 2706b - .byte >mouse1update ; 3 = mouse 5699 2706b - 5700 2706b - 5701 2706b -SETTIM64T 5702 2706b - bne skipdefaulttime 5703 2706b - ifnconst PADDLESMOOTHINGOFF 5704 2706b - lda #(TIMEVAL+TIMEOFFSET+1) 5705 2706b - else 5706 2706b - lda #(TIMEVAL+TIMEOFFSET) 5707 2706b - endif 5708 2706b -skipdefaulttime 5709 2706b - tay 5710 2706b - dey 5711 2706b -.setTIM64Tloop 5712 2706b - sta TIM64T 5713 2706b - cpy INTIM 5714 2706b - bne .setTIM64Tloop 5715 2706b - rts 5716 2706b endif ; LONGCONTROLLERREAD 5717 2706b 5718 2706b reallyoffvisible 5719 2706b 85 24 sta WSYNC 5720 2706d 5721 2706d a9 00 lda #0 5722 2706f 85 4d sta visibleover 5723 27071 - ifconst DEBUGINTERRUPT 5724 27071 - sta BACKGRND 5725 27071 endif 5726 27071 5727 27071 a9 03 lda #3 5728 27073 8d b2 01 sta interruptindex 5729 27076 5730 27076 20 52 f1 jsr uninterruptableroutines 5731 27079 5732 27079 - ifconst .userinterrupt 5733 27079 - lda interrupthold 5734 27079 - beq skipuserintroutine 5735 27079 - jsr .userinterrupt 5736 27079 -skipuserintroutine 5737 27079 endif 5738 27079 5739 27079 - ifconst KEYPADSUPPORT 5740 27079 - jsr keypadcolumnread 5741 27079 endif 5742 27079 5743 27079 NMIexit 5744 27079 68 pla 5745 2707a a8 tay 5746 2707b 68 pla 5747 2707c aa tax 5748 2707d 68 pla 5749 2707e 40 RTI 5750 2707f 5751 2707f clearscreen 5752 2707f a2 17 ldx #(WZONECOUNT-1) 5753 27081 a9 00 lda #0 5754 27083 clearscreenloop 5755 27083 95 65 sta dlend,x 5756 27085 ca dex 5757 27086 10 fb bpl clearscreenloop 5758 27088 a9 00 lda #0 5759 2708a 8d ad 01 sta valbufend ; clear the bcd value buffer 5760 2708d 8d ae 01 sta valbufendsave 5761 27090 60 rts 5762 27091 5763 27091 restorescreen 5764 27091 a2 17 ldx #(WZONECOUNT-1) 5765 27093 a9 00 lda #0 5766 27095 restorescreenloop 5767 27095 b5 82 lda dlendsave,x 5768 27097 95 65 sta dlend,x 5769 27099 ca dex 5770 2709a 10 f9 bpl restorescreenloop 5771 2709c ad ae 01 lda valbufendsave 5772 2709f 8d ad 01 sta valbufend 5773 270a2 60 rts 5774 270a3 5775 270a3 savescreen 5776 270a3 a2 17 ldx #(WZONECOUNT-1) 5777 270a5 savescreenloop 5778 270a5 b5 65 lda dlend,x 5779 270a7 95 82 sta dlendsave,x 5780 270a9 ca dex 5781 270aa 10 f9 bpl savescreenloop 5782 270ac ad ad 01 lda valbufend 5783 270af 8d ae 01 sta valbufendsave 5784 270b2 - ifconst DOUBLEBUFFER 5785 270b2 - lda doublebufferstate 5786 270b2 - beq savescreenrts 5787 270b2 - lda #1 5788 270b2 - sta doublebufferbufferdirty 5789 270b2 -savescreenrts 5790 270b2 endif ; DOUBLEBUFFER 5791 270b2 60 rts 5792 270b3 5793 270b3 drawscreen 5794 270b3 5795 270b3 - ifconst interrupthold 5796 270b3 - lda #$FF 5797 270b3 - sta interrupthold ; if the user called drawscreen, we're ready for interrupts 5798 270b3 endif 5799 270b3 5800 270b3 a9 00 lda #0 5801 270b5 85 42 sta temp1 ; not B&W if we're here... 5802 270b7 5803 270b7 drawscreenwait 5804 270b7 a5 4d lda visibleover 5805 270b9 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 5806 270bb 5807 270bb ;restore some registers in case the game changed them mid-screen... 5808 270bb ad 07 21 lda sCTRL 5809 270be 05 42 ora temp1 5810 270c0 85 3c sta CTRL 5811 270c2 ad 0b 21 lda sCHARBASE 5812 270c5 85 34 sta CHARBASE 5813 270c7 5814 270c7 ;ensure all of the display list is terminated... 5815 270c7 20 38 f1 jsr terminatedisplaylist 5816 270ca 5817 270ca ifnconst pauseroutineoff 5818 270ca 20 d5 f0 jsr pauseroutine 5819 270cd endif ; pauseroutineoff 5820 270cd 5821 270cd ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 5822 270cd ; delaying a full frame, but still allowing time for basic calculations. 5823 270cd visiblescreenstartedwait 5824 270cd a5 4d lda visibleover 5825 270cf f0 fc beq visiblescreenstartedwait 5826 270d1 visiblescreenstartedwaitdone 5827 270d1 ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 5828 270d4 60 rts 5829 270d5 5830 270d5 ifnconst pauseroutineoff 5831 270d5 ; check to see if pause was pressed and released 5832 270d5 pauseroutine 5833 270d5 ad b3 01 lda pausedisable 5834 270d8 d0 4e bne leavepauseroutine 5835 270da a9 08 lda #8 5836 270dc 2c 82 02 bit SWCHB 5837 270df f0 29 beq pausepressed 5838 270e1 5839 270e1 ifnconst SOFTRESETASPAUSEOFF 5840 270e1 ifnconst MOUSESUPPORT 5841 270e1 ifnconst TRAKBALLSUPPORT 5842 270e1 ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 5843 270e4 29 70 and #%01110000 ; _LDU 5844 270e6 f0 22 beq pausepressed 5845 270e8 endif 5846 270e8 endif 5847 270e8 endif 5848 270e8 5849 270e8 ;pause isn't pressed 5850 270e8 a9 00 lda #0 5851 270ea 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 5852 270ed 5853 270ed ;check if we're in an already paused state 5854 270ed ad 00 21 lda pausestate 5855 270f0 f0 36 beq leavepauseroutine ; nope, leave 5856 270f2 5857 270f2 c9 01 cmp #1 ; last frame was the start of pausing 5858 270f4 f0 2b beq enterpausestate2 ; move from state 1 to 2 5859 270f6 5860 270f6 c9 02 cmp #2 5861 270f8 f0 34 beq carryonpausing 5862 270fa 5863 270fa ;pausestate must be >2, which means we're ending an unpause 5864 270fa a9 00 lda #0 5865 270fc 8d ac 01 sta pausebuttonflag 5866 270ff 8d 00 21 sta pausestate 5867 27102 ad 07 21 lda sCTRL 5868 27105 85 3c sta CTRL 5869 27107 4c 28 f1 jmp leavepauseroutine 5870 2710a 5871 2710a pausepressed 5872 2710a ;pause is pressed 5873 2710a ad ac 01 lda pausebuttonflag 5874 2710d c9 ff cmp #$ff 5875 2710f f0 1d beq carryonpausing 5876 27111 5877 27111 ;its a new press, increment the state 5878 27111 ee 00 21 inc pausestate 5879 27114 5880 27114 ;silence volume at the start and end of pausing 5881 27114 a9 00 lda #0 5882 27116 85 19 sta AUDV0 5883 27118 85 1a sta AUDV1 5884 2711a 5885 2711a - ifconst pokeysupport 5886 2711a - ldy #7 5887 2711a -pausesilencepokeyaudioloop 5888 2711a - sta (pokeybase),y 5889 2711a - dey 5890 2711a - bpl pausesilencepokeyaudioloop 5891 2711a endif ; pokeysupport 5892 2711a 5893 2711a a9 ff lda #$ff 5894 2711c 8d ac 01 sta pausebuttonflag 5895 2711f d0 0d bne carryonpausing 5896 27121 5897 27121 enterpausestate2 5898 27121 a9 02 lda #2 5899 27123 8d 00 21 sta pausestate 5900 27126 d0 06 bne carryonpausing 5901 27128 leavepauseroutine 5902 27128 ad 07 21 lda sCTRL 5903 2712b 85 3c sta CTRL 5904 2712d 60 rts 5905 2712e carryonpausing 5906 2712e - ifconst .pause 5907 2712e - jsr .pause 5908 2712e endif ; .pause 5909 2712e ad 07 21 lda sCTRL 5910 27131 09 80 ora #%10000000 ; turn off colorburst during pause... 5911 27133 85 3c sta CTRL 5912 27135 4c d5 f0 jmp pauseroutine 5913 27138 endif ; pauseroutineoff 5914 27138 5915 27138 5916 27138 - ifconst DOUBLEBUFFER 5917 27138 -skipterminatedisplaylistreturn 5918 27138 - rts 5919 27138 endif ; DOUBLEBUFFER 5920 27138 terminatedisplaylist 5921 27138 - ifconst DOUBLEBUFFER 5922 27138 - lda doublebufferstate 5923 27138 - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 5924 27138 endif ; DOUBLEBUFFER 5925 27138 terminatedisplaybuffer 5926 27138 ;add DL end entry on each DL 5927 27138 a2 17 ldx #(WZONECOUNT-1) 5928 2713a dlendloop 5929 2713a bd 7b f6 lda DLPOINTL,x 5930 2713d - ifconst DOUBLEBUFFER 5931 2713d - clc 5932 2713d - adc doublebufferdloffset 5933 2713d endif ; DOUBLEBUFFER 5934 2713d 85 63 sta dlpnt 5935 2713f bd 63 f6 lda DLPOINTH,x 5936 27142 - ifconst DOUBLEBUFFER 5937 27142 - adc #0 5938 27142 endif ; DOUBLEBUFFER 5939 27142 85 64 sta dlpnt+1 5940 27144 b4 65 ldy dlend,x 5941 27146 a9 00 lda #$00 5942 27148 dlendmoreloops 5943 27148 c8 iny 5944 27149 91 63 sta (dlpnt),y 5945 2714b - ifconst FRAMESKIPGLITCHFIXWEAK 5946 2714b - cpy #DLLASTOBJ+1 5947 2714b - beq dlendthiszonedone 5948 2714b - iny 5949 2714b - iny 5950 2714b - iny 5951 2714b - iny 5952 2714b - iny 5953 2714b - sta (dlpnt),y 5954 2714b -dlendthiszonedone 5955 2714b endif FRAMESKIPGLITCHFIXWEAK 5956 2714b - ifconst FRAMESKIPGLITCHFIX 5957 2714b - iny 5958 2714b - iny 5959 2714b - iny 5960 2714b - iny 5961 2714b - cpy #DLLASTOBJ-1 5962 2714b - bcc dlendmoreloops 5963 2714b endif ; FRAMESKIPGLITCHFIX 5964 2714b ca dex 5965 2714c 10 ec bpl dlendloop 5966 2714e 5967 2714e ifnconst pauseroutineoff 5968 2714e 20 d5 f0 jsr pauseroutine 5969 27151 endif ; pauseroutineoff 5970 27151 60 rts 5971 27152 5972 27152 uninterruptableroutines 5973 27152 ; this is for routines that must happen off the visible screen, each frame. 5974 27152 5975 27152 - ifconst AVOXVOICE 5976 27152 - jsr serviceatarivoxqueue 5977 27152 endif 5978 27152 5979 27152 a9 00 lda #0 5980 27154 8d b6 01 sta palfastframe 5981 27157 ad 09 21 lda paldetected 5982 2715a f0 10 beq skippalframeadjusting 5983 2715c ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 5984 2715c ae b5 01 ldx palframes 5985 2715f e8 inx 5986 27160 e0 05 cpx #5 5987 27162 d0 05 bne palframeskipdone 5988 27164 ee b6 01 inc palfastframe 5989 27167 a2 00 ldx #0 5990 27169 palframeskipdone 5991 27169 8e b5 01 stx palframes 5992 2716c skippalframeadjusting 5993 2716c 5994 2716c - ifconst MUSICTRACKER 5995 2716c - ; We normally run the servicesong routine from the top-screen interrupt, but if it 5996 2716c - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 5997 2716c - ; If that happens, we try again here. Chances are very small we'll run into the same 5998 2716c - ; problem twice, and if we do, we just drop a musical note or two. 5999 2716c - lda sfxschedulemissed 6000 2716c - beq servicesongwasnotmissed 6001 2716c - jsr servicesong 6002 2716c -servicesongwasnotmissed 6003 2716c endif ; MUSICTRACKER 6004 2716c 6005 2716c 60 rts 6006 2716d 6007 2716d serviceatarivoxqueue 6008 2716d - ifconst AVOXVOICE 6009 2716d - lda voxlock 6010 2716d - bne skipvoxprocessing ; the vox is in the middle of speech address update 6011 2716d -skipvoxqueuesizedec 6012 2716d - jmp processavoxvoice 6013 2716d -skipvoxprocessing 6014 2716d - rts 6015 2716d - 6016 2716d -processavoxvoice 6017 2716d - lda avoxenable 6018 2716d - bne avoxfixport 6019 2716d - SPKOUT tempavox 6020 2716d - rts 6021 2716d -avoxfixport 6022 2716d - lda #0 ; restore the port to all bits as inputs... 6023 2716d - sta CTLSWA 6024 2716d - rts 6025 2716d -silenceavoxvoice 6026 2716d - SPEAK avoxsilentdata 6027 2716d - rts 6028 2716d -avoxsilentdata 6029 2716d - .byte 31,255 6030 2716d else 6031 2716d 60 rts 6032 2716e endif ; AVOXVOICE 6033 2716e 6034 2716e joybuttonhandler 6035 2716e 8a txa 6036 2716f 0a asl 6037 27170 a8 tay 6038 27171 b9 08 00 lda INPT0,y 6039 27174 4a lsr 6040 27175 9d 02 21 sta sINPT1,x 6041 27178 b9 09 00 lda INPT1,y 6042 2717b 29 80 and #%10000000 6043 2717d 1d 02 21 ora sINPT1,x 6044 27180 9d 02 21 sta sINPT1,x 6045 27183 6046 27183 b5 0c lda INPT4,x 6047 27185 30 19 bmi .skip1bjoyfirecheck 6048 27187 ;one button joystick is down 6049 27187 49 80 eor #%10000000 6050 27189 9d 02 21 sta sINPT1,x 6051 2718c 6052 2718c ad b1 01 lda joybuttonmode 6053 2718f 3d a3 f1 and twobuttonmask,x 6054 27192 f0 0c beq .skip1bjoyfirecheck 6055 27194 ad b1 01 lda joybuttonmode 6056 27197 1d a3 f1 ora twobuttonmask,x 6057 2719a 8d b1 01 sta joybuttonmode 6058 2719d 8d 82 02 sta SWCHB 6059 271a0 .skip1bjoyfirecheck 6060 271a0 4c 57 f0 jmp buttonreadloopreturn 6061 271a3 6062 271a3 twobuttonmask 6063 271a3 04 10 .byte.b %00000100,%00010000 6064 271a5 6065 271a5 gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 6066 271a5 - ifconst LIGHTGUNSUPPORT 6067 271a5 - cpx #0 6068 271a5 - bne secondportgunhandler 6069 271a5 -firstportgunhandler 6070 271a5 - lda SWCHA 6071 271a5 - asl 6072 271a5 - asl 6073 271a5 - asl ; shift D4 to D7 6074 271a5 - and #%10000000 6075 271a5 - eor #%10000000 6076 271a5 - sta sINPT1 6077 271a5 - jmp buttonreadloopreturn 6078 271a5 -secondportgunhandler 6079 271a5 - lda SWCHA 6080 271a5 - lsr ; shift D0 into carry 6081 271a5 - lsr ; shift carry into D7 6082 271a5 - and #%10000000 6083 271a5 - eor #%10000000 6084 271a5 - sta sINPT3 6085 271a5 - jmp buttonreadloopreturn 6086 271a5 endif ; LIGHTGUNSUPPORT 6087 271a5 6088 271a5 controlsusing2buttoncode 6089 271a5 00 .byte.b 0 ; 00=no controller plugged in 6090 271a6 01 .byte.b 1 ; 01=proline joystick 6091 271a7 00 .byte.b 0 ; 02=lightgun 6092 271a8 00 .byte.b 0 ; 03=paddle 6093 271a9 01 .byte.b 1 ; 04=trakball 6094 271aa 01 .byte.b 1 ; 05=vcs joystick 6095 271ab 01 .byte.b 1 ; 06=driving control 6096 271ac 00 .byte.b 0 ; 07=keypad control 6097 271ad 00 .byte.b 0 ; 08=st mouse/cx80 6098 271ae 00 .byte.b 0 ; 09=amiga mouse 6099 271af 01 .byte.b 1 ; 10=atarivox 6100 271b0 6101 271b0 buttonhandlerhi 6102 271b0 00 .byte.b 0 ; 00=no controller plugged in 6103 271b1 f1 .byte.b >joybuttonhandler ; 01=proline joystick 6104 271b2 f1 .byte.b >gunbuttonhandler ; 02=lightgun 6105 271b3 f5 .byte.b >paddlebuttonhandler ; 03=paddle 6106 271b4 f1 .byte.b >joybuttonhandler ; 04=trakball 6107 271b5 f1 .byte.b >joybuttonhandler ; 05=vcs joystick 6108 271b6 f1 .byte.b >joybuttonhandler ; 06=driving control 6109 271b7 00 .byte.b 0 ; 07=keypad 6110 271b8 f5 .byte.b >mousebuttonhandler ; 08=st mouse 6111 271b9 f5 .byte.b >mousebuttonhandler ; 09=amiga mouse 6112 271ba f1 .byte.b >joybuttonhandler ; 10=atarivox 6113 271bb buttonhandlerlo 6114 271bb 00 .byte.b 0 ; 00=no controller plugged in 6115 271bc 6e .byte.b $0F means the sound is looped while priority is active 6216 27219 6217 27219 05 d9 ora inttemp2 6218 2721b 05 d8 ora inttemp1 ; check if F|C|V=0 6219 2721d f0 23 beq zerosfx ; if so, we're at the end of the sound. 6220 2721f 6221 2721f advancesfxpointer 6222 2721f ; advance the pointer to the next sound chunk 6223 2721f c8 iny 6224 27220 84 da sty inttemp3 6225 27222 18 clc 6226 27223 b5 4e lda sfx1pointlo,x 6227 27225 65 da adc inttemp3 6228 27227 95 4e sta sfx1pointlo,x 6229 27229 b5 50 lda sfx1pointhi,x 6230 2722b 69 00 adc #0 6231 2722d 95 50 sta sfx1pointhi,x 6232 2722f 4c da f1 jmp servicesfxchannelsloop 6233 27232 6234 27232 sfxsoundloop 6235 27232 48 pha 6236 27233 b5 52 lda sfx1priority,x 6237 27235 d0 04 bne sfxsoundloop_carryon 6238 27237 68 pla ; fix the stack before we go 6239 27238 4c 1f f2 jmp advancesfxpointer 6240 2723b sfxsoundloop_carryon 6241 2723b 68 pla 6242 2723c 29 f0 and #$F0 6243 2723e 4a lsr 6244 2723f 4a lsr 6245 27240 4a lsr 6246 27241 4a lsr 6247 27242 6248 27242 zerosfx 6249 27242 95 4e sta sfx1pointlo,x 6250 27244 95 50 sta sfx1pointhi,x 6251 27246 95 52 sta sfx1priority,x 6252 27248 4c da f1 jmp servicesfxchannelsloop 6253 2724b 6254 2724b 6255 2724b schedulesfx 6256 2724b ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 6257 2724b a0 00 ldy #0 6258 2724d b1 e0 lda (sfxinstrumentlo),y 6259 2724f - ifconst pokeysupport 6260 2724f - cmp #$20 ; POKEY? 6261 2724f - bne scheduletiasfx 6262 2724f - jmp schedulepokeysfx 6263 2724f endif 6264 2724f scheduletiasfx 6265 2724f ;cmp #$10 ; TIA? 6266 2724f ;beq continuescheduletiasfx 6267 2724f ; rts ; unhandled!!! 6268 2724f continuescheduletiasfx 6269 2724f ifnconst TIASFXMONO 6270 2724f a5 4e lda sfx1pointlo 6271 27251 05 50 ora sfx1pointhi 6272 27253 f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 6273 27255 a5 4f lda sfx2pointlo 6274 27257 05 51 ora sfx2pointhi 6275 27259 f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 6276 2725b ; Both channels are scheduled. 6277 2725b a0 01 ldy #1 6278 2725d b1 e0 lda (sfxinstrumentlo),y 6279 2725f d0 01 bne interruptsfx 6280 27261 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 6281 27262 interruptsfx 6282 27262 ;Compare which active sound has a lower priority. We'll interrupt the lower one. 6283 27262 a5 52 lda sfx1priority 6284 27264 c5 53 cmp sfx2priority 6285 27266 b0 04 bcs schedulesfx2 6286 27268 endif ; !TIASFXMONO 6287 27268 6288 27268 schedulesfx1 6289 27268 a2 00 ldx #0 ; channel 1 6290 2726a ifnconst TIASFXMONO 6291 2726a f0 02 beq skipschedulesfx2 6292 2726c schedulesfx2 6293 2726c a2 01 ldx #1 ; channel 2 6294 2726e skipschedulesfx2 6295 2726e endif ; !TIASFXMONO 6296 2726e 6297 2726e - ifconst MUSICTRACKER 6298 2726e - lda sfxnoteindex 6299 2726e - bpl skipdrumkitoverride 6300 2726e - and #$7F ; subtract 128 6301 2726e - sec 6302 2726e - sbc #4 ; drums start at 132, i.e. octave 10 6303 2726e - asl 6304 2726e - tay 6305 2726e - lda tiadrumkitdefinition,y 6306 2726e - sta sfxinstrumentlo 6307 2726e - iny 6308 2726e - lda tiadrumkitdefinition,y 6309 2726e - sta sfxinstrumenthi 6310 2726e - lda #0 6311 2726e - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 6312 2726e -skipdrumkitoverride 6313 2726e endif ; MUSICTRACKER 6314 2726e a0 01 ldy #1 ; get priority and sound-resolution (in frames) 6315 27270 b1 e0 lda (sfxinstrumentlo),y 6316 27272 95 52 sta sfx1priority,x 6317 27274 c8 iny 6318 27275 b1 e0 lda (sfxinstrumentlo),y 6319 27277 95 56 sta sfx1frames,x 6320 27279 a5 e0 lda sfxinstrumentlo 6321 2727b 18 clc 6322 2727c 69 03 adc #3 6323 2727e 95 4e sta sfx1pointlo,x 6324 27280 a5 e1 lda sfxinstrumenthi 6325 27282 69 00 adc #0 6326 27284 95 50 sta sfx1pointhi,x 6327 27286 a5 e2 lda sfxpitchoffset 6328 27288 95 54 sta sfx1poffset,x 6329 2728a a9 00 lda #0 6330 2728c 95 58 sta sfx1tick,x 6331 2728e a5 e3 lda sfxnoteindex 6332 27290 95 cd sta sfx1notedata,x 6333 27292 60 rts 6334 27293 6335 27293 plotsprite 6336 27293 ifnconst NODRAWWAIT 6337 27293 - ifconst DOUBLEBUFFER 6338 27293 - lda doublebufferstate 6339 27293 - bne skipplotspritewait 6340 27293 endif ; DOUBLEBUFFER 6341 27293 - ifconst DEBUGWAITCOLOR 6342 27293 - lda #$41 6343 27293 - sta BACKGRND 6344 27293 endif 6345 27293 plotspritewait 6346 27293 a5 4d lda visibleover 6347 27295 d0 fc bne plotspritewait 6348 27297 skipplotspritewait 6349 27297 - ifconst DEBUGWAITCOLOR 6350 27297 - lda #$0 6351 27297 - sta BACKGRND 6352 27297 endif 6353 27297 endif 6354 27297 6355 27297 ;arguments: 6356 27297 ; temp1=lo graphicdata 6357 27297 ; temp2=hi graphicdata 6358 27297 ; temp3=palette | width byte 6359 27297 ; temp4=x 6360 27297 ; temp5=y 6361 27297 ; temp6=mode 6362 27297 a5 46 lda temp5 ;Y position 6363 27299 4a lsr ; 2 - Divide by 8 or 16 6364 2729a 4a lsr ; 2 6365 2729b 4a lsr ; 2 6366 2729c - if WZONEHEIGHT = 16 6367 2729c - lsr ; 2 6368 2729c endif 6369 2729c 6370 2729c aa tax 6371 2729d 6372 2729d ifnconst NOLIMITCHECKING 6373 2729d 6374 2729d ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 6375 2729d 6376 2729d c9 18 cmp #WZONECOUNT 6377 2729f 6378 2729f 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 6379 272a1 ; otherwise, check to see if the bottom half is in zone 0... 6380 272a1 6381 272a1 - if WZONEHEIGHT = 16 6382 272a1 - cmp #15 6383 272a1 else 6384 272a1 c9 1f cmp #31 6385 272a3 endif 6386 272a3 6387 272a3 d0 05 bne exitplotsprite1 6388 272a5 a2 00 ldx #0 6389 272a7 4c e4 f2 jmp continueplotsprite2 6390 272aa exitplotsprite1 6391 272aa 60 rts 6392 272ab 6393 272ab continueplotsprite1 6394 272ab endif 6395 272ab 6396 272ab bd 7b f6 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 6397 272ae - ifconst DOUBLEBUFFER 6398 272ae - clc 6399 272ae - adc doublebufferdloffset 6400 272ae endif ; DOUBLEBUFFER 6401 272ae 85 63 sta dlpnt 6402 272b0 bd 63 f6 lda DLPOINTH,x 6403 272b3 - ifconst DOUBLEBUFFER 6404 272b3 - adc #0 6405 272b3 endif ; DOUBLEBUFFER 6406 272b3 85 64 sta dlpnt+1 6407 272b5 6408 272b5 ;Create DL entry for upper part of sprite 6409 272b5 6410 272b5 b4 65 ldy dlend,x ;Get the index to the end of this DL 6411 272b7 6412 272b7 ifconst CHECKOVERWRITE 6413 272b7 c0 4b cpy #DLLASTOBJ 6414 272b9 f0 21 beq checkcontinueplotsprite2 6415 272bb continueplotsprite1a 6416 272bb endif 6417 272bb 6418 272bb a5 42 lda temp1 ; graphic data, lo byte 6419 272bd 91 63 sta (dlpnt),y ;Low byte of data address 6420 272bf 6421 272bf ifnconst ATOMICSPRITEUPDATE 6422 272bf c8 iny 6423 272c0 a5 47 lda temp6 6424 272c2 91 63 sta (dlpnt),y 6425 272c4 - else 6426 272c4 - iny 6427 272c4 - sty temp8 6428 272c4 endif 6429 272c4 6430 272c4 c8 iny 6431 272c5 6432 272c5 a5 46 lda temp5 ;Y position 6433 272c7 29 07 and #(WZONEHEIGHT - 1) 6434 272c9 c9 01 cmp #1 ; clear carry if our sprite is just in this zone 6435 272cb 05 43 ora temp2 ; graphic data, hi byte 6436 272cd 91 63 sta (dlpnt),y 6437 272cf 6438 272cf 6439 272cf c8 iny 6440 272d0 a5 44 lda temp3 ;palette|width 6441 272d2 91 63 sta (dlpnt),y 6442 272d4 6443 272d4 c8 iny 6444 272d5 a5 45 lda temp4 ;Horizontal position 6445 272d7 91 63 sta (dlpnt),y 6446 272d9 6447 272d9 c8 iny 6448 272da 94 65 sty dlend,x 6449 272dc 6450 272dc - ifconst ALWAYSTERMINATE 6451 272dc - iny 6452 272dc - lda #0 6453 272dc - sta (dlpnt),y 6454 272dc endif 6455 272dc 6456 272dc - ifconst ATOMICSPRITEUPDATE 6457 272dc - ldy temp8 6458 272dc - lda temp6 6459 272dc - sta (dlpnt),y 6460 272dc endif 6461 272dc 6462 272dc checkcontinueplotsprite2 6463 272dc 6464 272dc 90 38 bcc doneSPDL ;branch if the sprite was fully in the last zone 6465 272de 6466 272de ;Create DL entry for lower part of sprite 6467 272de 6468 272de e8 inx ;Next region 6469 272df 6470 272df ifnconst NOLIMITCHECKING 6471 272df e0 18 cpx #WZONECOUNT 6472 272e1 6473 272e1 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 6474 272e3 60 rts 6475 272e4 continueplotsprite2 6476 272e4 endif 6477 272e4 6478 272e4 bd 7b f6 lda DLPOINTL,x ;Get pointer to next DL 6479 272e7 - ifconst DOUBLEBUFFER 6480 272e7 - clc 6481 272e7 - adc doublebufferdloffset 6482 272e7 endif ; DOUBLEBUFFER 6483 272e7 85 63 sta dlpnt 6484 272e9 bd 63 f6 lda DLPOINTH,x 6485 272ec - ifconst DOUBLEBUFFER 6486 272ec - adc #0 6487 272ec endif ; DOUBLEBUFFER 6488 272ec 85 64 sta dlpnt+1 6489 272ee b4 65 ldy dlend,x ;Get the index to the end of this DL 6490 272f0 6491 272f0 ifconst CHECKOVERWRITE 6492 272f0 c0 4b cpy #DLLASTOBJ 6493 272f2 d0 01 bne continueplotsprite2a 6494 272f4 60 rts 6495 272f5 continueplotsprite2a 6496 272f5 endif 6497 272f5 6498 272f5 a5 42 lda temp1 ; graphic data, lo byte 6499 272f7 91 63 sta (dlpnt),y 6500 272f9 6501 272f9 ifnconst ATOMICSPRITEUPDATE 6502 272f9 c8 iny 6503 272fa a5 47 lda temp6 6504 272fc 91 63 sta (dlpnt),y 6505 272fe - else 6506 272fe - iny 6507 272fe - sty temp8 6508 272fe endif 6509 272fe 6510 272fe c8 iny 6511 272ff 6512 272ff a5 46 lda temp5 ;Y position 6513 27301 0b 07 anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 6514 27303 05 43 ora temp2 ; graphic data, hi byte 6515 27305 e9 07 sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 6516 27307 91 63 sta (dlpnt),y 6517 27309 6518 27309 c8 iny 6519 2730a 6520 2730a a5 44 lda temp3 ;palette|width 6521 2730c 91 63 sta (dlpnt),y 6522 2730e 6523 2730e c8 iny 6524 2730f 6525 2730f a5 45 lda temp4 ;Horizontal position 6526 27311 91 63 sta (dlpnt),y 6527 27313 6528 27313 c8 iny 6529 27314 94 65 sty dlend,x 6530 27316 6531 27316 - ifconst ALWAYSTERMINATE 6532 27316 - iny 6533 27316 - lda #0 6534 27316 - sta (dlpnt),y 6535 27316 endif 6536 27316 6537 27316 - ifconst ATOMICSPRITEUPDATE 6538 27316 - ldy temp8 6539 27316 - lda temp6 6540 27316 - sta (dlpnt),y 6541 27316 endif 6542 27316 6543 27316 doneSPDL 6544 27316 60 rts 6545 27317 6546 27317 6547 27317 lockzonex 6548 27317 - ifconst ZONELOCKS 6549 27317 - ldy dlend,x 6550 27317 - cpy #DLLASTOBJ 6551 27317 - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 6552 27317 - lda DLPOINTL,x 6553 27317 - ifconst DOUBLEBUFFER 6554 27317 - clc 6555 27317 - adc doublebufferdloffset 6556 27317 - endif ; DOUBLEBUFFER 6557 27317 - sta dlpnt 6558 27317 - lda DLPOINTH,x 6559 27317 - ifconst DOUBLEBUFFER 6560 27317 - adc #0 6561 27317 - endif ; DOUBLEBUFFER 6562 27317 - sta dlpnt+1 6563 27317 - iny 6564 27317 - lda #0 6565 27317 - sta (dlpnt),y 6566 27317 - dey 6567 27317 - tya 6568 27317 - ldy #(DLLASTOBJ-1) 6569 27317 - sta (dlpnt),y 6570 27317 - iny 6571 27317 - sty dlend,x 6572 27317 -lockzonexreturn 6573 27317 - rts 6574 27317 endif ; ZONELOCKS 6575 27317 unlockzonex 6576 27317 - ifconst ZONELOCKS 6577 27317 - ldy dlend,x 6578 27317 - cpy #DLLASTOBJ 6579 27317 - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 6580 27317 - lda DLPOINTL,x 6581 27317 - ifconst DOUBLEBUFFER 6582 27317 - clc 6583 27317 - adc doublebufferdloffset 6584 27317 - endif ; DOUBLEBUFFER 6585 27317 - sta dlpnt 6586 27317 - lda DLPOINTH,x 6587 27317 - ifconst DOUBLEBUFFER 6588 27317 - adc #0 6589 27317 - endif ; DOUBLEBUFFER 6590 27317 - sta dlpnt+1 6591 27317 - dey 6592 27317 - ;ldy #(DLLASTOBJ-1) 6593 27317 - lda (dlpnt),y 6594 27317 - tay 6595 27317 - sty dlend,x 6596 27317 -unlockzonexreturn 6597 27317 endif ; ZONELOCKS 6598 27317 60 rts 6599 27318 6600 27318 plotcharloop 6601 27318 ; ** read from a data indirectly pointed to from temp8,temp9 6602 27318 ; ** format is: lo_data, hi_data, palette|width, x, y 6603 27318 ; ** format ends with lo_data | hi_data = 0 6604 27318 6605 27318 - ifconst DOUBLEBUFFER 6606 27318 - lda doublebufferstate 6607 27318 - bne skipplotcharloopwait 6608 27318 endif ; DOUBLEBUFFER 6609 27318 - ifconst DEBUGWAITCOLOR 6610 27318 - lda #$61 6611 27318 - sta BACKGRND 6612 27318 endif 6613 27318 plotcharloopwait 6614 27318 a5 4d lda visibleover 6615 2731a d0 fc bne plotcharloopwait 6616 2731c - ifconst DEBUGWAITCOLOR 6617 2731c - lda #0 6618 2731c - sta BACKGRND 6619 2731c endif 6620 2731c skipplotcharloopwait 6621 2731c plotcharlooploop 6622 2731c a0 00 ldy #0 6623 2731e b1 49 lda (temp8),y 6624 27320 85 42 sta temp1 6625 27322 c8 iny 6626 27323 b1 49 lda (temp8),y 6627 27325 85 43 sta temp2 6628 27327 05 42 ora temp1 6629 27329 d0 01 bne plotcharloopcontinue 6630 2732b ;the pointer=0, so return 6631 2732b 60 rts 6632 2732c plotcharloopcontinue 6633 2732c c8 iny 6634 2732d b1 49 lda (temp8),y 6635 2732f 85 44 sta temp3 6636 27331 c8 iny 6637 27332 b1 49 lda (temp8),y 6638 27334 85 45 sta temp4 6639 27336 c8 iny 6640 27337 b1 49 lda (temp8),y 6641 27339 ;sta temp5 ; not needed with our late entry. 6642 27339 20 52 f3 jsr plotcharactersskipentry 6643 2733c a5 49 lda temp8 6644 2733e 18 clc 6645 2733f 69 05 adc #5 6646 27341 85 49 sta temp8 6647 27343 a5 4a lda temp9 6648 27345 69 00 adc #0 6649 27347 85 4a sta temp9 6650 27349 4c 1c f3 jmp plotcharlooploop 6651 2734c 6652 2734c plotcharacters 6653 2734c - ifconst DOUBLEBUFFER 6654 2734c - lda doublebufferstate 6655 2734c - bne skipplotcharacterswait 6656 2734c endif ; DOUBLEBUFFER 6657 2734c - ifconst DEBUGWAITCOLOR 6658 2734c - lda #$41 6659 2734c - sta BACKGRND 6660 2734c endif 6661 2734c plotcharacterswait 6662 2734c a5 4d lda visibleover 6663 2734e d0 fc bne plotcharacterswait 6664 27350 - ifconst DEBUGWAITCOLOR 6665 27350 - sta BACKGRND 6666 27350 endif 6667 27350 skipplotcharacterswait 6668 27350 ;arguments: 6669 27350 ; temp1=lo charactermap 6670 27350 ; temp2=hi charactermap 6671 27350 ; temp3=palette | width byte 6672 27350 ; temp4=x 6673 27350 ; temp5=y 6674 27350 6675 27350 a5 46 lda temp5 ;Y position 6676 27352 6677 27352 plotcharactersskipentry 6678 27352 6679 27352 ;ifconst ZONEHEIGHT 6680 27352 ; if ZONEHEIGHT = 16 6681 27352 ; and #$0F 6682 27352 ; endif 6683 27352 ; if ZONEHEIGHT = 8 6684 27352 ; and #$1F 6685 27352 ; endif 6686 27352 ;else 6687 27352 ; and #$0F 6688 27352 ;endif 6689 27352 6690 27352 aa tax 6691 27353 bd 7b f6 lda DLPOINTL,x ;Get pointer to DL that the characters are in 6692 27356 - ifconst DOUBLEBUFFER 6693 27356 - clc 6694 27356 - adc doublebufferdloffset 6695 27356 endif ; DOUBLEBUFFER 6696 27356 85 63 sta dlpnt 6697 27358 bd 63 f6 lda DLPOINTH,x 6698 2735b - ifconst DOUBLEBUFFER 6699 2735b - adc #0 6700 2735b endif ; DOUBLEBUFFER 6701 2735b 85 64 sta dlpnt+1 6702 2735d 6703 2735d ;Create DL entry for the characters 6704 2735d 6705 2735d b4 65 ldy dlend,x ;Get the index to the end of this DL 6706 2735f 6707 2735f ifconst CHECKOVERWRITE 6708 2735f c0 4b cpy #DLLASTOBJ 6709 27361 d0 01 bne continueplotcharacters 6710 27363 60 rts 6711 27364 continueplotcharacters 6712 27364 endif 6713 27364 6714 27364 a5 42 lda temp1 ; character map data, lo byte 6715 27366 91 63 sta (dlpnt),y ;(1) store low address 6716 27368 6717 27368 c8 iny 6718 27369 ad 06 21 lda charactermode 6719 2736c 91 63 sta (dlpnt),y ;(2) store mode 6720 2736e 6721 2736e c8 iny 6722 2736f a5 43 lda temp2 ; character map, hi byte 6723 27371 91 63 sta (dlpnt),y ;(3) store high address 6724 27373 6725 27373 c8 iny 6726 27374 a5 44 lda temp3 ;palette|width 6727 27376 91 63 sta (dlpnt),y ;(4) store palette|width 6728 27378 6729 27378 c8 iny 6730 27379 a5 45 lda temp4 ;Horizontal position 6731 2737b 91 63 sta (dlpnt),y ;(5) store horizontal position 6732 2737d 6733 2737d c8 iny 6734 2737e 94 65 sty dlend,x ; save display list end byte 6735 27380 60 rts 6736 27381 6737 27381 6738 27381 - ifconst plotvalueonscreen 6739 27381 -plotcharacterslive 6740 27381 - ; a version of plotcharacters that draws live and minimally disrupts the screen... 6741 27381 - 6742 27381 - ;arguments: 6743 27381 - ; temp1=lo charactermap 6744 27381 - ; temp2=hi charactermap 6745 27381 - ; temp3=palette | width byte 6746 27381 - ; temp4=x 6747 27381 - ; temp5=y 6748 27381 - 6749 27381 - lda temp5 ;Y position 6750 27381 - 6751 27381 - tax 6752 27381 - lda DLPOINTL,x ;Get pointer to DL that the characters are in 6753 27381 - ifconst DOUBLEBUFFER 6754 27381 - clc 6755 27381 - adc doublebufferdloffset 6756 27381 - endif ; DOUBLEBUFFER 6757 27381 - sta dlpnt 6758 27381 - lda DLPOINTH,x 6759 27381 - ifconst DOUBLEBUFFER 6760 27381 - adc #0 6761 27381 - endif ; DOUBLEBUFFER 6762 27381 - sta dlpnt+1 6763 27381 - 6764 27381 - ;Create DL entry for the characters 6765 27381 - 6766 27381 - ldy dlend,x ;Get the index to the end of this DL 6767 27381 - 6768 27381 - ifconst CHECKOVERWRITE 6769 27381 - cpy #DLLASTOBJ 6770 27381 - bne continueplotcharacterslive 6771 27381 - rts 6772 27381 -continueplotcharacterslive 6773 27381 - endif 6774 27381 - 6775 27381 - lda temp1 ; character map data, lo byte 6776 27381 - sta (dlpnt),y ;(1) store low address 6777 27381 - 6778 27381 - iny 6779 27381 - ; we don't add the second byte yet, since the charmap could briefly 6780 27381 - ; render without a proper character map address, width, or position. 6781 27381 - lda charactermode 6782 27381 - sta (dlpnt),y ;(2) store mode 6783 27381 - 6784 27381 - iny 6785 27381 - lda temp2 ; character map, hi byte 6786 27381 - sta (dlpnt),y ;(3) store high address 6787 27381 - 6788 27381 - iny 6789 27381 - lda temp3 ;palette|width 6790 27381 - sta (dlpnt),y ;(4) store palette|width 6791 27381 - 6792 27381 - iny 6793 27381 - lda temp4 ;Horizontal position 6794 27381 - sta (dlpnt),y ;(5) store horizontal position 6795 27381 - 6796 27381 - iny 6797 27381 - sty dlend,x ; save display list end byte 6798 27381 - 6799 27381 - rts 6800 27381 endif ;plotcharacterslive 6801 27381 6802 27381 ifconst USED_PLOTVALUE 6803 27381 plotvalue 6804 27381 ; calling 7800basic command: 6805 27381 ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6806 27381 ; ...displays the variable as BCD digits 6807 27381 ; 6808 27381 ; asm sub arguments: 6809 27381 ; temp1=lo charactermap 6810 27381 ; temp2=hi charactermap 6811 27381 ; temp3=palette | width byte 6812 27381 ; temp4=x 6813 27381 ; temp5=y 6814 27381 ; temp6=number of digits 6815 27381 ; temp7=lo variable 6816 27381 ; temp8=hi variable 6817 27381 ; temp9=character mode 6818 27381 6819 27381 00 47 plotdigitcount = temp6 6820 27381 6821 27381 - ifconst ZONELOCKS 6822 27381 - ldx temp5 6823 27381 - ldy dlend,x 6824 27381 - cpy #DLLASTOBJ 6825 27381 - bne carryonplotvalue 6826 27381 - rts 6827 27381 -carryonplotvalue 6828 27381 endif 6829 27381 6830 27381 a9 00 lda #0 6831 27383 a8 tay 6832 27384 ae ad 01 ldx valbufend 6833 27387 6834 27387 a5 47 lda plotdigitcount 6835 27389 29 01 and #1 6836 2738b f0 07 beq pvnibble2char 6837 2738d a9 00 lda #0 6838 2738f 9d 00 20 sta VALBUFFER,x ; just in case we skip this digit 6839 27392 f0 11 beq pvnibble2char_skipnibble 6840 27394 6841 27394 pvnibble2char 6842 27394 ; high nibble... 6843 27394 b1 48 lda (temp7),y 6844 27396 29 f0 and #$f0 6845 27398 4a lsr 6846 27399 4a lsr 6847 2739a 4a lsr 6848 2739b ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6849 2739b 4a lsr 6850 2739c endif 6851 2739c 6852 2739c 18 clc 6853 2739d 65 42 adc temp1 ; add the offset to character graphics to our value 6854 2739f 9d 00 20 sta VALBUFFER,x 6855 273a2 e8 inx 6856 273a3 c6 47 dec plotdigitcount 6857 273a5 6858 273a5 pvnibble2char_skipnibble 6859 273a5 ; low nibble... 6860 273a5 b1 48 lda (temp7),y 6861 273a7 29 0f and #$0f 6862 273a9 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6863 273a9 - asl 6864 273a9 endif 6865 273a9 18 clc 6866 273aa 65 42 adc temp1 ; add the offset to character graphics to our value 6867 273ac 9d 00 20 sta VALBUFFER,x 6868 273af e8 inx 6869 273b0 c8 iny 6870 273b1 6871 273b1 c6 47 dec plotdigitcount 6872 273b3 d0 df bne pvnibble2char 6873 273b5 6874 273b5 ;point to the start of our valuebuffer 6875 273b5 18 clc 6876 273b6 a9 00 lda #VALBUFFER 6880 273bf 69 00 adc #0 6881 273c1 85 43 sta temp2 6882 273c3 6883 273c3 ;advance valbufend to the end of our value buffer 6884 273c3 8e ad 01 stx valbufend 6885 273c6 6886 273c6 ifnconst plotvalueonscreen 6887 273c6 4c 4c f3 jmp plotcharacters 6888 273c9 - else 6889 273c9 - jmp plotcharacterslive 6890 273c9 endif 6891 273c9 6892 273c9 endif ; USED_PLOTVALUE 6893 273c9 6894 273c9 6895 273c9 - ifconst USED_PLOTVALUEEXTRA 6896 273c9 -plotdigitcount = temp6 6897 273c9 -plotvalueextra 6898 273c9 - ; calling 7800basic command: 6899 273c9 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6900 273c9 - ; ...displays the variable as BCD digits 6901 273c9 - ; 6902 273c9 - ; asm sub arguments: 6903 273c9 - ; temp1=lo charactermap 6904 273c9 - ; temp2=hi charactermap 6905 273c9 - ; temp3=palette | width byte 6906 273c9 - ; temp4=x 6907 273c9 - ; temp5=y 6908 273c9 - ; temp6=number of digits 6909 273c9 - ; temp7=lo variable 6910 273c9 - ; temp8=hi variable 6911 273c9 - 6912 273c9 - lda #0 6913 273c9 - tay 6914 273c9 - ldx valbufend 6915 273c9 - ifnconst plotvalueonscreen 6916 273c9 - sta VALBUFFER,x 6917 273c9 - endif 6918 273c9 - 6919 273c9 - lda plotdigitcount 6920 273c9 - and #1 6921 273c9 - 6922 273c9 - bne pvnibble2char_skipnibbleextra 6923 273c9 - 6924 273c9 -pvnibble2charextra 6925 273c9 - ; high nibble... 6926 273c9 - lda (temp7),y 6927 273c9 - and #$f0 6928 273c9 - lsr 6929 273c9 - lsr 6930 273c9 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6931 273c9 - lsr 6932 273c9 - endif 6933 273c9 - clc 6934 273c9 - adc temp1 ; add the offset to character graphics to our value 6935 273c9 - sta VALBUFFER,x 6936 273c9 - inx 6937 273c9 - 6938 273c9 - ; second half of the digit 6939 273c9 - clc 6940 273c9 - adc #1 6941 273c9 - sta VALBUFFER,x 6942 273c9 - inx 6943 273c9 - 6944 273c9 -pvnibble2char_skipnibbleextra 6945 273c9 - ; low nibble... 6946 273c9 - lda (temp7),y 6947 273c9 - and #$0f 6948 273c9 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6949 273c9 - asl 6950 273c9 - endif 6951 273c9 - asl 6952 273c9 - 6953 273c9 - clc 6954 273c9 - adc temp1 ; add the offset to character graphics to our value 6955 273c9 - sta VALBUFFER,x 6956 273c9 - inx 6957 273c9 - 6958 273c9 - clc 6959 273c9 - adc #1 6960 273c9 - sta VALBUFFER,x 6961 273c9 - inx 6962 273c9 - iny 6963 273c9 - 6964 273c9 - dec plotdigitcount 6965 273c9 - bne pvnibble2charextra 6966 273c9 - 6967 273c9 - ;point to the start of our valuebuffer 6968 273c9 - clc 6969 273c9 - lda #VALBUFFER 6973 273c9 - adc #0 6974 273c9 - sta temp2 6975 273c9 - 6976 273c9 - ;advance valbufend to the end of our value buffer 6977 273c9 - stx valbufend 6978 273c9 - 6979 273c9 - ifnconst plotvalueonscreen 6980 273c9 - jmp plotcharacters 6981 273c9 - else 6982 273c9 - jmp plotcharacterslive 6983 273c9 - endif 6984 273c9 endif ; USED_PLOTVALUEEXTRA 6985 273c9 6986 273c9 boxcollision 6987 273c9 ifconst BOXCOLLISION 6988 273c9 ; the worst case cycle-time for the code below is 43 cycles. 6989 273c9 ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 6990 273c9 6991 273c9 ;__boxx1 = accumulator 6992 273c9 ;__boxy1 = y 6993 273c9 00 44 __boxw1 = temp3 6994 273c9 00 45 __boxh1 = temp4 6995 273c9 6996 273c9 00 46 __boxx2 = temp5 6997 273c9 00 47 __boxy2 = temp6 6998 273c9 00 48 __boxw2 = temp7 6999 273c9 00 49 __boxh2 = temp8 7000 273c9 7001 273c9 DoXCollisionCheck 7002 273c9 ;lda __boxx1 ; skipped. already in the accumulator 7003 273c9 c5 46 cmp __boxx2 ;3 7004 273cb b0 07 bcs X1isbiggerthanX2 ;2/3 7005 273cd X2isbiggerthanX1 7006 273cd ; carry is clear 7007 273cd 65 44 adc __boxw1 ;3 7008 273cf c5 46 cmp __boxx2 ;3 7009 273d1 b0 08 bcs DoYCollisionCheck ;3/2 7010 273d3 60 rts ;6 - carry clear, no collision 7011 273d4 X1isbiggerthanX2 7012 273d4 18 clc ;2 7013 273d5 e5 48 sbc __boxw2 ;3 7014 273d7 c5 46 cmp __boxx2 ;3 7015 273d9 b0 13 bcs noboxcollision ;3/2 7016 273db DoYCollisionCheck 7017 273db 98 tya ; 2 ; use to be "lda __boxy1" 7018 273dc c5 47 cmp __boxy2 ;3 7019 273de b0 05 bcs Y1isbiggerthanY2 ;3/2 7020 273e0 Y2isbiggerthanY1 7021 273e0 ; carry is clear 7022 273e0 65 45 adc __boxh1 ;3 7023 273e2 c5 47 cmp __boxy2 ;3 7024 273e4 60 rts ;6 7025 273e5 Y1isbiggerthanY2 7026 273e5 18 clc ;2 7027 273e6 e5 49 sbc __boxh2 ;3 7028 273e8 c5 47 cmp __boxy2 ;3 7029 273ea b0 02 bcs noboxcollision ;3/2 7030 273ec yesboxcollision 7031 273ec 38 sec ;2 7032 273ed 60 rts ;6 7033 273ee noboxcollision 7034 273ee 18 clc ;2 7035 273ef 60 rts ;6 7036 273f0 endif ; BOXCOLLISION 7037 273f0 7038 273f0 randomize 7039 273f0 a5 40 lda rand 7040 273f2 4a lsr 7041 273f3 26 41 rol rand16 7042 273f5 90 02 bcc noeor 7043 273f7 49 b4 eor #$B4 7044 273f9 noeor 7045 273f9 85 40 sta rand 7046 273fb 45 41 eor rand16 7047 273fd 60 rts 7048 273fe 7049 273fe ; *** bcd conversion routine courtesy Omegamatrix 7050 273fe ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 7051 273fe converttobcd 7052 273fe ;value to convert is in the accumulator 7053 273fe 85 42 sta temp1 7054 27400 4a lsr 7055 27401 65 42 adc temp1 7056 27403 6a ror 7057 27404 4a lsr 7058 27405 4a lsr 7059 27406 65 42 adc temp1 7060 27408 6a ror 7061 27409 65 42 adc temp1 7062 2740b 6a ror 7063 2740c 4a lsr 7064 2740d 29 3c and #$3C 7065 2740f 85 43 sta temp2 7066 27411 4a lsr 7067 27412 65 43 adc temp2 7068 27414 65 42 adc temp1 7069 27416 60 rts ; return the result in the accumulator 7070 27417 7071 27417 ; Y and A contain multiplicands, result in A 7072 27417 mul8 7073 27417 84 42 sty temp1 7074 27419 85 43 sta temp2 7075 2741b a9 00 lda #0 7076 2741d reptmul8 7077 2741d 46 43 lsr temp2 7078 2741f 90 03 bcc skipmul8 7079 27421 18 clc 7080 27422 65 42 adc temp1 7081 27424 ;bcs donemul8 might save cycles? 7082 27424 skipmul8 7083 27424 ;beq donemul8 might save cycles? 7084 27424 06 42 asl temp1 7085 27426 d0 f5 bne reptmul8 7086 27428 donemul8 7087 27428 60 rts 7088 27429 7089 27429 div8 7090 27429 ; A=numerator Y=denominator, result in A 7091 27429 c0 02 cpy #2 7092 2742b 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 7093 2742d 84 42 sty temp1 7094 2742f a0 ff ldy #$ff 7095 27431 div8loop 7096 27431 e5 42 sbc temp1 7097 27433 c8 iny 7098 27434 b0 fb bcs div8loop 7099 27436 div8end 7100 27436 98 tya 7101 27437 ; result in A 7102 27437 60 rts 7103 27438 7104 27438 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 7105 27438 mul16 7106 27438 84 42 sty temp1 7107 2743a 85 43 sta temp2 7108 2743c 7109 2743c a9 00 lda #0 7110 2743e a2 08 ldx #8 7111 27440 46 42 lsr temp1 7112 27442 mul16_1 7113 27442 90 03 bcc mul16_2 7114 27444 18 clc 7115 27445 65 43 adc temp2 7116 27447 mul16_2 7117 27447 6a ror 7118 27448 66 42 ror temp1 7119 2744a ca dex 7120 2744b d0 f5 bne mul16_1 7121 2744d 85 43 sta temp2 7122 2744f 60 rts 7123 27450 7124 27450 ; div int/int 7125 27450 ; numerator in A, denom in temp1 7126 27450 ; returns with quotient in A, remainder in temp1 7127 27450 div16 7128 27450 85 43 sta temp2 7129 27452 84 42 sty temp1 7130 27454 a9 00 lda #0 7131 27456 a2 08 ldx #8 7132 27458 06 43 asl temp2 7133 2745a div16_1 7134 2745a 2a rol 7135 2745b c5 42 cmp temp1 7136 2745d 90 02 bcc div16_2 7137 2745f e5 42 sbc temp1 7138 27461 div16_2 7139 27461 26 43 rol temp2 7140 27463 ca dex 7141 27464 d0 f4 bne div16_1 7142 27466 85 42 sta temp1 7143 27468 a5 43 lda temp2 7144 2746a 60 rts 7145 2746b 7146 2746b ifconst bankswitchmode 7147 2746b BS_jsr 7148 2746b - ifconst dumpbankswitch 7149 2746b - sta dumpbankswitch 7150 2746b endif 7151 2746b - ifconst MCPDEVCART 7152 2746b - ora #$18 7153 2746b - sta $3000 7154 2746b else 7155 2746b 8d 00 80 sta $8000 7156 2746e endif 7157 2746e 68 pla 7158 2746f aa tax 7159 27470 68 pla 7160 27471 60 rts 7161 27472 7162 27472 BS_return 7163 27472 68 pla ; bankswitch bank 7164 27473 - ifconst dumpbankswitch 7165 27473 - sta dumpbankswitch 7166 27473 endif 7167 27473 - ifconst BANKRAM 7168 27473 - sta currentbank 7169 27473 - ora currentrambank 7170 27473 endif 7171 27473 - ifconst MCPDEVCART 7172 27473 - ora #$18 7173 27473 - sta $3000 7174 27473 else 7175 27473 8d 00 80 sta $8000 7176 27476 endif 7177 27476 68 pla ; bankswitch $0 flag 7178 27477 60 rts 7179 27478 endif 7180 27478 7181 27478 checkselectswitch 7182 27478 ad 82 02 lda SWCHB ; first check the real select switch... 7183 2747b 29 02 and #%00000010 7184 2747d ifnconst MOUSESUPPORT 7185 2747d f0 05 beq checkselectswitchreturn ; switch is pressed 7186 2747f ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 7187 27482 29 b0 and #%10110000 ; R_DU 7188 27484 endif ; MOUSESUPPORT 7189 27484 checkselectswitchreturn 7190 27484 60 rts 7191 27485 7192 27485 checkresetswitch 7193 27485 ad 82 02 lda SWCHB ; first check the real reset switch... 7194 27488 29 01 and #%00000001 7195 2748a ifnconst MOUSESUPPORT 7196 2748a f0 05 beq checkresetswitchreturn ; switch is pressed 7197 2748c ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 7198 2748f 29 70 and #%01110000 ; _LDU 7199 27491 endif ; MOUSESUPPORT 7200 27491 checkresetswitchreturn 7201 27491 60 rts 7202 27492 7203 27492 - ifconst FINESCROLLENABLED 7204 27492 -finescrolldlls 7205 27492 - ldx temp1 ; first DLL index x3 7206 27492 - lda DLLMEM,x 7207 27492 - and #%11110000 7208 27492 - ora finescrolly 7209 27492 - sta DLLMEM,x 7210 27492 - 7211 27492 - ldx temp2 ; last DLL index x3 7212 27492 - lda DLLMEM,x 7213 27492 - and #%11110000 7214 27492 - ora finescrolly 7215 27492 - eor #(WZONEHEIGHT-1) 7216 27492 - sta DLLMEM,x 7217 27492 - rts 7218 27492 endif ; FINESCROLLENABLED 7219 27492 7220 27492 - ifconst USED_ADJUSTVISIBLE 7221 27492 -adjustvisible 7222 27492 - ; called with temp1=first visible zone *3, temp2=last visible zone *3 7223 27492 - jsr waitforvblankstart ; ensure vblank just started 7224 27492 - ldx visibleDLLstart 7225 27492 -findfirstinterrupt 7226 27492 - lda DLLMEM,x 7227 27492 - bmi foundfirstinterrupt 7228 27492 - inx 7229 27492 - inx 7230 27492 - inx 7231 27492 - bne findfirstinterrupt 7232 27492 -foundfirstinterrupt 7233 27492 - and #%01111111 ; clear the interrupt bit 7234 27492 - sta DLLMEM,x 7235 27492 - ifconst DOUBLEBUFFER 7236 27492 - sta DLLMEM+DBOFFSET,x 7237 27492 - endif ; DOUBLEBUFFER 7238 27492 - ldx overscanDLLstart 7239 27492 -findlastinterrupt 7240 27492 - lda DLLMEM,x 7241 27492 - bmi foundlastinterrupt 7242 27492 - dex 7243 27492 - dex 7244 27492 - dex 7245 27492 - bne findlastinterrupt 7246 27492 -foundlastinterrupt 7247 27492 - and #%01111111 ; clear the interrupt bit 7248 27492 - sta DLLMEM,x 7249 27492 - ifconst DOUBLEBUFFER 7250 27492 - sta DLLMEM+DBOFFSET,x 7251 27492 - endif ; DOUBLEBUFFER 7252 27492 - ;now we need to set the new interrupts 7253 27492 - clc 7254 27492 - lda temp1 7255 27492 - adc visibleDLLstart 7256 27492 - tax 7257 27492 - lda DLLMEM,x 7258 27492 - ora #%10000000 7259 27492 - sta DLLMEM,x 7260 27492 - ifconst DOUBLEBUFFER 7261 27492 - sta DLLMEM+DBOFFSET,x 7262 27492 - endif ; DOUBLEBUFFER 7263 27492 - clc 7264 27492 - lda temp2 7265 27492 - adc visibleDLLstart 7266 27492 - tax 7267 27492 - lda DLLMEM,x 7268 27492 - ora #%10000000 7269 27492 - sta DLLMEM,x 7270 27492 - ifconst DOUBLEBUFFER 7271 27492 - sta DLLMEM+DBOFFSET,x 7272 27492 - endif ; DOUBLEBUFFER 7273 27492 - jsr vblankresync 7274 27492 - rts 7275 27492 endif ; USED_ADJUSTVISIBLE 7276 27492 7277 27492 vblankresync 7278 27492 20 30 f5 jsr waitforvblankstart ; ensure vblank just started 7279 27495 a9 00 lda #0 7280 27497 85 4d sta visibleover 7281 27499 a9 03 lda #3 7282 2749b 8d b2 01 sta interruptindex 7283 2749e 60 rts 7284 2749f 7285 2749f createallgamedlls 7286 2749f a2 00 ldx #0 7287 274a1 a9 19 lda #NVLINES 7288 274a3 ac 09 21 ldy paldetected 7289 274a6 f0 03 beq skipcreatePALpadding 7290 274a8 18 clc 7291 274a9 69 15 adc #21 7292 274ab skipcreatePALpadding 7293 274ab 20 e0 f4 jsr createnonvisibledlls 7294 274ae 8e 3c 21 stx visibleDLLstart 7295 274b1 20 11 f5 jsr createvisiblezones 7296 274b4 8e 3d 21 stx overscanDLLstart 7297 274b7 createallgamedllscontinue 7298 274b7 a9 50 lda #(NVLINES+55) ; extras for PAL 7299 274b9 20 e0 f4 jsr createnonvisibledlls 7300 274bc 7301 274bc ae 3c 21 ldx visibleDLLstart 7302 274bf bd 00 18 lda DLLMEM,x 7303 274c2 09 80 ora #%10000000 ; NMI 1 - start of visible screen 7304 274c4 9d 00 18 sta DLLMEM,x 7305 274c7 - ifconst DOUBLEBUFFER 7306 274c7 - sta DLLMEM+DBOFFSET,x 7307 274c7 endif ; DOUBLEBUFFER 7308 274c7 7309 274c7 ae 3d 21 ldx overscanDLLstart 7310 274ca bd 00 18 lda DLLMEM,x 7311 274cd 09 83 ora #%10000011 ; NMI 2 - end of visible screen 7312 274cf 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 7313 274d1 9d 00 18 sta DLLMEM,x 7314 274d4 - ifconst DOUBLEBUFFER 7315 274d4 - sta DLLMEM+DBOFFSET,x 7316 274d4 endif ; DOUBLEBUFFER 7317 274d4 7318 274d4 e8 inx 7319 274d5 e8 inx 7320 274d6 e8 inx 7321 274d7 7322 274d7 bd 00 18 lda DLLMEM,x 7323 274da 09 80 ora #%10000000 ; NMI 3 - deeper overscan 7324 274dc 9d 00 18 sta DLLMEM,x 7325 274df - ifconst DOUBLEBUFFER 7326 274df - sta DLLMEM+DBOFFSET,x 7327 274df endif ; DOUBLEBUFFER 7328 274df 7329 274df 60 rts 7330 274e0 7331 274e0 createnonvisibledlls 7332 274e0 85 42 sta temp1 7333 274e2 4a lsr 7334 274e3 4a lsr 7335 274e4 4a lsr 7336 274e5 4a lsr ; /16 7337 274e6 f0 09 beq skipcreatenonvisibledlls1loop 7338 274e8 a8 tay 7339 274e9 createnonvisibledlls1loop 7340 274e9 a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 7341 274eb 20 00 f5 jsr createblankdllentry 7342 274ee 88 dey 7343 274ef d0 f8 bne createnonvisibledlls1loop 7344 274f1 skipcreatenonvisibledlls1loop 7345 274f1 a5 42 lda temp1 7346 274f3 29 0f and #%00001111 7347 274f5 f0 08 beq createnonvisibledllsreturn 7348 274f7 38 sec 7349 274f8 e9 01 sbc #1 7350 274fa 09 40 ora #%01000000 7351 274fc 20 00 f5 jsr createblankdllentry 7352 274ff createnonvisibledllsreturn 7353 274ff 60 rts 7354 27500 7355 27500 createblankdllentry 7356 27500 9d 00 18 sta DLLMEM,x 7357 27503 - ifconst DOUBLEBUFFER 7358 27503 - sta DLLMEM+DBOFFSET,x 7359 27503 endif ; DOUBLEBUFFER 7360 27503 e8 inx 7361 27504 a9 21 lda #$21 ; blank 7362 27506 9d 00 18 sta DLLMEM,x 7363 27509 - ifconst DOUBLEBUFFER 7364 27509 - sta DLLMEM+DBOFFSET,x 7365 27509 endif ; DOUBLEBUFFER 7366 27509 e8 inx 7367 2750a a9 00 lda #$00 7368 2750c 9d 00 18 sta DLLMEM,x 7369 2750f - ifconst DOUBLEBUFFER 7370 2750f - sta DLLMEM+DBOFFSET,x 7371 2750f endif ; DOUBLEBUFFER 7372 2750f e8 inx 7373 27510 60 rts 7374 27511 7375 27511 createvisiblezones 7376 27511 a0 00 ldy #0 7377 27513 createvisiblezonesloop 7378 27513 b9 93 f6 lda.w DLHEIGHT,y 7379 27516 09 20 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 7380 27518 9d 00 18 sta DLLMEM,x 7381 2751b - ifconst DOUBLEBUFFER 7382 2751b - sta DLLMEM+DBOFFSET,x 7383 2751b endif ; DOUBLEBUFFER 7384 2751b e8 inx 7385 2751c b9 63 f6 lda DLPOINTH,y 7386 2751f 9d 00 18 sta DLLMEM,x 7387 27522 - ifconst DOUBLEBUFFER 7388 27522 - sta DLLMEM+DBOFFSET,x 7389 27522 endif ; DOUBLEBUFFER 7390 27522 e8 inx 7391 27523 b9 7b f6 lda DLPOINTL,y 7392 27526 9d 00 18 sta DLLMEM,x 7393 27529 - ifconst DOUBLEBUFFER 7394 27529 - clc 7395 27529 - adc #DOUBLEBUFFEROFFSET 7396 27529 - sta DLLMEM+DBOFFSET,x 7397 27529 - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 7398 27529 - inc DLLMEM+DBOFFSET-1,x 7399 27529 -skiphidoublebufferadjust 7400 27529 endif ; DOUBLEBUFFER 7401 27529 e8 inx 7402 2752a c8 iny 7403 2752b c0 18 cpy #WZONECOUNT 7404 2752d d0 e4 bne createvisiblezonesloop 7405 2752f 60 rts 7406 27530 7407 27530 waitforvblankstart 7408 27530 vblankendwait 7409 27530 24 28 BIT MSTAT 7410 27532 30 fc bmi vblankendwait 7411 27534 vblankstartwait 7412 27534 24 28 BIT MSTAT 7413 27536 10 fc bpl vblankstartwait 7414 27538 60 rts 7415 27539 7416 27539 - ifconst DOUBLEBUFFER 7417 27539 -flipdisplaybufferreturn 7418 27539 - rts 7419 27539 -flipdisplaybuffer 7420 27539 - ifconst interrupthold 7421 27539 - lda #$FF 7422 27539 - sta interrupthold 7423 27539 - endif 7424 27539 - lda doublebufferstate 7425 27539 - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 7426 27539 - 7427 27539 - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 7428 27539 - 7429 27539 - lda doublebufferstate 7430 27539 - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 7431 27539 - tax 7432 27539 - 7433 27539 - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 7434 27539 - 7435 27539 -flipdisplaybufferwait1 7436 27539 - lda visibleover 7437 27539 - beq flipdisplaybufferwait1 7438 27539 - 7439 27539 -flipdisplaybufferwait 7440 27539 - lda visibleover 7441 27539 - bne flipdisplaybufferwait 7442 27539 - 7443 27539 - lda doublebufferminimumframetarget 7444 27539 - beq skipminimumframecode 7445 27539 - lda doublebufferminimumframeindex 7446 27539 - bne flipdisplaybufferwait1 7447 27539 - lda doublebufferminimumframetarget 7448 27539 - sta doublebufferminimumframeindex 7449 27539 -skipminimumframecode 7450 27539 - 7451 27539 - lda DLLMEMLutHi,x 7452 27539 - sta DPPH 7453 27539 - lda DLLMEMLutLo,x 7454 27539 - sta DPPL 7455 27539 - 7456 27539 - lda NewPageflipstate,x 7457 27539 - sta doublebufferstate 7458 27539 - lda NewPageflipoffset,x 7459 27539 - sta doublebufferdloffset 7460 27539 - 7461 27539 - lda doublebufferbufferdirty 7462 27539 - beq flipdisplaybufferreturn 7463 27539 - 7464 27539 - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 7465 27539 - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 7466 27539 - ; from the displayed buffer to the working buffer... 7467 27539 - 7468 27539 - lda doublebufferdloffset 7469 27539 - eor #DOUBLEBUFFEROFFSET 7470 27539 - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 7471 27539 - 7472 27539 - ldx #(WZONECOUNT-1) 7473 27539 -copybufferzoneloop 7474 27539 - 7475 27539 - lda DLPOINTL,x 7476 27539 - clc 7477 27539 - adc doublebufferdloffset 7478 27539 - sta temp1 7479 27539 - lda DLPOINTH,x 7480 27539 - adc #0 7481 27539 - sta temp2 7482 27539 - 7483 27539 - lda DLPOINTL,x 7484 27539 - clc 7485 27539 - adc temp6 7486 27539 - sta temp3 7487 27539 - lda DLPOINTH,x 7488 27539 - adc #0 7489 27539 - sta temp4 7490 27539 - 7491 27539 - lda dlendsave,x 7492 27539 - tay 7493 27539 -copybuffercharsloop 7494 27539 - lda (temp3),y 7495 27539 - sta (temp1),y 7496 27539 - dey 7497 27539 - bpl copybuffercharsloop 7498 27539 - dex 7499 27539 - bpl copybufferzoneloop 7500 27539 - lda #0 7501 27539 - sta doublebufferbufferdirty 7502 27539 - rts 7503 27539 - 7504 27539 -doublebufferoff 7505 27539 - lda #1 7506 27539 - sta doublebufferstate 7507 27539 - jsr flipdisplaybuffer 7508 27539 - lda #0 7509 27539 - sta doublebufferstate 7510 27539 - sta doublebufferdloffset 7511 27539 - rts 7512 27539 - 7513 27539 -DLLMEMLutLo 7514 27539 - .byte DLLMEM,>(DLLMEM+DBOFFSET) 7517 27539 -NewPageflipstate 7518 27539 - .byte 3,1 7519 27539 -NewPageflipoffset 7520 27539 - .byte DOUBLEBUFFEROFFSET,0 7521 27539 - 7522 27539 endif ; DOUBLEBUFFER 7523 27539 7524 27539 - ifconst MOUSESUPPORT 7525 27539 - 7526 27539 -rotationalcompare 7527 27539 - ; old = 00 01 10 11 7528 27539 - .byte $00, $01, $ff, $00 ; new=00 7529 27539 - .byte $ff, $00, $00, $01 ; new=01 7530 27539 - .byte $01, $00, $00, $ff ; new=10 7531 27539 - .byte $00, $ff, $01, $00 ; new=11 7532 27539 - 7533 27539 - ; 0000YyXx st mouse 7534 27539 - 7535 27539 - ; 0000xyXY amiga mouse 7536 27539 - 7537 27539 - ifconst MOUSEXONLY 7538 27539 -amigatoataribits ; swap bits 1 and 4... 7539 27539 - .byte %0000, %0000, %0010, %0010 7540 27539 - .byte %0000, %0000, %0010, %0010 7541 27539 - .byte %0001, %0001, %0011, %0011 7542 27539 - .byte %0001, %0001, %0011, %0011 7543 27539 - 7544 27539 - ; null change bits 7545 27539 - .byte %0000, %0001, %0010, %0011 7546 27539 - .byte %0000, %0001, %0010, %0011 7547 27539 - .byte %0000, %0001, %0010, %0011 7548 27539 - .byte %0000, %0001, %0010, %0011 7549 27539 - 7550 27539 - else ; !MOUSEXONLY 7551 27539 - 7552 27539 -amigatoataribits ; swap bits 1 and 4... 7553 27539 - .byte %0000, %1000, %0010, %1010 7554 27539 - .byte %0100, %1100, %0110, %1110 7555 27539 - .byte %0001, %1001, %0011, %1011 7556 27539 - .byte %0101, %1101, %0111, %1111 7557 27539 - ; null change bits 7558 27539 - .byte %0000, %0001, %0010, %0011 7559 27539 - .byte %0100, %0101, %0110, %0111 7560 27539 - .byte %1000, %1001, %1010, %1011 7561 27539 - .byte %1100, %1101, %1110, %1111 7562 27539 - endif ; !MOUSEXONLY 7563 27539 - 7564 27539 endif ; MOUSESUPPORT 7565 27539 7566 27539 mouse0update 7567 27539 - ifconst MOUSE0SUPPORT 7568 27539 - 7569 27539 -mousetableselect = inttemp2 7570 27539 -mousexdelta = inttemp3 7571 27539 -mouseydelta = inttemp4 7572 27539 -lastSWCHA = inttemp6 7573 27539 - 7574 27539 - ; 0000YyXx st mouse 7575 27539 - ; 0000xyXY amiga mouse 7576 27539 - 7577 27539 - lda #$ff 7578 27539 - sta lastSWCHA 7579 27539 - 7580 27539 - ldy port0control 7581 27539 - 7582 27539 - lda #%00010000 7583 27539 - cpy #9 ; AMIGA? 7584 27539 - bne skipamigabitsfix0 7585 27539 - lda #0 7586 27539 -skipamigabitsfix0 7587 27539 - sta mousetableselect 7588 27539 - ifconst DRIVINGBOOST 7589 27539 - cpy #6 ; DRIVING? 7590 27539 - bne skipdriving0setup 7591 27539 - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 7592 27539 - ; trails the actual mousex0, so we can smoothly interpolate toward 7593 27539 - ; the actual position. This actual position is stored in mousey0 7594 27539 - ; after the driver has run. 7595 27539 - ldx mousex0 7596 27539 - lda mousey0 7597 27539 - stx mousey0 7598 27539 - sta mousex0 7599 27539 -skipdriving0setup 7600 27539 - endif ; DRIVINGBOOST 7601 27539 - 7602 27539 - lda #0 7603 27539 - sta mousexdelta 7604 27539 - sta mouseydelta 7605 27539 - 7606 27539 - ifnconst MOUSETIME 7607 27539 - ifnconst MOUSEXONLY 7608 27539 - lda #180 ; minimum for x+y 7609 27539 - else 7610 27539 - lda #100 ; minimum for just x 7611 27539 - endif 7612 27539 - else 7613 27539 - lda #MOUSETIME 7614 27539 - endif 7615 27539 - jsr SETTIM64T ; INTIM is in Y 7616 27539 - 7617 27539 -mouse0updateloop 7618 27539 - lda SWCHA 7619 27539 - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 7620 27539 - cmp lastSWCHA 7621 27539 - beq mouse0loopcondition 7622 27539 - sta lastSWCHA 7623 27539 - lsr 7624 27539 - lsr 7625 27539 - lsr 7626 27539 - 7627 27539 - ora mousetableselect ; atari/amiga decoding table selection 7628 27539 - 7629 27539 - ; st mice encode on different bits/joystick-lines than amiga mice... 7630 27539 - ; 0000YyXx st mouse 7631 27539 - ; 0000xyXY amiga mouse 7632 27539 - ; ...so can shuffle the amiga bits to reuse the st driver. 7633 27539 - tay 7634 27539 - lax amigatoataribits,y 7635 27539 - 7636 27539 - ifnconst MOUSEXONLY 7637 27539 - ; first the Y... 7638 27539 - and #%00001100 7639 27539 - ora mousecodey0 7640 27539 - tay 7641 27539 - lda rotationalcompare,y 7642 27539 - clc 7643 27539 - adc mouseydelta 7644 27539 - sta mouseydelta 7645 27539 - tya 7646 27539 - lsr 7647 27539 - lsr 7648 27539 - sta mousecodey0 7649 27539 - txa 7650 27539 - ; ...then the X... 7651 27539 - and #%00000011 7652 27539 - tax 7653 27539 - endif ; !MOUSEXONLY 7654 27539 - 7655 27539 - asl 7656 27539 - asl 7657 27539 - ora mousecodex0 7658 27539 - tay 7659 27539 - lda rotationalcompare,y 7660 27539 - adc mousexdelta ; carry was clear by previous ASL 7661 27539 - sta mousexdelta 7662 27539 - stx mousecodex0 7663 27539 -mouse0loopcondition 7664 27539 - lda TIMINT 7665 27539 - bpl mouse0updateloop 7666 27539 - 7667 27539 - ; *** adapt to selected device resolution. 7668 27539 - ldx port0control 7669 27539 - 7670 27539 - ifconst PRECISIONMOUSING 7671 27539 - ldy port0resolution 7672 27539 - bne mouse0halveddone 7673 27539 - cpx #6 ; half-resolution is no good for driving wheels 7674 27539 - beq mouse0halveddone 7675 27539 - ; resolution=0 is half mouse resolution, necessary for precision 7676 27539 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7677 27539 - 7678 27539 - lda mousexdelta 7679 27539 - cmp #$80 7680 27539 - ror ; do a signed divide by 2. 7681 27539 - clc 7682 27539 - adc mousex0 7683 27539 - sta mousex0 7684 27539 - ifnconst MOUSEXONLY 7685 27539 - lda mouseydelta 7686 27539 - clc 7687 27539 - adc mousey0 7688 27539 - sta mousey0 7689 27539 - endif 7690 27539 - ; at half resolution we just exit after updating x and y 7691 27539 - jmp LLRET0 7692 27539 -mouse0halveddone 7693 27539 - endif ; PRECISIONMOUSING 7694 27539 - 7695 27539 - ifnconst MOUSEXONLY 7696 27539 - asl mouseydelta ; *2 because Y resolution is finer 7697 27539 - ldy port0resolution 7698 27539 - dey 7699 27539 - lda #0 7700 27539 -mousey0resolutionfix 7701 27539 - clc 7702 27539 - adc mouseydelta 7703 27539 - dey 7704 27539 - bpl mousey0resolutionfix 7705 27539 - clc 7706 27539 - adc mousey0 7707 27539 - sta mousey0 7708 27539 - endif ; MOUSEXONLY 7709 27539 - 7710 27539 - ldy port0resolution 7711 27539 - dey 7712 27539 - lda #0 7713 27539 -mousex0resolutionfix 7714 27539 - clc 7715 27539 - adc mousexdelta 7716 27539 - dey 7717 27539 - bpl mousex0resolutionfix 7718 27539 - ifnconst DRIVINGBOOST 7719 27539 - clc 7720 27539 - adc mousex0 7721 27539 - sta mousex0 7722 27539 - else 7723 27539 - cpx #6 7724 27539 - beq carryonmouse0boost 7725 27539 - clc 7726 27539 - adc mousex0 7727 27539 - sta mousex0 7728 27539 - jmp LLRET0 7729 27539 -carryonmouse0boost 7730 27539 - sta mousexdelta 7731 27539 - clc 7732 27539 - adc mousecodey0 7733 27539 - sta mousecodey0 7734 27539 - clc 7735 27539 - adc mousex0 7736 27539 - tay ; save the target X 7737 27539 - adc mousey0 ; average in the smoothly-trailing X 7738 27539 - ror 7739 27539 - sta mousex0 ; mousex0 now has the smoothly trailing X 7740 27539 - sty mousey0 ; and mousey0 has the the target X 7741 27539 - 7742 27539 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7743 27539 - ; A has mousex0, the smoothly trailing X 7744 27539 - sbc mousey0 ; less the target X 7745 27539 - bpl skipabsolutedrive0 7746 27539 - eor #$ff 7747 27539 -skipabsolutedrive0 7748 27539 - cmp #64 ; just an unreasonably large change 7749 27539 - bcc skipdrivewrapfix0 7750 27539 - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 7751 27539 -skipdrivewrapfix0 7752 27539 - 7753 27539 - ; get rid of the tweening if the distance travelled was very small 7754 27539 - lda mousexdelta 7755 27539 - cmp port0resolution 7756 27539 - bcs skipbetweenfix0 7757 27539 - lda mousex0 7758 27539 - sta mousey0 7759 27539 -skipbetweenfix0 7760 27539 - 7761 27539 -drivingboostreductioncheck0 7762 27539 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7763 27539 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7764 27539 - ; negated again because truncation during BCD math results in 7765 27539 - ; differing magnitudes, depending if the value is +ve or -ve. 7766 27539 -driving0fix 7767 27539 - lax mousecodey0 7768 27539 - cmp #$80 7769 27539 - bcs driving0skipnegate1 7770 27539 - eor #$FF 7771 27539 - adc #1 7772 27539 - sta mousecodey0 7773 27539 -driving0skipnegate1 7774 27539 - cmp #$80 7775 27539 - ror 7776 27539 - cmp #$80 7777 27539 - ror 7778 27539 - cmp #$80 7779 27539 - ror 7780 27539 - sta inttemp1 7781 27539 - lda mousecodey0 7782 27539 - sec 7783 27539 - sbc inttemp1 7784 27539 - cpx #$80 7785 27539 - bcs driving0skipnegate2 7786 27539 - eor #$FF 7787 27539 - adc #1 7788 27539 -driving0skipnegate2 7789 27539 - sta mousecodey0 7790 27539 -drivingboostdone0 7791 27539 - endif ; DRIVINGBOOST 7792 27539 - 7793 27539 - jmp LLRET0 7794 27539 - 7795 27539 endif ; MOUSE0SUPPORT 7796 27539 7797 27539 mouse1update 7798 27539 - ifconst MOUSE1SUPPORT 7799 27539 - 7800 27539 -mousetableselect = inttemp2 7801 27539 -mousexdelta = inttemp3 7802 27539 -mouseydelta = inttemp4 7803 27539 -lastSWCHA = inttemp6 7804 27539 - 7805 27539 - ; 0000YyXx st mouse 7806 27539 - ; 0000xyXY amiga mouse 7807 27539 - 7808 27539 - lda #$ff 7809 27539 - sta lastSWCHA 7810 27539 - 7811 27539 - ldy port1control 7812 27539 - 7813 27539 - lda #%00010000 7814 27539 - cpy #9 ; AMIGA? 7815 27539 - bne skipamigabitsfix1 7816 27539 - lda #0 7817 27539 -skipamigabitsfix1 7818 27539 - sta mousetableselect 7819 27539 - ifconst DRIVINGBOOST 7820 27539 - cpy #6 ; DRIVING? 7821 27539 - bne skipdriving1setup 7822 27539 - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 7823 27539 - ; trails the actual mousex1, so we can smoothly interpolate toward 7824 27539 - ; the actual position. This actual position is stored in mousey1 7825 27539 - ; after the driver has run. 7826 27539 - ldx mousex1 7827 27539 - lda mousey1 7828 27539 - stx mousey1 7829 27539 - sta mousex1 7830 27539 -skipdriving1setup 7831 27539 - endif ; DRIVINGBOOST 7832 27539 - 7833 27539 - lda #0 7834 27539 - sta mousexdelta 7835 27539 - sta mouseydelta 7836 27539 - 7837 27539 - ifnconst MOUSETIME 7838 27539 - ifnconst MOUSEXONLY 7839 27539 - lda #180 ; minimum for x+y 7840 27539 - else 7841 27539 - lda #100 ; minimum for just x 7842 27539 - endif 7843 27539 - else 7844 27539 - lda #MOUSETIME 7845 27539 - endif 7846 27539 - jsr SETTIM64T ; INTIM is in Y 7847 27539 - 7848 27539 -mouse1updateloop 7849 27539 - lda SWCHA 7850 27539 - and #%00001111 7851 27539 - cmp lastSWCHA 7852 27539 - beq mouse1loopcondition 7853 27539 - sta lastSWCHA 7854 27539 - 7855 27539 - ora mousetableselect ; atari/amiga decoding table selection 7856 27539 - 7857 27539 - ; st mice encode on different bits/joystick-lines than amiga mice... 7858 27539 - ; 0000YyXx st mouse 7859 27539 - ; 0000xyXY amiga mouse 7860 27539 - ; ...so can shuffle the amiga bits to reuse the st driver. 7861 27539 - tay 7862 27539 - lax amigatoataribits,y 7863 27539 - 7864 27539 - ifnconst MOUSEXONLY 7865 27539 - ; first the Y... 7866 27539 - and #%00001100 7867 27539 - ora mousecodey1 7868 27539 - tay 7869 27539 - lda rotationalcompare,y 7870 27539 - clc 7871 27539 - adc mouseydelta 7872 27539 - sta mouseydelta 7873 27539 - tya 7874 27539 - lsr 7875 27539 - lsr 7876 27539 - sta mousecodey1 7877 27539 - txa 7878 27539 - ; ...then the X... 7879 27539 - and #%00000011 7880 27539 - tax 7881 27539 - endif ; !MOUSEXONLY 7882 27539 - 7883 27539 - asl 7884 27539 - asl 7885 27539 - ora mousecodex1 7886 27539 - tay 7887 27539 - lda rotationalcompare,y 7888 27539 - adc mousexdelta ; carry was clear by previous ASL 7889 27539 - sta mousexdelta 7890 27539 - stx mousecodex1 7891 27539 -mouse1loopcondition 7892 27539 - lda TIMINT 7893 27539 - bpl mouse1updateloop 7894 27539 - 7895 27539 - ; *** adapt to selected device resolution. 7896 27539 - ldx port1control 7897 27539 - 7898 27539 - ifconst PRECISIONMOUSING 7899 27539 - ldy port1resolution 7900 27539 - bne mouse1halveddone 7901 27539 - cpx #6 ; half-resolution is no good for driving wheels 7902 27539 - beq mouse1halveddone 7903 27539 - ; resolution=0 is half mouse resolution, necessary for precision 7904 27539 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7905 27539 - 7906 27539 - lda mousexdelta 7907 27539 - cmp #$80 7908 27539 - ror ; do a signed divide by 2. 7909 27539 - clc 7910 27539 - adc mousex1 7911 27539 - sta mousex1 7912 27539 - ifnconst MOUSEXONLY 7913 27539 - lda mouseydelta 7914 27539 - clc 7915 27539 - adc mousey1 7916 27539 - sta mousey1 7917 27539 - endif 7918 27539 - ; at half resolution we just exit after updating x and y 7919 27539 - jmp LLRET1 7920 27539 -mouse1halveddone 7921 27539 - endif ; PRECISIONMOUSING 7922 27539 - 7923 27539 - ifnconst MOUSEXONLY 7924 27539 - asl mouseydelta ; *2 because Y resolution is finer 7925 27539 - ldy port1resolution 7926 27539 - dey 7927 27539 - lda #0 7928 27539 -mousey1resolutionfix 7929 27539 - clc 7930 27539 - adc mouseydelta 7931 27539 - dey 7932 27539 - bpl mousey1resolutionfix 7933 27539 - clc 7934 27539 - adc mousey1 7935 27539 - sta mousey1 7936 27539 - endif ; MOUSEXONLY 7937 27539 - 7938 27539 - ldy port1resolution 7939 27539 - dey 7940 27539 - lda #0 7941 27539 -mousex1resolutionfix 7942 27539 - clc 7943 27539 - adc mousexdelta 7944 27539 - dey 7945 27539 - bpl mousex1resolutionfix 7946 27539 - ifnconst DRIVINGBOOST 7947 27539 - clc 7948 27539 - adc mousex1 7949 27539 - sta mousex1 7950 27539 - else 7951 27539 - cpx #6 7952 27539 - beq carryonmouse1boost 7953 27539 - clc 7954 27539 - adc mousex1 7955 27539 - sta mousex1 7956 27539 - jmp LLRET1 7957 27539 -carryonmouse1boost 7958 27539 - sta mousexdelta 7959 27539 - clc 7960 27539 - adc mousecodey1 7961 27539 - sta mousecodey1 7962 27539 - clc 7963 27539 - adc mousex1 7964 27539 - tay ; save the target X 7965 27539 - adc mousey1 ; average in the smoothly-trailing X 7966 27539 - ror 7967 27539 - sta mousex1 ; mousex0 now has the smoothly trailing X 7968 27539 - sty mousey1 ; and mousey0 has the the target X 7969 27539 - 7970 27539 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7971 27539 - ; A has mousex1, the smoothly trailing X 7972 27539 - sbc mousey1 ; less the target X 7973 27539 - bpl skipabsolutedrive1 7974 27539 - eor #$ff 7975 27539 -skipabsolutedrive1 7976 27539 - cmp #64 ; just an unreasonably large change 7977 27539 - bcc skipdrivewrapfix1 7978 27539 - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 7979 27539 -skipdrivewrapfix1 7980 27539 - 7981 27539 - ; get rid of the tweening if the distance travelled was very small 7982 27539 - lda mousexdelta 7983 27539 - cmp port1resolution 7984 27539 - bcs skipbetweenfix1 7985 27539 - lda mousex1 7986 27539 - sta mousey1 7987 27539 -skipbetweenfix1 7988 27539 - 7989 27539 -drivingboostreductioncheck1 7990 27539 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7991 27539 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7992 27539 - ; negated again because truncation during BCD math results in 7993 27539 - ; differing magnitudes, depending if the value is +ve or -ve. 7994 27539 -driving1fix 7995 27539 - lax mousecodey1 7996 27539 - cmp #$80 7997 27539 - bcs driving0skipnegate1 7998 27539 - eor #$FF 7999 27539 - adc #1 8000 27539 - sta mousecodey1 8001 27539 -driving0skipnegate1 8002 27539 - cmp #$80 8003 27539 - ror 8004 27539 - cmp #$80 8005 27539 - ror 8006 27539 - cmp #$80 8007 27539 - ror 8008 27539 - sta inttemp1 8009 27539 - lda mousecodey1 8010 27539 - sec 8011 27539 - sbc inttemp1 8012 27539 - cpx #$80 8013 27539 - bcs driving1skipnegate2 8014 27539 - eor #$FF 8015 27539 - adc #1 8016 27539 -driving1skipnegate2 8017 27539 - sta mousecodey1 8018 27539 -drivingboostdone1 8019 27539 - endif ; DRIVINGBOOST 8020 27539 - 8021 27539 - jmp LLRET1 8022 27539 - 8023 27539 endif ; MOUSE1SUPPORT 8024 27539 8025 27539 8026 27539 trakball0update 8027 27539 - ifconst TRAKBALL0SUPPORT 8028 27539 - ifnconst TRAKTIME 8029 27539 - ifnconst TRAKXONLY 8030 27539 - lda #180 ; minimum for x+y 8031 27539 - else ; !TRAKXONLY 8032 27539 - lda #100 ; minimum for just x 8033 27539 - endif ; !TRAKXONLY 8034 27539 - else ; !TRAKTIME 8035 27539 - lda #TRAKTIME 8036 27539 - endif ; !TRAKTIME 8037 27539 - jsr SETTIM64T ; INTIM is in Y 8038 27539 - ldx #0 8039 27539 - ifnconst TRAKXONLY 8040 27539 - ldy #0 8041 27539 - endif ; TRAKXONLY 8042 27539 -trakball0updateloop 8043 27539 - lda SWCHA 8044 27539 - and #%00110000 8045 27539 - cmp trakballcodex0 8046 27539 - sta trakballcodex0 8047 27539 - beq trakball0movementXdone 8048 27539 - and #%00010000 8049 27539 - beq trakball0negativeX 8050 27539 -trakball0positiveX 8051 27539 - ;(2 from beq) 8052 27539 - inx ; 2 8053 27539 - jmp trakball0movementXdone ; 3 8054 27539 -trakball0negativeX 8055 27539 - ;(3 from beq) 8056 27539 - dex ; 2 8057 27539 - nop ; 2 8058 27539 -trakball0movementXdone 8059 27539 - 8060 27539 - ifnconst TRAKXONLY 8061 27539 - lda SWCHA 8062 27539 - and #%11000000 8063 27539 - cmp trakballcodey0 8064 27539 - sta trakballcodey0 8065 27539 - beq trakball0movementYdone 8066 27539 - and #%01000000 8067 27539 - beq trakball0negativeY 8068 27539 -trakball0positiveY 8069 27539 - ;(2 from beq) 8070 27539 - iny ; 2 8071 27539 - jmp trakball0movementYdone ; 3 8072 27539 -trakball0negativeY 8073 27539 - ;(3 from beq) 8074 27539 - dey ; 2 8075 27539 - nop ; 2 8076 27539 -trakball0movementYdone 8077 27539 - endif ; !TRAKXONLY 8078 27539 - 8079 27539 - lda TIMINT 8080 27539 - bpl trakball0updateloop 8081 27539 - lda #0 8082 27539 - cpx #0 8083 27539 - beq trakball0skipXadjust 8084 27539 - clc 8085 27539 -trakball0Xloop 8086 27539 - adc port0resolution 8087 27539 - dex 8088 27539 - bne trakball0Xloop 8089 27539 - clc 8090 27539 - adc trakballx0 8091 27539 - sta trakballx0 8092 27539 -trakball0skipXadjust 8093 27539 - ifnconst TRAKXONLY 8094 27539 - lda #0 8095 27539 - cpy #0 8096 27539 - beq trakball0skipYadjust 8097 27539 - clc 8098 27539 -trakball0yloop 8099 27539 - adc port0resolution 8100 27539 - dey 8101 27539 - bne trakball0yloop 8102 27539 - clc 8103 27539 - adc trakbally0 8104 27539 - sta trakbally0 8105 27539 -trakball0skipYadjust 8106 27539 - endif ; !TRAKXONLY 8107 27539 - 8108 27539 - jmp LLRET0 8109 27539 endif 8110 27539 8111 27539 8112 27539 8113 27539 trakball1update 8114 27539 - ifconst TRAKBALL1SUPPORT 8115 27539 - ifnconst TRAKTIME 8116 27539 - ifnconst TRAKXONLY 8117 27539 - lda #180 ; minimum for x+y 8118 27539 - else ; !TRAKXONLY 8119 27539 - lda #100 ; minimum for just x 8120 27539 - endif ; !TRAKXONLY 8121 27539 - else ; !TRAKTIME 8122 27539 - lda #TRAKTIME 8123 27539 - endif ; !TRAKTIME 8124 27539 - jsr SETTIM64T ; INTIM is in Y 8125 27539 - ldx #0 8126 27539 - ifnconst TRAKXONLY 8127 27539 - ldy #0 8128 27539 - endif ; TRAKXONLY 8129 27539 -trakball1updateloop 8130 27539 - lda SWCHA 8131 27539 - and #%00000011 8132 27539 - cmp trakballcodex1 8133 27539 - sta trakballcodex1 8134 27539 - beq trakball1movementXdone 8135 27539 - and #%00000001 8136 27539 - beq trakball1negativeX 8137 27539 -trakball1positiveX 8138 27539 - ;(2 from beq) 8139 27539 - inx ; 2 8140 27539 - jmp trakball1movementXdone ; 3 8141 27539 -trakball1negativeX 8142 27539 - ;(3 from beq) 8143 27539 - dex ; 2 8144 27539 - nop ; 2 8145 27539 -trakball1movementXdone 8146 27539 - 8147 27539 - ifnconst TRAKXONLY 8148 27539 - lda SWCHA 8149 27539 - and #%00001100 8150 27539 - cmp trakballcodey1 8151 27539 - sta trakballcodey1 8152 27539 - beq trakball1movementYdone 8153 27539 - and #%00000100 8154 27539 - beq trakball1negativeY 8155 27539 -trakball1positiveY 8156 27539 - ;(2 from beq) 8157 27539 - iny ; 2 8158 27539 - jmp trakball1movementYdone ; 3 8159 27539 -trakball1negativeY 8160 27539 - ;(3 from beq) 8161 27539 - dey ; 2 8162 27539 - nop ; 2 8163 27539 -trakball1movementYdone 8164 27539 - endif ; !TRAKXONLY 8165 27539 - 8166 27539 - lda TIMINT 8167 27539 - bpl trakball1updateloop 8168 27539 - lda #0 8169 27539 - cpx #0 8170 27539 - beq trakball1skipXadjust 8171 27539 - clc 8172 27539 -trakball1Xloop 8173 27539 - adc port1resolution 8174 27539 - dex 8175 27539 - bne trakball1Xloop 8176 27539 - clc 8177 27539 - adc trakballx1 8178 27539 - sta trakballx1 8179 27539 -trakball1skipXadjust 8180 27539 - ifnconst TRAKXONLY 8181 27539 - lda #0 8182 27539 - cpy #0 8183 27539 - beq trakball1skipYadjust 8184 27539 - clc 8185 27539 -trakball1yloop 8186 27539 - adc port1resolution 8187 27539 - dey 8188 27539 - bne trakball1yloop 8189 27539 - clc 8190 27539 - adc trakbally1 8191 27539 - sta trakbally1 8192 27539 -trakball1skipYadjust 8193 27539 - endif ; !TRAKXONLY 8194 27539 - 8195 27539 - jmp LLRET1 8196 27539 endif 8197 27539 8198 27539 8199 27539 paddleport0update 8200 27539 - ifconst PADDLE0SUPPORT 8201 27539 - lda #6 8202 27539 - sta VBLANK ; start charging the paddle caps 8203 27539 - lda #0 ; use PADDLE timing 8204 27539 - jsr SETTIM64T ; INTIM is in Y 8205 27539 - 8206 27539 -paddleport0updateloop 8207 27539 - lda INPT0 8208 27539 - bmi skippaddle0setposition 8209 27539 - sty paddleposition0 8210 27539 -skippaddle0setposition 8211 27539 - ifconst TWOPADDLESUPPORT 8212 27539 - lda INPT1 8213 27539 - bmi skippaddle1setposition 8214 27539 - sty paddleposition1 8215 27539 -skippaddle1setposition 8216 27539 - endif 8217 27539 - ldy INTIM 8218 27539 - cpy #TIMEOFFSET 8219 27539 - bcs paddleport0updateloop 8220 27539 - 8221 27539 - lda #%10000110 8222 27539 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8223 27539 - sec 8224 27539 - lda paddleposition0 8225 27539 - sbc #TIMEOFFSET 8226 27539 - ifconst PADDLESCALEX2 8227 27539 - asl 8228 27539 - endif 8229 27539 - 8230 27539 - ifnconst PADDLESMOOTHINGOFF 8231 27539 - clc 8232 27539 - adc paddleprevious0 8233 27539 - ror 8234 27539 - sta paddleprevious0 8235 27539 - endif 8236 27539 - 8237 27539 - sta paddleposition0 8238 27539 - 8239 27539 - ifconst TWOPADDLESUPPORT 8240 27539 - sec 8241 27539 - lda paddleposition1 8242 27539 - sbc #TIMEOFFSET 8243 27539 - ifconst PADDLESCALEX2 8244 27539 - asl 8245 27539 - endif 8246 27539 - 8247 27539 - ifnconst PADDLESMOOTHINGOFF 8248 27539 - clc 8249 27539 - adc paddleprevious1 8250 27539 - ror 8251 27539 - sta paddleprevious1 8252 27539 - endif 8253 27539 - sta paddleposition1 8254 27539 - endif ; TWOPADDLESUPPORT 8255 27539 - 8256 27539 - jmp LLRET0 8257 27539 endif 8258 27539 8259 27539 paddleport1update 8260 27539 - ifconst PADDLE1SUPPORT 8261 27539 - lda #6 8262 27539 - sta VBLANK ; start charging the paddle caps 8263 27539 - 8264 27539 - lda #0 ; use PADDLE timing 8265 27539 - jsr SETTIM64T ; INTIM is in Y 8266 27539 - 8267 27539 -paddleport1updateloop 8268 27539 - lda INPT2 8269 27539 - bmi skippaddle2setposition 8270 27539 - sty paddleposition2 8271 27539 -skippaddle2setposition 8272 27539 - ifconst TWOPADDLESUPPORT 8273 27539 - lda INPT3 8274 27539 - bmi skippaddle3setposition 8275 27539 - sty paddleposition3 8276 27539 -skippaddle3setposition 8277 27539 - endif 8278 27539 - ldy INTIM 8279 27539 - cpy #TIMEOFFSET 8280 27539 - bcs paddleport1updateloop 8281 27539 - 8282 27539 - lda #%10000110 8283 27539 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8284 27539 - sec 8285 27539 - lda paddleposition2 8286 27539 - sbc #TIMEOFFSET 8287 27539 - ifconst PADDLESCALEX2 8288 27539 - asl 8289 27539 - endif 8290 27539 - 8291 27539 - ifnconst PADDLESMOOTHINGOFF 8292 27539 - clc 8293 27539 - adc paddleprevious2 8294 27539 - ror 8295 27539 - sta paddleprevious2 8296 27539 - endif 8297 27539 - 8298 27539 - sta paddleposition2 8299 27539 - 8300 27539 - ifconst TWOPADDLESUPPORT 8301 27539 - sec 8302 27539 - lda paddleposition3 8303 27539 - sbc #TIMEOFFSET 8304 27539 - ifconst PADDLESCALEX2 8305 27539 - asl 8306 27539 - endif 8307 27539 - 8308 27539 - ifnconst PADDLESMOOTHINGOFF 8309 27539 - clc 8310 27539 - adc paddleprevious3 8311 27539 - ror 8312 27539 - sta paddleprevious3 8313 27539 - endif 8314 27539 - sta paddleposition3 8315 27539 - endif ; TWOPADDLESUPPORT 8316 27539 - 8317 27539 - jmp LLRET1 8318 27539 endif 8319 27539 8320 27539 8321 27539 paddlebuttonhandler ; outside of conditional, for button-handler LUT 8322 27539 - ifconst PADDLESUPPORT 8323 27539 - ; x=0|1 for port, rather than paddle #. 8324 27539 - ; Only the first paddle button will integrate into "joy0fire" testing. If the 8325 27539 - ; game wants to support 2 paddles, up to the game to instead test the 8326 27539 - ; joystick right+left directions instead. 8327 27539 - lda SWCHA ; top of nibble is first paddle button 8328 27539 - cpx #0 ; port 0? 8329 27539 - beq skippaddleport2shift 8330 27539 - asl ; shift second port to upper nibble 8331 27539 - asl 8332 27539 - asl 8333 27539 - asl 8334 27539 -skippaddleport2shift 8335 27539 - and #%10000000 8336 27539 - eor #%10000000 ; invert 8337 27539 - sta sINPT1,x 8338 27539 - jmp buttonreadloopreturn 8339 27539 endif ; PADDLESUPPORT 8340 27539 8341 27539 mousebuttonhandler ; outside of conditional, for button-handler LUT 8342 27539 - ifconst MOUSESUPPORT 8343 27539 - ; stick the mouse buttons in the correct shadow register... 8344 27539 - txa 8345 27539 - asl 8346 27539 - tay ; y=x*2 8347 27539 - lda INPT4,x 8348 27539 - eor #%10000000 8349 27539 - lsr 8350 27539 - sta sINPT1,x 8351 27539 - 8352 27539 - lda INPT1,y 8353 27539 - and #%10000000 8354 27539 - eor #%10000000 8355 27539 - ora sINPT1,x 8356 27539 - sta sINPT1,x 8357 27539 - jmp buttonreadloopreturn 8358 27539 endif ; MOUSESUPPORT 8359 27539 8360 27539 - ifconst KEYPADSUPPORT 8361 27539 - ; ** select keypad rows 0 to 3 over 4 frames... 8362 27539 -keypadrowselect 8363 27539 - ldy #0 8364 27539 - lda port0control 8365 27539 - cmp #7 8366 27539 - bne skipport0val 8367 27539 - iny ; y=y+1 8368 27539 -skipport0val 8369 27539 - lda port1control 8370 27539 - cmp #7 8371 27539 - bne skipport1val 8372 27539 - iny 8373 27539 - iny ; y=y+2 8374 27539 -skipport1val 8375 27539 - lda keyrowdirectionmask,y 8376 27539 - sta CTLSWA 8377 27539 - tya 8378 27539 - asl 8379 27539 - asl 8380 27539 - sta inttemp1 8381 27539 - lda framecounter 8382 27539 - and #3 8383 27539 - ora inttemp1 8384 27539 - tax 8385 27539 - lda keyrowselectvalue,x 8386 27539 - sta SWCHA 8387 27539 - rts 8388 27539 - 8389 27539 -keyrowdirectionmask 8390 27539 - .byte #%00000000 ; 0 : port0=input port1=input 8391 27539 - .byte #%11110000 ; 1 : port0=output port1=input 8392 27539 - .byte #%00001111 ; 2 : port0=input port1=output 8393 27539 - .byte #%11111111 ; 3 : port0=output port1=output 8394 27539 - 8395 27539 -keyrowselectvalue 8396 27539 - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 8397 27539 - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 8398 27539 - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 8399 27539 - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 8400 27539 endif ; KEYPADSUPPORT 8401 27539 8402 27539 - ifconst KEYPADSUPPORT 8403 27539 - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 8404 27539 -keypadcolumnread 8405 27539 - lda port0control 8406 27539 - cmp #7 8407 27539 - bne skipkeypadcolumnread0 8408 27539 - lda framecounter 8409 27539 - and #3 8410 27539 - asl ; x2 because keypad variables are interleaved 8411 27539 - tax 8412 27539 - lda #0 8413 27539 - sta keypadmatrix0a,x 8414 27539 - lda INPT0 8415 27539 - cmp #$80 8416 27539 - rol keypadmatrix0a,x 8417 27539 - lda INPT1 8418 27539 - cmp #$80 8419 27539 - rol keypadmatrix0a,x 8420 27539 - lda INPT4 8421 27539 - cmp #$80 8422 27539 - rol keypadmatrix0a,x 8423 27539 - lda keypadmatrix0a,x 8424 27539 - eor #%00000111 8425 27539 - sta keypadmatrix0a,x 8426 27539 -skipkeypadcolumnread0 8427 27539 - 8428 27539 - lda port1control 8429 27539 - cmp #7 8430 27539 - bne skipkeypadcolumnread1 8431 27539 - lda framecounter 8432 27539 - and #3 8433 27539 - asl ; x2 because keypad variables are interleaved 8434 27539 - tax 8435 27539 - lda #0 8436 27539 - sta keypadmatrix1a,x 8437 27539 - rol keypadmatrix1a,x 8438 27539 - lda INPT2 8439 27539 - cmp #$80 8440 27539 - rol keypadmatrix1a,x 8441 27539 - lda INPT3 8442 27539 - cmp #$80 8443 27539 - rol keypadmatrix1a,x 8444 27539 - lda INPT5 8445 27539 - cmp #$80 8446 27539 - rol keypadmatrix1a,x 8447 27539 - lda keypadmatrix1a,x 8448 27539 - eor #%00000111 8449 27539 - sta keypadmatrix1a,x 8450 27539 -skipkeypadcolumnread1 8451 27539 - rts 8452 27539 endif ; KEYPADSUPPORT 8453 27539 8454 27539 setportforinput 8455 27539 a5 e4 lda CTLSWAs 8456 2753b 3d 44 f5 and allpinsinputlut,x 8457 2753e 85 e4 sta CTLSWAs 8458 27540 8d 81 02 sta CTLSWA 8459 27543 60 rts 8460 27544 8461 27544 allpinsinputlut 8462 27544 0f f0 .byte.b $0F, $F0 8463 27546 8464 27546 setonebuttonmode 8465 27546 a9 06 lda #6 ; in case we're in unlocked-bios mode 8466 27548 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8467 2754a a9 14 lda #$14 8468 2754c 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8469 2754f a5 e5 lda CTLSWBs 8470 27551 1d 5a f5 ora thisjoy2buttonbit,x 8471 27554 85 e5 sta CTLSWBs 8472 27556 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 8473 27559 60 rts 8474 2755a 8475 2755a thisjoy2buttonbit 8476 2755a 04 10 .byte.b $04, $10 8477 2755c 8478 2755c settwobuttonmode 8479 2755c a9 06 lda #6 ; in case we're in unlocked-bios mode 8480 2755e 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8481 27560 a9 14 lda #$14 8482 27562 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8483 27565 a5 e5 lda CTLSWBs 8484 27567 3d 70 f5 and thisjoy2buttonmask,x 8485 2756a 85 e5 sta CTLSWBs 8486 2756c 8d 82 02 sta SWCHB 8487 2756f 60 rts 8488 27570 8489 27570 thisjoy2buttonmask 8490 27570 fb ef .byte.b $fb, $ef 8491 27572 8492 27572 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8493 27572 8494 27572 START 8495 27572 start 8496 27572 8497 27572 ;******** more or less the Atari recommended startup procedure 8498 27572 8499 27572 78 sei 8500 27573 d8 cld 8501 27574 8502 27574 ifnconst NOTIALOCK 8503 27574 a9 07 lda #$07 8504 27576 - else 8505 27576 - lda #$06 8506 27576 endif 8507 27576 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 8508 27578 a9 7f lda #$7F 8509 2757a 85 3c sta CTRL ;disable DMA 8510 2757c a9 00 lda #$00 8511 2757e 85 38 sta OFFSET 8512 27580 ifnconst NOTIALOCK 8513 27580 85 01 sta INPTCTRL 8514 27582 85 20 sta BACKGRND ; black default, in case a flash cart is using something else 8515 27584 endif 8516 27584 a2 ff ldx #$FF 8517 27586 9a txs 8518 27587 8519 27587 ;************** Clear Memory 8520 27587 8521 27587 a2 40 ldx #$40 8522 27589 a9 00 lda #$00 8523 2758b crloop1 8524 2758b 95 00 sta $00,x ;Clear zero page 8525 2758d 9d 00 01 sta $100,x ;Clear page 1 8526 27590 e8 inx 8527 27591 d0 f8 bne crloop1 8528 27593 8529 27593 8530 27593 a0 00 ldy #$00 ;Clear Ram 8531 27595 a9 18 lda #$18 ;Start at $1800 8532 27597 85 81 sta $81 8533 27599 a9 00 lda #$00 8534 2759b 85 80 sta $80 8535 2759d crloop3 8536 2759d a9 00 lda #$00 8537 2759f 91 80 sta ($80),y ;Store data 8538 275a1 c8 iny ;Next byte 8539 275a2 d0 f9 bne crloop3 ;Branch if not done page 8540 275a4 e6 81 inc $81 ;Next page 8541 275a6 a5 81 lda $81 8542 275a8 c9 20 cmp #$20 ;End at $1FFF 8543 275aa d0 f1 bne crloop3 ;Branch if not 8544 275ac 8545 275ac a0 00 ldy #$00 ;Clear Ram 8546 275ae a9 22 lda #$22 ;Start at $2200 8547 275b0 85 81 sta $81 8548 275b2 a9 00 lda #$00 8549 275b4 85 80 sta $80 8550 275b6 crloop4 8551 275b6 a9 00 lda #$00 8552 275b8 91 80 sta ($80),y ;Store data 8553 275ba c8 iny ;Next byte 8554 275bb d0 f9 bne crloop4 ;Branch if not done page 8555 275bd e6 81 inc $81 ;Next page 8556 275bf a5 81 lda $81 8557 275c1 c9 27 cmp #$27 ;End at $27FF 8558 275c3 d0 f1 bne crloop4 ;Branch if not 8559 275c5 8560 275c5 a2 00 ldx #$00 8561 275c7 a9 00 lda #$00 8562 275c9 crloop5 ;Clear 2100-213F, 2000-203F 8563 275c9 9d 00 20 sta $2000,x 8564 275cc 9d 00 21 sta $2100,x 8565 275cf e8 inx 8566 275d0 e0 40 cpx #$40 8567 275d2 d0 f5 bne crloop5 8568 275d4 8569 275d4 85 80 sta $80 8570 275d6 85 81 sta $81 8571 275d8 85 82 sta $82 8572 275da 85 83 sta $83 8573 275dc 8574 275dc ;seed random number with hopefully-random timer value 8575 275dc a9 01 lda #1 8576 275de 0d 84 02 ora INTIM 8577 275e1 85 40 sta rand 8578 275e3 8579 275e3 ; detect the console type... 8580 275e3 pndetectvblankstart 8581 275e3 a5 28 lda MSTAT 8582 275e5 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 8583 275e7 pndetectvblankover 8584 275e7 a5 28 lda MSTAT 8585 275e9 30 fc bmi pndetectvblankover ; then wait for it to be over 8586 275eb a0 00 ldy #$00 8587 275ed a2 00 ldx #$00 8588 275ef pndetectvblankhappening 8589 275ef a5 28 lda MSTAT 8590 275f1 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 8591 275f3 85 24 sta WSYNC 8592 275f5 85 24 sta WSYNC 8593 275f7 e8 inx 8594 275f8 d0 f5 bne pndetectvblankhappening 8595 275fa pndetectinvblank 8596 275fa e0 7d cpx #125 8597 275fc 90 02 bcc pndetecispal 8598 275fe a0 01 ldy #$01 8599 27600 pndetecispal 8600 27600 8c 09 21 sty paldetected 8601 27603 8602 27603 20 9f f4 jsr createallgamedlls 8603 27606 8604 27606 a9 18 lda #>DLLMEM 8605 27608 85 2c sta DPPH 8606 2760a a9 00 lda # 255 8801 27663 -DOUBLEBUFFEROFFSET = 255 8802 27663 else 8803 27663 00 4d DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 8804 27663 endif 8805 27663 8806 27663 - ifconst EXTRADLMEMORY 8807 27663 -SECONDDLHALFSTART SET $2300 8808 27663 endif 8809 27663 8810 27663 DLPOINTH 8811 27663 DLINDEX SET 0 8812 27663 REPEAT WZONECOUNT 8813 27663 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27663 - ifconst EXTRADLMEMORY 8815 27663 - if TMPMEMADDRESS > $1FFF 8816 27663 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27663 - else 8818 27663 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27663 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27663 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27663 - endif 8822 27663 - endif ; TMPMEMADDRESS > $1FFF 8823 27663 endif ; EXTRADLMEMORY 8824 27663 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27663 18 .byte.b >TMPMEMADDRESS 8826 27663 DLINDEX SET DLINDEX + 1 8812 27663 REPEND 8813 27663 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27664 - ifconst EXTRADLMEMORY 8815 27664 - if TMPMEMADDRESS > $1FFF 8816 27664 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27664 - else 8818 27664 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27664 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27664 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27664 - endif 8822 27664 - endif ; TMPMEMADDRESS > $1FFF 8823 27664 endif ; EXTRADLMEMORY 8824 27664 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27664 18 .byte.b >TMPMEMADDRESS 8826 27664 DLINDEX SET DLINDEX + 1 8812 27664 REPEND 8813 27664 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27665 - ifconst EXTRADLMEMORY 8815 27665 - if TMPMEMADDRESS > $1FFF 8816 27665 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27665 - else 8818 27665 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27665 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27665 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27665 - endif 8822 27665 - endif ; TMPMEMADDRESS > $1FFF 8823 27665 endif ; EXTRADLMEMORY 8824 27665 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27665 19 .byte.b >TMPMEMADDRESS 8826 27665 DLINDEX SET DLINDEX + 1 8812 27665 REPEND 8813 27665 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27666 - ifconst EXTRADLMEMORY 8815 27666 - if TMPMEMADDRESS > $1FFF 8816 27666 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27666 - else 8818 27666 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27666 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27666 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27666 - endif 8822 27666 - endif ; TMPMEMADDRESS > $1FFF 8823 27666 endif ; EXTRADLMEMORY 8824 27666 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27666 19 .byte.b >TMPMEMADDRESS 8826 27666 DLINDEX SET DLINDEX + 1 8812 27666 REPEND 8813 27666 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27667 - ifconst EXTRADLMEMORY 8815 27667 - if TMPMEMADDRESS > $1FFF 8816 27667 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27667 - else 8818 27667 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27667 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27667 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27667 - endif 8822 27667 - endif ; TMPMEMADDRESS > $1FFF 8823 27667 endif ; EXTRADLMEMORY 8824 27667 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27667 19 .byte.b >TMPMEMADDRESS 8826 27667 DLINDEX SET DLINDEX + 1 8812 27667 REPEND 8813 27667 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27668 - ifconst EXTRADLMEMORY 8815 27668 - if TMPMEMADDRESS > $1FFF 8816 27668 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27668 - else 8818 27668 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27668 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27668 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27668 - endif 8822 27668 - endif ; TMPMEMADDRESS > $1FFF 8823 27668 endif ; EXTRADLMEMORY 8824 27668 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27668 1a .byte.b >TMPMEMADDRESS 8826 27668 DLINDEX SET DLINDEX + 1 8812 27668 REPEND 8813 27668 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27669 - ifconst EXTRADLMEMORY 8815 27669 - if TMPMEMADDRESS > $1FFF 8816 27669 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27669 - else 8818 27669 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27669 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27669 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27669 - endif 8822 27669 - endif ; TMPMEMADDRESS > $1FFF 8823 27669 endif ; EXTRADLMEMORY 8824 27669 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27669 1a .byte.b >TMPMEMADDRESS 8826 27669 DLINDEX SET DLINDEX + 1 8812 27669 REPEND 8813 27669 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 2766a - ifconst EXTRADLMEMORY 8815 2766a - if TMPMEMADDRESS > $1FFF 8816 2766a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 2766a - else 8818 2766a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 2766a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 2766a -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 2766a - endif 8822 2766a - endif ; TMPMEMADDRESS > $1FFF 8823 2766a endif ; EXTRADLMEMORY 8824 2766a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 2766a 1a .byte.b >TMPMEMADDRESS 8826 2766a DLINDEX SET DLINDEX + 1 8812 2766a REPEND 8813 2766a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 2766b - ifconst EXTRADLMEMORY 8815 2766b - if TMPMEMADDRESS > $1FFF 8816 2766b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 2766b - else 8818 2766b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 2766b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 2766b -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 2766b - endif 8822 2766b - endif ; TMPMEMADDRESS > $1FFF 8823 2766b endif ; EXTRADLMEMORY 8824 2766b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 2766b 1b .byte.b >TMPMEMADDRESS 8826 2766b DLINDEX SET DLINDEX + 1 8812 2766b REPEND 8813 2766b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 2766c - ifconst EXTRADLMEMORY 8815 2766c - if TMPMEMADDRESS > $1FFF 8816 2766c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 2766c - else 8818 2766c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 2766c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 2766c -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 2766c - endif 8822 2766c - endif ; TMPMEMADDRESS > $1FFF 8823 2766c endif ; EXTRADLMEMORY 8824 2766c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 2766c 1b .byte.b >TMPMEMADDRESS 8826 2766c DLINDEX SET DLINDEX + 1 8812 2766c REPEND 8813 2766c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 2766d - ifconst EXTRADLMEMORY 8815 2766d - if TMPMEMADDRESS > $1FFF 8816 2766d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 2766d - else 8818 2766d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 2766d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 2766d -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 2766d - endif 8822 2766d - endif ; TMPMEMADDRESS > $1FFF 8823 2766d endif ; EXTRADLMEMORY 8824 2766d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 2766d 1b .byte.b >TMPMEMADDRESS 8826 2766d DLINDEX SET DLINDEX + 1 8812 2766d REPEND 8813 2766d TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 2766e - ifconst EXTRADLMEMORY 8815 2766e - if TMPMEMADDRESS > $1FFF 8816 2766e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 2766e - else 8818 2766e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 2766e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 2766e -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 2766e - endif 8822 2766e - endif ; TMPMEMADDRESS > $1FFF 8823 2766e endif ; EXTRADLMEMORY 8824 2766e ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 2766e 1b .byte.b >TMPMEMADDRESS 8826 2766e DLINDEX SET DLINDEX + 1 8812 2766e REPEND 8813 2766e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 2766f - ifconst EXTRADLMEMORY 8815 2766f - if TMPMEMADDRESS > $1FFF 8816 2766f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 2766f - else 8818 2766f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 2766f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 2766f -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 2766f - endif 8822 2766f - endif ; TMPMEMADDRESS > $1FFF 8823 2766f endif ; EXTRADLMEMORY 8824 2766f ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 2766f 1c .byte.b >TMPMEMADDRESS 8826 2766f DLINDEX SET DLINDEX + 1 8812 2766f REPEND 8813 2766f TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27670 - ifconst EXTRADLMEMORY 8815 27670 - if TMPMEMADDRESS > $1FFF 8816 27670 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27670 - else 8818 27670 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27670 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27670 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27670 - endif 8822 27670 - endif ; TMPMEMADDRESS > $1FFF 8823 27670 endif ; EXTRADLMEMORY 8824 27670 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27670 1c .byte.b >TMPMEMADDRESS 8826 27670 DLINDEX SET DLINDEX + 1 8812 27670 REPEND 8813 27670 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27671 - ifconst EXTRADLMEMORY 8815 27671 - if TMPMEMADDRESS > $1FFF 8816 27671 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27671 - else 8818 27671 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27671 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27671 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27671 - endif 8822 27671 - endif ; TMPMEMADDRESS > $1FFF 8823 27671 endif ; EXTRADLMEMORY 8824 27671 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27671 1c .byte.b >TMPMEMADDRESS 8826 27671 DLINDEX SET DLINDEX + 1 8812 27671 REPEND 8813 27671 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27672 - ifconst EXTRADLMEMORY 8815 27672 - if TMPMEMADDRESS > $1FFF 8816 27672 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27672 - else 8818 27672 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27672 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27672 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27672 - endif 8822 27672 - endif ; TMPMEMADDRESS > $1FFF 8823 27672 endif ; EXTRADLMEMORY 8824 27672 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27672 1d .byte.b >TMPMEMADDRESS 8826 27672 DLINDEX SET DLINDEX + 1 8812 27672 REPEND 8813 27672 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27673 - ifconst EXTRADLMEMORY 8815 27673 - if TMPMEMADDRESS > $1FFF 8816 27673 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27673 - else 8818 27673 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27673 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27673 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27673 - endif 8822 27673 - endif ; TMPMEMADDRESS > $1FFF 8823 27673 endif ; EXTRADLMEMORY 8824 27673 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27673 1d .byte.b >TMPMEMADDRESS 8826 27673 DLINDEX SET DLINDEX + 1 8812 27673 REPEND 8813 27673 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27674 - ifconst EXTRADLMEMORY 8815 27674 - if TMPMEMADDRESS > $1FFF 8816 27674 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27674 - else 8818 27674 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27674 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27674 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27674 - endif 8822 27674 - endif ; TMPMEMADDRESS > $1FFF 8823 27674 endif ; EXTRADLMEMORY 8824 27674 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27674 1d .byte.b >TMPMEMADDRESS 8826 27674 DLINDEX SET DLINDEX + 1 8812 27674 REPEND 8813 27674 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27675 - ifconst EXTRADLMEMORY 8815 27675 - if TMPMEMADDRESS > $1FFF 8816 27675 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27675 - else 8818 27675 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27675 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27675 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27675 - endif 8822 27675 - endif ; TMPMEMADDRESS > $1FFF 8823 27675 endif ; EXTRADLMEMORY 8824 27675 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27675 1e .byte.b >TMPMEMADDRESS 8826 27675 DLINDEX SET DLINDEX + 1 8812 27675 REPEND 8813 27675 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27676 - ifconst EXTRADLMEMORY 8815 27676 - if TMPMEMADDRESS > $1FFF 8816 27676 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27676 - else 8818 27676 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27676 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27676 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27676 - endif 8822 27676 - endif ; TMPMEMADDRESS > $1FFF 8823 27676 endif ; EXTRADLMEMORY 8824 27676 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27676 1e .byte.b >TMPMEMADDRESS 8826 27676 DLINDEX SET DLINDEX + 1 8812 27676 REPEND 8813 27676 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27677 - ifconst EXTRADLMEMORY 8815 27677 - if TMPMEMADDRESS > $1FFF 8816 27677 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27677 - else 8818 27677 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27677 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27677 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27677 - endif 8822 27677 - endif ; TMPMEMADDRESS > $1FFF 8823 27677 endif ; EXTRADLMEMORY 8824 27677 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27677 1e .byte.b >TMPMEMADDRESS 8826 27677 DLINDEX SET DLINDEX + 1 8812 27677 REPEND 8813 27677 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27678 - ifconst EXTRADLMEMORY 8815 27678 - if TMPMEMADDRESS > $1FFF 8816 27678 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27678 - else 8818 27678 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27678 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27678 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27678 - endif 8822 27678 - endif ; TMPMEMADDRESS > $1FFF 8823 27678 endif ; EXTRADLMEMORY 8824 27678 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27678 1f .byte.b >TMPMEMADDRESS 8826 27678 DLINDEX SET DLINDEX + 1 8812 27678 REPEND 8813 27678 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 27679 - ifconst EXTRADLMEMORY 8815 27679 - if TMPMEMADDRESS > $1FFF 8816 27679 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 27679 - else 8818 27679 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 27679 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 27679 -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 27679 - endif 8822 27679 - endif ; TMPMEMADDRESS > $1FFF 8823 27679 endif ; EXTRADLMEMORY 8824 27679 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 27679 1f .byte.b >TMPMEMADDRESS 8826 27679 DLINDEX SET DLINDEX + 1 8812 27679 REPEND 8813 27679 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8814 2767a - ifconst EXTRADLMEMORY 8815 2767a - if TMPMEMADDRESS > $1FFF 8816 2767a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8817 2767a - else 8818 2767a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8819 2767a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8820 2767a -SECONDDLHALFSTART SET TMPMEMADDRESS 8821 2767a - endif 8822 2767a - endif ; TMPMEMADDRESS > $1FFF 8823 2767a endif ; EXTRADLMEMORY 8824 2767a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8825 2767a 1f .byte.b >TMPMEMADDRESS 8826 2767a DLINDEX SET DLINDEX + 1 8827 2767b REPEND 8828 2767b 8829 2767b - ifconst EXTRADLMEMORY 8830 2767b - echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 8831 2767b endif 8832 2767b 8833 2767b 8834 2767b DLPOINTL 8835 2767b DLINDEX SET 0 8836 2767b REPEAT WZONECOUNT 8837 2767b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8838 2767b - ifconst EXTRADLMEMORY 8839 2767b - if TMPMEMADDRESS > $1FFF 8840 2767b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 2767b - else 8842 2767b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 2767b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 2767b - endif 8845 2767b - endif ; TMPMEMADDRESS > $1FFF 8846 2767b endif ; EXTRADLMEMORY 8847 2767b 80 .byte.b $1FFF 8840 2767c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 2767c - else 8842 2767c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 2767c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 2767c - endif 8845 2767c - endif ; TMPMEMADDRESS > $1FFF 8846 2767c endif ; EXTRADLMEMORY 8847 2767c d0 .byte.b $1FFF 8840 2767d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 2767d - else 8842 2767d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 2767d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 2767d - endif 8845 2767d - endif ; TMPMEMADDRESS > $1FFF 8846 2767d endif ; EXTRADLMEMORY 8847 2767d 20 .byte.b $1FFF 8840 2767e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 2767e - else 8842 2767e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 2767e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 2767e - endif 8845 2767e - endif ; TMPMEMADDRESS > $1FFF 8846 2767e endif ; EXTRADLMEMORY 8847 2767e 70 .byte.b $1FFF 8840 2767f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 2767f - else 8842 2767f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 2767f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 2767f - endif 8845 2767f - endif ; TMPMEMADDRESS > $1FFF 8846 2767f endif ; EXTRADLMEMORY 8847 2767f c0 .byte.b $1FFF 8840 27680 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27680 - else 8842 27680 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27680 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27680 - endif 8845 27680 - endif ; TMPMEMADDRESS > $1FFF 8846 27680 endif ; EXTRADLMEMORY 8847 27680 10 .byte.b $1FFF 8840 27681 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27681 - else 8842 27681 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27681 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27681 - endif 8845 27681 - endif ; TMPMEMADDRESS > $1FFF 8846 27681 endif ; EXTRADLMEMORY 8847 27681 60 .byte.b $1FFF 8840 27682 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27682 - else 8842 27682 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27682 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27682 - endif 8845 27682 - endif ; TMPMEMADDRESS > $1FFF 8846 27682 endif ; EXTRADLMEMORY 8847 27682 b0 .byte.b $1FFF 8840 27683 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27683 - else 8842 27683 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27683 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27683 - endif 8845 27683 - endif ; TMPMEMADDRESS > $1FFF 8846 27683 endif ; EXTRADLMEMORY 8847 27683 00 .byte.b $1FFF 8840 27684 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27684 - else 8842 27684 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27684 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27684 - endif 8845 27684 - endif ; TMPMEMADDRESS > $1FFF 8846 27684 endif ; EXTRADLMEMORY 8847 27684 50 .byte.b $1FFF 8840 27685 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27685 - else 8842 27685 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27685 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27685 - endif 8845 27685 - endif ; TMPMEMADDRESS > $1FFF 8846 27685 endif ; EXTRADLMEMORY 8847 27685 a0 .byte.b $1FFF 8840 27686 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27686 - else 8842 27686 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27686 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27686 - endif 8845 27686 - endif ; TMPMEMADDRESS > $1FFF 8846 27686 endif ; EXTRADLMEMORY 8847 27686 f0 .byte.b $1FFF 8840 27687 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27687 - else 8842 27687 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27687 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27687 - endif 8845 27687 - endif ; TMPMEMADDRESS > $1FFF 8846 27687 endif ; EXTRADLMEMORY 8847 27687 40 .byte.b $1FFF 8840 27688 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27688 - else 8842 27688 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27688 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27688 - endif 8845 27688 - endif ; TMPMEMADDRESS > $1FFF 8846 27688 endif ; EXTRADLMEMORY 8847 27688 90 .byte.b $1FFF 8840 27689 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27689 - else 8842 27689 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27689 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27689 - endif 8845 27689 - endif ; TMPMEMADDRESS > $1FFF 8846 27689 endif ; EXTRADLMEMORY 8847 27689 e0 .byte.b $1FFF 8840 2768a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 2768a - else 8842 2768a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 2768a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 2768a - endif 8845 2768a - endif ; TMPMEMADDRESS > $1FFF 8846 2768a endif ; EXTRADLMEMORY 8847 2768a 30 .byte.b $1FFF 8840 2768b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 2768b - else 8842 2768b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 2768b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 2768b - endif 8845 2768b - endif ; TMPMEMADDRESS > $1FFF 8846 2768b endif ; EXTRADLMEMORY 8847 2768b 80 .byte.b $1FFF 8840 2768c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 2768c - else 8842 2768c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 2768c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 2768c - endif 8845 2768c - endif ; TMPMEMADDRESS > $1FFF 8846 2768c endif ; EXTRADLMEMORY 8847 2768c d0 .byte.b $1FFF 8840 2768d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 2768d - else 8842 2768d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 2768d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 2768d - endif 8845 2768d - endif ; TMPMEMADDRESS > $1FFF 8846 2768d endif ; EXTRADLMEMORY 8847 2768d 20 .byte.b $1FFF 8840 2768e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 2768e - else 8842 2768e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 2768e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 2768e - endif 8845 2768e - endif ; TMPMEMADDRESS > $1FFF 8846 2768e endif ; EXTRADLMEMORY 8847 2768e 70 .byte.b $1FFF 8840 2768f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 2768f - else 8842 2768f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 2768f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 2768f - endif 8845 2768f - endif ; TMPMEMADDRESS > $1FFF 8846 2768f endif ; EXTRADLMEMORY 8847 2768f c0 .byte.b $1FFF 8840 27690 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27690 - else 8842 27690 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27690 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27690 - endif 8845 27690 - endif ; TMPMEMADDRESS > $1FFF 8846 27690 endif ; EXTRADLMEMORY 8847 27690 10 .byte.b $1FFF 8840 27691 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27691 - else 8842 27691 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27691 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27691 - endif 8845 27691 - endif ; TMPMEMADDRESS > $1FFF 8846 27691 endif ; EXTRADLMEMORY 8847 27691 60 .byte.b $1FFF 8840 27692 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8841 27692 - else 8842 27692 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8843 27692 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8844 27692 - endif 8845 27692 - endif ; TMPMEMADDRESS > $1FFF 8846 27692 endif ; EXTRADLMEMORY 8847 27692 b0 .byte.b $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 18 80 ZONE0ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 18 d0 ZONE1ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 19 20 ZONE2ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 19 70 ZONE3ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 19 c0 ZONE4ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1a 10 ZONE5ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1a 60 ZONE6ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1a b0 ZONE7ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1b 00 ZONE8ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1b 50 ZONE9ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1b a0 ZONE10ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1b f0 ZONE11ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1c 40 ZONE12ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1c 90 ZONE13ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1c e0 ZONE14ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1d 30 ZONE15ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1d 80 ZONE16ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1d d0 ZONE17ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1e 20 ZONE18ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1e 70 ZONE19ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1e c0 ZONE20ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1f 10 ZONE21ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1f 60 ZONE22ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8853 27693 REPEND 8854 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8855 27693 - ifconst EXTRADLMEMORY 8856 27693 - if TMPMEMADDRESS > $1FFF 8857 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8858 27693 - else 8859 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8860 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8861 27693 - endif 8862 27693 - endif ; TMPMEMADDRESS > $1FFF 8863 27693 endif ; EXTRADLMEMORY 8864 27693 8865 27693 1f b0 ZONE23ADDRESS = TMPMEMADDRESS 8866 27693 8867 27693 DLINDEX SET DLINDEX + 1 8868 27693 REPEND 8869 27693 8870 27693 $1880 to $1fff used as zone memory, allowing 15 display objects per zone. 8871 27693 echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 8872 27693 8873 27693 DLHEIGHT 8874 27693 REPEAT WZONECOUNT 8875 27693 07 .byte.b (WZONEHEIGHT-1) 8874 27693 REPEND 8875 27694 07 .byte.b (WZONEHEIGHT-1) 8874 27694 REPEND 8875 27695 07 .byte.b (WZONEHEIGHT-1) 8874 27695 REPEND 8875 27696 07 .byte.b (WZONEHEIGHT-1) 8874 27696 REPEND 8875 27697 07 .byte.b (WZONEHEIGHT-1) 8874 27697 REPEND 8875 27698 07 .byte.b (WZONEHEIGHT-1) 8874 27698 REPEND 8875 27699 07 .byte.b (WZONEHEIGHT-1) 8874 27699 REPEND 8875 2769a 07 .byte.b (WZONEHEIGHT-1) 8874 2769a REPEND 8875 2769b 07 .byte.b (WZONEHEIGHT-1) 8874 2769b REPEND 8875 2769c 07 .byte.b (WZONEHEIGHT-1) 8874 2769c REPEND 8875 2769d 07 .byte.b (WZONEHEIGHT-1) 8874 2769d REPEND 8875 2769e 07 .byte.b (WZONEHEIGHT-1) 8874 2769e REPEND 8875 2769f 07 .byte.b (WZONEHEIGHT-1) 8874 2769f REPEND 8875 276a0 07 .byte.b (WZONEHEIGHT-1) 8874 276a0 REPEND 8875 276a1 07 .byte.b (WZONEHEIGHT-1) 8874 276a1 REPEND 8875 276a2 07 .byte.b (WZONEHEIGHT-1) 8874 276a2 REPEND 8875 276a3 07 .byte.b (WZONEHEIGHT-1) 8874 276a3 REPEND 8875 276a4 07 .byte.b (WZONEHEIGHT-1) 8874 276a4 REPEND 8875 276a5 07 .byte.b (WZONEHEIGHT-1) 8874 276a5 REPEND 8875 276a6 07 .byte.b (WZONEHEIGHT-1) 8874 276a6 REPEND 8875 276a7 07 .byte.b (WZONEHEIGHT-1) 8874 276a7 REPEND 8875 276a8 07 .byte.b (WZONEHEIGHT-1) 8874 276a8 REPEND 8875 276a9 07 .byte.b (WZONEHEIGHT-1) 8874 276a9 REPEND 8875 276aa 07 .byte.b (WZONEHEIGHT-1) 8876 276ab REPEND 8877 276ab 8878 276ab ; Provided under the CC0 license. See the included LICENSE.txt for details. 8879 276ab 8880 276ab ; a simple guard, than ensures the 7800basic code hasn't 8881 276ab ; spilled into the encryption area... 2259 bytes left in the 7800basic reserved area. 8882 276ab echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 8883 276ab - if (*>$FF7D) 8884 276ab - ERR ; abort the assembly 8885 276ab endif 8886 276ab ; Provided under the CC0 license. See the included LICENSE.txt for details. 8887 276ab 8888 276ab - ifconst DEV 8889 276ab - ifnconst ZONEHEIGHT 8890 276ab - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8891 276ab - else 8892 276ab - if ZONEHEIGHT = 8 8893 276ab - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8894 276ab - else 8895 276ab - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8896 276ab - endif 8897 276ab - endif 8898 276ab endif 8899 276ab 8900 276ab ; FF7E/FF7F contains the 7800basic crc checksum word 8901 276ab 8902 276ab ; FF80 - FFF7 contains the 7800 encryption key 8903 276ab 8904 276ab - ifnconst bankswitchmode 8905 276ab - ORG $FFF8 8906 276ab else 8907 276ab ifconst ROM128K 8908 27ff8 ORG $27FF8 8909 27ff8 RORG $FFF8 8910 27ff8 endif 8911 27ff8 - ifconst ROM144K 8912 27ff8 - ORG $27FF8 8913 27ff8 - RORG $FFF8 8914 27ff8 endif 8915 27ff8 - ifconst ROM256K 8916 27ff8 - ORG $47FF8 8917 27ff8 - RORG $FFF8 8918 27ff8 endif 8919 27ff8 - ifconst ROM272K 8920 27ff8 - ORG $47FF8 8921 27ff8 - RORG $FFF8 8922 27ff8 endif 8923 27ff8 - ifconst ROM512K 8924 27ff8 - ORG $87FF8 8925 27ff8 - RORG $FFF8 8926 27ff8 endif 8927 27ff8 - ifconst ROM528K 8928 27ff8 - ORG $87FF8 8929 27ff8 - RORG $FFF8 8930 27ff8 endif 8931 27ff8 endif 8932 27ff8 8933 27ff8 8934 27ff8 ff .byte.b $FF ; region verification. $FF=all regions 8935 27ff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 8936 27ffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 8937 27ffa 8938 27ffa ;Vectors 8939 27ffa 00 f0 .word.w NMI 8940 27ffc 72 f5 .word.w START 8941 27ffe 5f f0 .word.w IRQ 8942 28000