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