------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Menu_Demo_v2.78b.asm LEVEL 1 PASS 3 1 28000 ???? ; MACRO.H 2 28000 ???? 3 28000 ???? ; Based on the 2600 macro.h file. 4 28000 ???? ; Macros irrelevant to the 7800 have been removed, and the sleep macro 5 28000 ???? ; has been adapted to give accurate results on the 7800. 6 28000 ???? 7 28000 ???? ; Version 1.0 2019/12/11 (based on the 2600 Version 1.05, 13/NOVEMBER/2003) 8 28000 ???? 9 28000 ???? ; Available macros... 10 28000 ???? ; SLEEP n - sleep for n cycles 11 28000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable 12 28000 ???? 13 28000 ???? ;------------------------------------------------------------------------------- 14 28000 ???? ; SLEEP duration 15 28000 ???? ; Original author: Thomas Jentzsch 16 28000 ???? ; Inserts code which takes the specified number of cycles to execute. This is 17 28000 ???? ; useful for code where precise timing is required. 18 28000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS. 19 28000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS 20 28000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards). 21 28000 ???? 22 28000 ???? MAC sleep 23 28000 ???? .CYCLES SET {1} 24 28000 ???? 25 28000 ???? IF .CYCLES < 2 26 28000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 27 28000 ???? ERR 28 28000 ???? ENDIF 29 28000 ???? 30 28000 ???? IF .CYCLES & 1 31 28000 ???? IFNCONST NO_ILLEGAL_OPCODES 32 28000 ???? nop $80 33 28000 ???? ELSE 34 28000 ???? bit $80 35 28000 ???? ENDIF 36 28000 ???? .CYCLES SET .CYCLES - 3 37 28000 ???? ENDIF 38 28000 ???? 39 28000 ???? REPEAT .CYCLES / 2 40 28000 ???? nop 41 28000 ???? REPEND 42 28000 ???? ENDM ;usage: SLEEP n (n>1) 43 28000 ???? 44 28000 ???? 45 28000 ???? ;------------------------------------------------------------------------------- 46 28000 ???? ; FRACSLEEP duration 47 28000 ???? ; Based on Thomas Jentzsch's SLEEP macro, but takes cycles*2 to allow for 48 28000 ???? ; 7800 based 0.5 cycle sleep. 49 28000 ???? 50 28000 ???? MAC fracsleep 51 28000 ???? .CYCLES SET {1} 52 28000 ???? 53 28000 ???? IF .CYCLES < 4 54 28000 ???? ECHO "MACRO ERROR: 'FRACSLEEP': Duration must be > 4" 55 28000 ???? ERR 56 28000 ???? ENDIF 57 28000 ???? IF .CYCLES = 5 58 28000 ???? ECHO "MACRO ERROR: 'FRACSLEEP': Duration = 5 is impossible" 59 28000 ???? ERR 60 28000 ???? ENDIF 61 28000 ???? 62 28000 ???? IF .CYCLES & 1 63 28000 ???? IFNCONST NO_ILLEGAL_OPCODES 64 28000 ???? nop $0 ; TIA access is 3.5 cycles 65 28000 ???? ELSE 66 28000 ???? bit $0 ; TIA access is 3.5 cycles 67 28000 ???? ENDIF 68 28000 ???? .CYCLES SET .CYCLES - 7 69 28000 ???? ENDIF 70 28000 ???? 71 28000 ???? IF .CYCLES & 2 72 28000 ???? IFNCONST NO_ILLEGAL_OPCODES 73 28000 ???? nop $80 74 28000 ???? ELSE 75 28000 ???? bit $80 76 28000 ???? ENDIF 77 28000 ???? .CYCLES SET .CYCLES - 6 78 28000 ???? ENDIF 79 28000 ???? 80 28000 ???? REPEAT .CYCLES / 4 81 28000 ???? nop 82 28000 ???? REPEND 83 28000 ???? ENDM ;usage: FRACSLEEP n (n>1) 84 28000 ???? 85 28000 ???? 86 28000 ???? ;------------------------------------------------------- 87 28000 ???? ; SET_POINTER 88 28000 ???? ; Original author: Manuel Rotschkar 89 28000 ???? ; 90 28000 ???? ; Sets a 2 byte RAM pointer to an absolute address. 91 28000 ???? ; 92 28000 ???? ; Usage: SET_POINTER pointer, address 93 28000 ???? ; Example: SET_POINTER SpritePTR, SpriteData 94 28000 ???? ; 95 28000 ???? ; Note: Alters the accumulator, NZ flags 96 28000 ???? ; IN 1: 2 byte RAM location reserved for pointer 97 28000 ???? ; IN 2: absolute address 98 28000 ???? 99 28000 ???? MAC set_pointer 100 28000 ???? .POINTER SET {1} 101 28000 ???? .ADDRESS SET {2} 102 28000 ???? 103 28000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address 104 28000 ???? STA .POINTER ; Store in pointer 105 28000 ???? LDA #>.ADDRESS ; Get Hibyte of Address 106 28000 ???? STA .POINTER+1 ; Store in pointer+1 107 28000 ???? 108 28000 ???? ENDM 109 28000 ???? 110 28000 ???? ; EOF 111 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 112 28000 ???? 113 28000 ???? ; 7800MACRO.H 114 28000 ???? 115 28000 ???? ;------------------------------------------------------- 116 28000 ???? ; BOXCOLLISIONCHECK 117 28000 ???? ; author: Mike Saarna 118 28000 ???? ; 119 28000 ???? ; A general bounding box collision check. compares 2 rectangles of differing size 120 28000 ???? ; and shape for overlap. Carry is set for collision detected, clear for none. 121 28000 ???? ; 122 28000 ???? ; Usage: BOXCOLLISIONCHECK x1var,y1var,w1var,h1var,x2var,y2var,w2var,h2var 123 28000 ???? ; 124 28000 ???? 125 28000 ???? MAC boxcollisioncheck 126 28000 ???? .boxx1 SET {1} 127 28000 ???? .boxy1 SET {2} 128 28000 ???? .boxw1 SET {3} 129 28000 ???? .boxh1 SET {4} 130 28000 ???? .boxx2 SET {5} 131 28000 ???? .boxy2 SET {6} 132 28000 ???? .boxw2 SET {7} 133 28000 ???? .boxh2 SET {8} 134 28000 ???? 135 28000 ???? .DoXCollisionCheck 136 28000 ???? lda .boxx1 ;3 137 28000 ???? cmp .boxx2 ;2 138 28000 ???? bcs .X1isbiggerthanX2 ;2/3 139 28000 ???? .X2isbiggerthanX1 140 28000 ???? adc #.boxw1 ;2 141 28000 ???? cmp .boxx2 ;3 142 28000 ???? bcs .DoYCollisionCheck ;3/2 143 28000 ???? bcc .noboxcollision ;3 144 28000 ???? .X1isbiggerthanX2 145 28000 ???? clc ;2 146 28000 ???? sbc #.boxw2 ;2 147 28000 ???? cmp .boxx2 ;3 148 28000 ???? bcs .noboxcollision ;3/2 149 28000 ???? .DoYCollisionCheck 150 28000 ???? lda .boxy1 ;3 151 28000 ???? cmp .boxy2 ;3 152 28000 ???? bcs .Y1isbiggerthanY2 ;3/2 153 28000 ???? .Y2isbiggerthanY1 154 28000 ???? adc #.boxh1 ;2 155 28000 ???? cmp .boxy2 ;3 156 28000 ???? jmp .checkdone ;6 157 28000 ???? .Y1isbiggerthanY2 158 28000 ???? clc ;2 159 28000 ???? sbc #.boxh2 ;2 160 28000 ???? cmp .boxy2 ;3 161 28000 ???? bcs .noboxcollision ;3/2 162 28000 ???? .boxcollision 163 28000 ???? sec ;2 164 28000 ???? .byte $24 ; hardcoded "BIT [clc opcode]", used to skip over the following clc 165 28000 ???? .noboxcollision 166 28000 ???? clc ;2 167 28000 ???? .checkdone 168 28000 ???? 169 28000 ???? ENDM 170 28000 ???? 171 28000 ???? ; QBOXCOLLISIONCHECK 172 28000 ???? ; author: unknown 173 28000 ???? ; 174 28000 ???? ; A general bounding box collision check. compares 2 rectangles of differing size 175 28000 ???? ; and shape for overlap. Carry is CLEAR for collision detected, SET for none. 176 28000 ???? ; 177 28000 ???? ; Usage: QBOXCOLLISIONCHECK x1var,y1var,w1var,h1var,x2var,y2var,w2var,h2var 178 28000 ???? ; 179 28000 ???? MAC qboxcollisioncheck 180 28000 ???? .boxx1 SET {1} 181 28000 ???? .boxy1 SET {2} 182 28000 ???? .boxw1 SET {3} 183 28000 ???? .boxh1 SET {4} 184 28000 ???? .boxx2 SET {5} 185 28000 ???? .boxy2 SET {6} 186 28000 ???? .boxw2 SET {7} 187 28000 ???? .boxh2 SET {8} 188 28000 ???? 189 28000 ???? lda .boxx2 190 28000 ???? clc 191 28000 ???? adc #.boxw2 192 28000 ???? sbc .boxx1 193 28000 ???? cmp #.boxw1+.boxw2-1 194 28000 ???? bcs .qboxcollisiondone 195 28000 ???? ;if we're here, carry is clear 196 28000 ???? lda .boxy2 197 28000 ???? adc #.boxh2 198 28000 ???? sbc .boxy1 199 28000 ???? cmp #.boxh1+.boxh2-1 200 28000 ???? .qboxcollisiondone 201 28000 ???? rol ; temp for testing - invert carry... 202 28000 ???? eor #1 203 28000 ???? ror 204 28000 ???? ENDM 205 28000 ???? 206 28000 ???? 207 28000 ???? MAC median3 208 28000 ???? 209 28000 ???? ; A median filter (for smoothing paddle jitter) 210 28000 ???? ; this macro takes the current paddle value, compares it to historic 211 28000 ???? ; values, and replaces the current paddle value with the median. 212 28000 ???? ; 213 28000 ???? ; called as: MEDIAN3 STORAGE CURRENT 214 28000 ???? ; where STORAGE points to 3 consecutive bytes of memory. The first 2 215 28000 ???? ; must be dedicated to this MEDIAN filter. The last 1 is a temp. 216 28000 ???? ; where CURRENT is memory holding the new value you wish to compare to 217 28000 ???? ; the previous values, and update with the median value. 218 28000 ???? ; 219 28000 ???? ; returns: CURRENT (modified to contain median value) 220 28000 ???? ; 221 28000 ???? ; author: Mike Saarna (aka RevEng) 222 28000 ???? 223 28000 ???? .MedianBytes SET {1} 224 28000 ???? .NewValue SET {2} 225 28000 ???? 226 28000 ???? lda #0 227 28000 ???? ldy .NewValue 228 28000 ???? sty .MedianBytes+2 ; put the new value in the most "recent" slot 229 28000 ???? 230 28000 ???? ; build an index from relative size comparisons between our 3 values. 231 28000 ???? cpy .MedianBytes 232 28000 ???? rol 233 28000 ???? cpy .MedianBytes+1 234 28000 ???? rol 235 28000 ???? ldy .MedianBytes 236 28000 ???? cpy .MedianBytes+1 237 28000 ???? rol 238 28000 ???? tay 239 28000 ???? 240 28000 ???? ldx MedianOrderLUT,y ; convert the size-comparison index to an index to the median value 241 28000 ???? lda .MedianBytes,x 242 28000 ???? sta .NewValue ; we replace the new value memory with the median value 243 28000 ???? 244 28000 ???? ; then shift values from "newer" bytes to "older" bytes, leaving the 245 28000 ???? ; newest byte (.MedianBytes+2) empty for next time. 246 28000 ???? lda .MedianBytes+1 247 28000 ???? sta .MedianBytes 248 28000 ???? lda .MedianBytes+2 249 28000 ???? sta .MedianBytes+1 250 28000 ???? ifnconst MedianOrderLUT 251 28000 ???? jmp MedianOrderLUTend 252 28000 ???? MedianOrderLUT ; converts our "comparison index" to an index to the median value 253 28000 ???? .byte 0 ; 0 B2 < B0 < B1 254 28000 ???? .byte 1 ; 1 B2 < B1 < B0 255 28000 ???? .byte 2 ; 2 impossible 256 28000 ???? .byte 2 ; 3 B1 < B2 < B0 257 28000 ???? .byte 2 ; 4 B0 < B2 < B1 258 28000 ???? .byte 2 ; 5 impossible 259 28000 ???? .byte 1 ; 6 B0 < B1 < B2 260 28000 ???? .byte 0 ; 7 B1 < B0 < B2 261 28000 ???? MedianOrderLUTend 262 28000 ???? endif 263 28000 ???? ENDM 264 28000 ???? 265 28000 ???? MAC plotsprite 266 28000 ???? 267 28000 ???? ; A macro version of the plotsprite command. 268 28000 ???? ; This trades off rom space for speed. 269 28000 ???? ; It also doesn't check if the visible screen is displayed or not. 270 28000 ???? ; It has no training wheels. It is all rusty sharp edges. 271 28000 ???? 272 28000 ???? .GFXLabel SET {1} 273 28000 ???? .Palette SET {2} ; constant 274 28000 ???? .SpriteX SET {3} ; variable 275 28000 ???? .SpriteY SET {4} ; variable 276 28000 ???? .ByteOffset SET {5} ; variable 277 28000 ???? 278 28000 ???? lda .SpriteY 279 28000 ???? lsr 280 28000 ???? lsr 281 28000 ???? asr #%11111110 ; ensure carry is clear 282 28000 ???? if WZONEHEIGHT = 16 283 28000 ???? asr #%11111110 ; ensure carry is clear 284 28000 ???? endif 285 28000 ???? 286 28000 ???? tax 287 28000 ???? 288 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 289 28000 ???? sta dlpnt 290 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 291 28000 ???? sta dlpnt+1 292 28000 ???? 293 28000 ???? ldy dlend,x ; find the next new object position in this zone 294 28000 ???? 295 28000 ???? lda .ByteOffset 296 28000 ???? if {1}_width = 2 297 28000 ???? asl 298 28000 ???? endif 299 28000 ???? if {1}_width = 3 300 28000 ???? asl 301 28000 ???? adc .ByteOffset 302 28000 ???? endif 303 28000 ???? if {1}_width = 4 304 28000 ???? asl 305 28000 ???? asl 306 28000 ???? endif 307 28000 ???? if {1}_width = 5 308 28000 ???? asl 309 28000 ???? asl 310 28000 ???? adc .ByteOffset 311 28000 ???? endif 312 28000 ???? if {1}_width = 6 313 28000 ???? asl 314 28000 ???? adc .ByteOffset 315 28000 ???? asl 316 28000 ???? endif 317 28000 ???? if {1}_width = 7 318 28000 ???? asl 319 28000 ???? adc .ByteOffset 320 28000 ???? asl 321 28000 ???? adc .ByteOffset 322 28000 ???? endif 323 28000 ???? if {1}_width = 8 324 28000 ???? asl 325 28000 ???? asl 326 28000 ???? asl 327 28000 ???? endif 328 28000 ???? if {1}_width = 9 329 28000 ???? asl 330 28000 ???? asl 331 28000 ???? asl 332 28000 ???? adc .ByteOffset 333 28000 ???? endif 334 28000 ???? if {1}_width = 10 335 28000 ???? asl 336 28000 ???? asl 337 28000 ???? adc .ByteOffset 338 28000 ???? asl 339 28000 ???? endif 340 28000 ???? if {1}_width = 11 341 28000 ???? asl 342 28000 ???? asl 343 28000 ???? adc .ByteOffset 344 28000 ???? asl 345 28000 ???? adc .ByteOffset 346 28000 ???? endif 347 28000 ???? if {1}_width = 12 348 28000 ???? asl 349 28000 ???? adc .ByteOffset 350 28000 ???? asl 351 28000 ???? asl 352 28000 ???? endif 353 28000 ???? if {1}_width = 13 354 28000 ???? asl 355 28000 ???? adc .ByteOffset 356 28000 ???? asl 357 28000 ???? asl 358 28000 ???? adc .ByteOffset 359 28000 ???? endif 360 28000 ???? if {1}_width = 14 361 28000 ???? asl 362 28000 ???? adc .ByteOffset 363 28000 ???? asl 364 28000 ???? adc .ByteOffset 365 28000 ???? asl 366 28000 ???? endif 367 28000 ???? 368 28000 ???? adc #<.GFXLabel ; carry is clear via previous asl or asr 369 28000 ???? sta (dlpnt),y ; #1 - low byte object address 370 28000 ???? 371 28000 ???? iny 372 28000 ???? 373 28000 ???? lda #({1}_mode | %01000000) 374 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 375 28000 ???? 376 28000 ???? iny 377 28000 ???? 378 28000 ???? lda .SpriteY 379 28000 ???? and #(WZONEHEIGHT - 1) 380 28000 ???? cmp #1 ; clear carry if our sprite is just in this zone 381 28000 ???? ora #>.GFXLabel 382 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 383 28000 ???? 384 28000 ???? iny 385 28000 ???? 386 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 387 28000 ???? sta (dlpnt),y ; #4 - palette|width 388 28000 ???? 389 28000 ???? iny 390 28000 ???? 391 28000 ???? lda .SpriteX 392 28000 ???? sta (dlpnt),y ; #5 - x object position 393 28000 ???? 394 28000 ???? iny 395 28000 ???? sty dlend,x 396 28000 ???? 397 28000 ???? ifconst ALWAYSTERMINATE 398 28000 ???? iny 399 28000 ???? lda #0 400 28000 ???? sta (dlpnt),y 401 28000 ???? endif 402 28000 ???? 403 28000 ???? bcc .PLOTSPRITEend 404 28000 ???? 405 28000 ???? inx ; next zone 406 28000 ???? 407 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 408 28000 ???? sta dlpnt 409 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 410 28000 ???? sta dlpnt+1 411 28000 ???? 412 28000 ???? ldy dlend,x ; find the next new object position in this zone 413 28000 ???? 414 28000 ???? lda .ByteOffset 415 28000 ???? if {1}_width = 1 416 28000 ???? clc 417 28000 ???? endif 418 28000 ???? if {1}_width = 2 419 28000 ???? asl ; carry clear 420 28000 ???? endif 421 28000 ???? if {1}_width = 3 422 28000 ???? asl ; carry clear 423 28000 ???? adc .ByteOffset 424 28000 ???? endif 425 28000 ???? if {1}_width = 4 426 28000 ???? asl ; carry clear 427 28000 ???? asl 428 28000 ???? endif 429 28000 ???? if {1}_width = 5 430 28000 ???? asl ; carry clear 431 28000 ???? asl 432 28000 ???? adc .ByteOffset 433 28000 ???? endif 434 28000 ???? if {1}_width = 6 435 28000 ???? asl ; carry clear 436 28000 ???? adc .ByteOffset 437 28000 ???? asl 438 28000 ???? endif 439 28000 ???? if {1}_width = 7 440 28000 ???? asl ; carry clear 441 28000 ???? adc .ByteOffset 442 28000 ???? asl 443 28000 ???? endif 444 28000 ???? if {1}_width = 8 445 28000 ???? asl ; carry clear 446 28000 ???? asl 447 28000 ???? asl 448 28000 ???? endif 449 28000 ???? if {1}_width = 9 450 28000 ???? asl ; carry clear 451 28000 ???? asl 452 28000 ???? asl 453 28000 ???? adc .ByteOffset 454 28000 ???? endif 455 28000 ???? if {1}_width = 10 456 28000 ???? asl ; carry clear 457 28000 ???? asl 458 28000 ???? adc .ByteOffset 459 28000 ???? asl 460 28000 ???? endif 461 28000 ???? if {1}_width = 11 462 28000 ???? asl ; carry clear 463 28000 ???? asl 464 28000 ???? adc .ByteOffset 465 28000 ???? asl 466 28000 ???? adc .ByteOffset 467 28000 ???? endif 468 28000 ???? if {1}_width = 12 469 28000 ???? asl ; carry clear 470 28000 ???? adc .ByteOffset 471 28000 ???? asl 472 28000 ???? asl 473 28000 ???? endif 474 28000 ???? if {1}_width = 13 475 28000 ???? asl ; carry clear 476 28000 ???? adc .ByteOffset 477 28000 ???? asl 478 28000 ???? asl 479 28000 ???? adc .ByteOffset 480 28000 ???? endif 481 28000 ???? if {1}_width = 14 482 28000 ???? asl ; carry clear 483 28000 ???? adc .ByteOffset 484 28000 ???? asl 485 28000 ???? adc .ByteOffset 486 28000 ???? asl 487 28000 ???? endif 488 28000 ???? 489 28000 ???? adc #<.GFXLabel 490 28000 ???? sta (dlpnt),y ; #1 - low byte object address 491 28000 ???? 492 28000 ???? iny 493 28000 ???? 494 28000 ???? lda #({1}_mode | %01000000) 495 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 496 28000 ???? 497 28000 ???? iny 498 28000 ???? 499 28000 ???? lda .SpriteY 500 28000 ???? and #(WZONEHEIGHT - 1) 501 28000 ???? ora #>(.GFXLabel - (WZONEHEIGHT * 256)) ; start in the dma hole 502 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 503 28000 ???? 504 28000 ???? iny 505 28000 ???? 506 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 507 28000 ???? sta (dlpnt),y ; #4 - palette|width 508 28000 ???? 509 28000 ???? iny 510 28000 ???? 511 28000 ???? lda .SpriteX 512 28000 ???? sta (dlpnt),y ; #5 - x object position 513 28000 ???? 514 28000 ???? iny 515 28000 ???? sty dlend,x 516 28000 ???? 517 28000 ???? ifconst ALWAYSTERMINATE 518 28000 ???? iny 519 28000 ???? lda #0 520 28000 ???? sta (dlpnt),y 521 28000 ???? endif 522 28000 ???? 523 28000 ???? .PLOTSPRITEend 524 28000 ???? ENDM 525 28000 ???? 526 28000 ???? MAC sizeof 527 28000 ???? 528 28000 ???? ; echo's the size difference between the current address and the 529 28000 ???? ; a label that was passed as an argument. This is a quick way to 530 28000 ???? ; determine the size of a structure. 531 28000 ???? 532 28000 ???? .NAME SETSTR {1} 533 28000 ???? echo " The Size of",.NAME,"is:",[* - {1}]d,[* - {2}]d,"bytes." 534 28000 ???? ENDM 535 28000 ???? 536 28000 ???? ; 537 28000 ???? ; speakjet.inc 538 28000 ???? ; 539 28000 ???? ; 540 28000 ???? ; AtariVox Speech Synth Driver 541 28000 ???? ; 542 28000 ???? ; By Alex Herbert, 2004 543 28000 ???? ; 544 28000 ???? 545 28000 ???? 546 28000 ???? 547 28000 ???? 548 28000 ???? ; Constants 549 28000 ???? 550 28000 ???? 551 28000 ???? 00 01 SERIAL_OUTMASK equ $01 552 28000 ???? 00 02 SERIAL_RDYMASK equ $02 553 28000 ???? 554 28000 ???? 555 28000 ???? 556 28000 ???? ; Macros 557 28000 ???? 558 28000 ???? mac spkout 559 28000 ???? 560 28000 ???? ; check buffer-full status 561 28000 ???? lda SWCHA 562 28000 ???? and #SERIAL_RDYMASK 563 28000 ???? beq .speech_done 564 28000 ???? 565 28000 ???? ; get next speech byte 566 28000 ???? ldy #$00 567 28000 ???? lda (speech_addr),y 568 28000 ???? 569 28000 ???? ; invert data and check for end of string 570 28000 ???? eor #$ff 571 28000 ???? ;sta BACKGRND ; debug - uncomment to flash the background color with vox data 572 28000 ???? beq .speech_done 573 28000 ???? sta {1} 574 28000 ???? 575 28000 ???? ; increment speech pointer 576 28000 ???? inc speech_addr 577 28000 ???? bne .incaddr_skip 578 28000 ???? inc speech_addr+1 579 28000 ???? .incaddr_skip 580 28000 ???? 581 28000 ???? ; output byte as serial data 582 28000 ???? 583 28000 ???? sec ; start bit 584 28000 ???? .byteout_loop 585 28000 ???? ; put carry flag into bit 0 of SWACNT, preserving other bits 586 28000 ???? lda SWACNT ; 4 587 28000 ???? and #$fe ; 2 6 588 28000 ???? adc #$00 ; 2 8 589 28000 ???? sta SWACNT ; 4 12 590 28000 ???? 591 28000 ???? ; 10 bits sent? (1 start bit, 8 data bits, 1 stop bit) 592 28000 ???? cpy #$09 ; 2 14 593 28000 ???? beq .speech_done ; 2 16 594 28000 ???? iny ; 2 18 595 28000 ???? 596 28000 ???? ; the 7800 is 1.5x faster than the 2600. Waste more cycles here 597 28000 ???? ; to match the original baud rate... 598 28000 ???? ;ldx #$07 ; 2600 599 28000 ???? ldx #$0D 600 28000 ???? 601 28000 ???? .delay_loop 602 28000 ???? dex ; 603 28000 ???? bne .delay_loop ; 36 54 604 28000 ???? 605 28000 ???? ; shift next data bit into carry 606 28000 ???? lsr {1} ; 5 59 607 28000 ???? 608 28000 ???? ; and loop (branch always taken) 609 28000 ???? bpl .byteout_loop ; 3 62 cycles for loop 610 28000 ???? 611 28000 ???? .speech_done 612 28000 ???? 613 28000 ???? endm 614 28000 ???? 615 28000 ???? 616 28000 ???? mac speak 617 28000 ???? 618 28000 ???? lda #<{1} 619 28000 ???? sta speech_addr 620 28000 ???? lda #>{1} 621 28000 ???? sta speech_addr+1 622 28000 ???? 623 28000 ???? endm 624 28000 ???? 625 28000 ???? 626 28000 ???? 627 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 628 28000 ???? 629 28000 ???? processor 6502 630 28000 ???? ------- FILE 7800basic.h LEVEL 2 PASS 3 0 28000 ???? include "7800basic.h" 1 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 28000 ???? 3 28000 ???? processor 6502 ------- FILE 7800.h LEVEL 3 PASS 3 0 28000 ???? include "7800.h" 1 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 28000 ???? 3 28000 ???? ; 7800.h 4 28000 ???? ; Version 1.0, 2019/12/13 5 28000 ???? 6 28000 ???? ; This file defines hardware registers and memory mapping for the 7 28000 ???? ; Atari 7800. It is distributed as a companion machine-specific support package 8 28000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are 9 28000 ???? ; available at https://github.com/dasm-assembler/dasm 10 28000 ???? 11 28000 ???? 12 28000 ???? ; ******************** 7800 Hardware Addresses *************************** 13 28000 ???? ; 14 28000 ???? ; MEMORY MAP USAGE OF THE 7800 15 28000 ???? ; 16 28000 ???? ; 00 - 1F TIA REGISTERS 17 28000 ???? ; 20 - 3F MARIA REGISTERS 18 28000 ???? ; 40 - FF RAM block 0 (zero page) 19 28000 ???? ; 100 - 11F TIA (mirror of 0000-001f) 20 28000 ???? ; 120 - 13F MARIA (mirror of 0020-003f) 21 28000 ???? ; 140 - 1FF RAM block 1 (stack) 22 28000 ???? ; 200 - 21F TIA (mirror of 0000-001f) 23 28000 ???? ; 220 - 23F MARIA (mirror of 0020-003f) 24 28000 ???? ; 240 - 27F ??? 25 28000 ???? ; 280 - 2FF RIOT I/O ports and timers 26 28000 ???? ; 300 - 31F TIA (mirror of 0000-001f) 27 28000 ???? ; 320 - 33F MARIA (mirror of 0020-003f) 28 28000 ???? ; 340 - 3FF ??? 29 28000 ???? ; 400 - 47F unused address space 30 28000 ???? ; 480 - 4FF RIOT RAM 31 28000 ???? ; 500 - 57F unused address space 32 28000 ???? ; 580 - 5FF RIOT RAM (mirror of 0480-04ff) 33 28000 ???? ; 600 - 17FF unused address space 34 28000 ???? ; 1800 - 203F RAM 35 28000 ???? ; 2040 - 20FF RAM block 0 (mirror of 0000-001f) 36 28000 ???? ; 2100 - 213F RAM 37 28000 ???? ; 2140 - 21FF RAM block 1 (mirror of 0140-01ff) 38 28000 ???? ; 2200 - 27FF RAM 39 28000 ???? ; 2800 - 2FFF unavailable to external devices (bios bus-conflict) 40 28000 ???? ; 3000 - 3FFF unused address space 41 28000 ???? ; 4000 - FF7F potential cartridge address space 42 28000 ???? ; FF80 - FFF9 RESERVED FOR ENCRYPTION 43 28000 ???? ; FFFA - FFFF 6502 VECTORS 44 28000 ???? 45 28000 ???? 46 28000 ???? ;****** 00-1F ********* TIA REGISTERS ****************** 47 28000 ???? 48 28000 ???? 00 01 INPTCTRL = $01 ;Input control. In same address space as TIA. write-only 49 28000 ???? 00 01 VBLANK = $01 ;VBLANK. D7=1:dump paddle caps to ground. write-only 50 28000 ???? 00 02 _WSYNC = $02 ;Wait for HSync write-only 51 28000 ???? 00 03 _RSYNC = $03 ;Reset HSync write-only 52 28000 ???? 00 08 INPT0 = $08 ;Paddle Control Input 0 read-only 53 28000 ???? 00 09 INPT1 = $09 ;Paddle Control Input 1 read-only 54 28000 ???? 00 0a INPT2 = $0A ;Paddle Control Input 2 read-only 55 28000 ???? 00 0b INPT3 = $0B ;Paddle Control Input 3 read-only 56 28000 ???? 57 28000 ???? ; ** some common alternate names for INPT0/1/2/3 58 28000 ???? 00 08 INPT4B = $08 ;Joystick 0 Fire 1 read-only 59 28000 ???? 00 09 INPT4A = $09 ;Joystick 0 Fire 1 read-only 60 28000 ???? 00 0a INPT5B = $0A ;Joystick 1 Fire 0 read-only 61 28000 ???? 00 0b INPT5A = $0B ;Joystick 1 Fire 1 read-only 62 28000 ???? 00 08 INPT4R = $08 ;Joystick 0 Fire 1 read-only 63 28000 ???? 00 09 INPT4L = $09 ;Joystick 0 Fire 1 read-only 64 28000 ???? 00 0a INPT5R = $0A ;Joystick 1 Fire 0 read-only 65 28000 ???? 00 0b INPT5L = $0B ;Joystick 1 Fire 1 read-only 66 28000 ???? 67 28000 ???? 00 0c INPT4 = $0C ;Player 0 Fire Button Input read-only 68 28000 ???? 00 0d INPT5 = $0D ;Player 1 Fire Button Input read-only 69 28000 ???? 70 28000 ???? 00 15 AUDC0 = $15 ;Audio Control Channel 0 write-only 71 28000 ???? 00 16 AUDC1 = $16 ;Audio Control Channel 1 write-only 72 28000 ???? 00 17 AUDF0 = $17 ;Audio Frequency Channel 0 write-only 73 28000 ???? 00 18 AUDF1 = $18 ;Audio Frequency Channel 1 write-only 74 28000 ???? 00 19 AUDV0 = $19 ;Audio Volume Channel 0 write-only 75 28000 ???? 00 1a AUDV1 = $1A ;Audio Volume Channel 1 write-only 76 28000 ???? 77 28000 ???? ;****** 20-3F ********* MARIA REGISTERS *************** 78 28000 ???? 79 28000 ???? 00 20 BACKGRND = $20 ;Background Color write-only 80 28000 ???? 00 21 P0C1 = $21 ;Palette 0 - Color 1 write-only 81 28000 ???? 00 22 P0C2 = $22 ;Palette 0 - Color 2 write-only 82 28000 ???? 00 23 P0C3 = $23 ;Palette 0 - Color 3 write-only 83 28000 ???? 00 24 WSYNC = $24 ;Wait For Sync write-only 84 28000 ???? 00 25 P1C1 = $25 ;Palette 1 - Color 1 write-only 85 28000 ???? 00 26 P1C2 = $26 ;Palette 1 - Color 2 write-only 86 28000 ???? 00 27 P1C3 = $27 ;Palette 1 - Color 3 write-only 87 28000 ???? 00 28 MSTAT = $28 ;Maria Status read-only 88 28000 ???? 00 29 P2C1 = $29 ;Palette 2 - Color 1 write-only 89 28000 ???? 00 2a P2C2 = $2A ;Palette 2 - Color 2 write-only 90 28000 ???? 00 2b P2C3 = $2B ;Palette 2 - Color 3 write-only 91 28000 ???? 00 2c DPPH = $2C ;Display List List Pointer High write-only 92 28000 ???? 00 2d P3C1 = $2D ;Palette 3 - Color 1 write-only 93 28000 ???? 00 2e P3C2 = $2E ;Palette 3 - Color 2 write-only 94 28000 ???? 00 2f P3C3 = $2F ;Palette 3 - Color 3 write-only 95 28000 ???? 00 30 DPPL = $30 ;Display List List Pointer Low write-only 96 28000 ???? 00 31 P4C1 = $31 ;Palette 4 - Color 1 write-only 97 28000 ???? 00 32 P4C2 = $32 ;Palette 4 - Color 2 write-only 98 28000 ???? 00 33 P4C3 = $33 ;Palette 4 - Color 3 write-only 99 28000 ???? 00 34 CHARBASE = $34 ;Character Base Address write-only 100 28000 ???? 00 34 CHBASE = $34 ;Character Base Address write-only 101 28000 ???? 00 35 P5C1 = $35 ;Palette 5 - Color 1 write-only 102 28000 ???? 00 36 P5C2 = $36 ;Palette 5 - Color 2 write-only 103 28000 ???? 00 37 P5C3 = $37 ;Palette 5 - Color 3 write-only 104 28000 ???? 00 38 OFFSET = $38 ;Unused - Store zero here write-only 105 28000 ???? 00 39 P6C1 = $39 ;Palette 6 - Color 1 write-only 106 28000 ???? 00 3a P6C2 = $3A ;Palette 6 - Color 2 write-only 107 28000 ???? 00 3b P6C3 = $3B ;Palette 6 - Color 3 write-only 108 28000 ???? 00 3c CTRL = $3C ;Maria Control Register write-only 109 28000 ???? 00 3d P7C1 = $3D ;Palette 7 - Color 1 write-only 110 28000 ???? 00 3e P7C2 = $3E ;Palette 7 - Color 2 write-only 111 28000 ???? 00 3f P7C3 = $3F ;Palette 7 - Color 3 write-only 112 28000 ???? 113 28000 ???? 114 28000 ???? ;****** 280-2FF ******* PIA PORTS AND TIMERS ************ 115 28000 ???? 116 28000 ???? 02 80 SWCHA = $280 ;P0+P1 Joystick Directional Input read-write 117 28000 ???? 02 81 CTLSWA = $281 ;I/O Control for SCHWA read-write 118 28000 ???? 02 81 SWACNT = $281 ;VCS name for above read-write 119 28000 ???? 02 82 SWCHB = $282 ;Console Switches read-write 120 28000 ???? 02 83 CTLSWB = $283 ;I/O Control for SCHWB read-write 121 28000 ???? 02 83 SWBCNT = $283 ;VCS name for above read-write 122 28000 ???? 123 28000 ???? 02 84 INTIM = $284 ;Interval Timer Read read-only 124 28000 ???? 02 94 TIM1T = $294 ;Set 1 CLK Interval (838 nsec/interval) write-only 125 28000 ???? 02 95 TIMINT = $295 ;Interval Timer Interrupt read-only 126 28000 ???? 02 95 TIM8T = $295 ;Set 8 CLK Interval (6.7 usec/interval) write-only 127 28000 ???? 02 96 TIM64T = $296 ;Set 64 CLK Interval (63.6 usec/interval) write-only 128 28000 ???? 02 97 T1024T = $297 ;Set 1024 CLK Interval (858.2 usec/interval) write-only 129 28000 ???? 02 9e TIM64TI = $29E ;Interrupt timer 64T write-only 130 28000 ???? 131 28000 ???? ;XM 132 28000 ???? 04 70 XCTRL = $470 ; 7=YM2151 6=RAM@6k 5=RAM@4k 4=pokey@450 3=hsc 2=cart 1=RoF_bank1 0=RoF_bank2 133 28000 ???? 04 70 XCTRL1 = $470 134 28000 ???? 04 78 XCTRL2 = $478 135 28000 ???? 04 7c XCTRL3 = $47c 136 28000 ???? 04 71 XCTRL4 = $471 137 28000 ???? 04 72 XCTRL5 = $472 138 28000 ???? 139 28000 ???? ; Pokey register relative locations, since its base may be different 140 28000 ???? ; depending on the hardware. 141 28000 ???? 00 00 PAUDF0 = $0 ; extra audio channels and frequencies 142 28000 ???? 00 01 PAUDC0 = $1 143 28000 ???? 00 02 PAUDF1 = $2 144 28000 ???? 00 03 PAUDC1 = $3 145 28000 ???? 00 04 PAUDF2 = $4 146 28000 ???? 00 05 PAUDC2 = $5 147 28000 ???? 00 06 PAUDF3 = $6 148 28000 ???? 00 07 PAUDC3 = $7 149 28000 ???? 00 08 PAUDCTL = $8 ; Audio Control 150 28000 ???? 00 09 PSTIMER = $9 151 28000 ???? 00 0a PRANDOM = $A ; 17 bit polycounter pseudo random 152 28000 ???? 00 0f PSKCTL = $F ; Serial Port control ------- FILE 7800basic.h ------- FILE 7800basic_variable_redefs.h LEVEL 3 PASS 3 0 28000 ???? include "7800basic_variable_redefs.h" 1 28000 ???? ; This file contains variable mapping and other information for the current project. 2 28000 ???? 3 28000 ???? 00 00 heofonfir_complete_font_mode = $00 4 28000 ???? 00 0f heofonfir_complete_font_width_twoscompliment = $0f 5 28000 ???? 00 51 heofonfir_complete_font_width = $51 6 28000 ???? 00 00 heofonfir_push_fire_banner_mode = $00 7 28000 ???? 00 16 heofonfir_push_fire_banner_width_twoscompliment = $16 8 28000 ???? 00 0a heofonfir_push_fire_banner_width = $0a 9 28000 ???? 00 00 heofonfir_logo_r_tallsprite_00_mode = $00 10 28000 ???? 00 1c heofonfir_logo_r_tallsprite_00_width_twoscompliment = $1c 11 28000 ???? 00 04 heofonfir_logo_r_tallsprite_00_width = $04 12 28000 ???? 00 00 heofonfir_logo_r_mode = $00 13 28000 ???? 00 1c heofonfir_logo_r_width_twoscompliment = $1c 14 28000 ???? 00 04 heofonfir_logo_r_width = $04 15 28000 ???? 00 00 heofonfir_logo_o_tallsprite_00_mode = $00 16 28000 ???? 00 1c heofonfir_logo_o_tallsprite_00_width_twoscompliment = $1c 17 28000 ???? 00 04 heofonfir_logo_o_tallsprite_00_width = $04 18 28000 ???? 00 00 heofonfir_logo_o_mode = $00 19 28000 ???? 00 1c heofonfir_logo_o_width_twoscompliment = $1c 20 28000 ???? 00 04 heofonfir_logo_o_width = $04 21 28000 ???? 00 00 heofonfir_logo_n_tallsprite_00_mode = $00 22 28000 ???? 00 1c heofonfir_logo_n_tallsprite_00_width_twoscompliment = $1c 23 28000 ???? 00 04 heofonfir_logo_n_tallsprite_00_width = $04 24 28000 ???? 00 00 heofonfir_logo_n_mode = $00 25 28000 ???? 00 1c heofonfir_logo_n_width_twoscompliment = $1c 26 28000 ???? 00 04 heofonfir_logo_n_width = $04 27 28000 ???? 00 00 heofonfir_logo_i_tallsprite_00_mode = $00 28 28000 ???? 00 1c heofonfir_logo_i_tallsprite_00_width_twoscompliment = $1c 29 28000 ???? 00 04 heofonfir_logo_i_tallsprite_00_width = $04 30 28000 ???? 00 00 heofonfir_logo_i_mode = $00 31 28000 ???? 00 1c heofonfir_logo_i_width_twoscompliment = $1c 32 28000 ???? 00 04 heofonfir_logo_i_width = $04 33 28000 ???? 00 00 heofonfir_logo_h_tallsprite_00_mode = $00 34 28000 ???? 00 1c heofonfir_logo_h_tallsprite_00_width_twoscompliment = $1c 35 28000 ???? 00 04 heofonfir_logo_h_tallsprite_00_width = $04 36 28000 ???? 00 00 heofonfir_logo_h_mode = $00 37 28000 ???? 00 1c heofonfir_logo_h_width_twoscompliment = $1c 38 28000 ???? 00 04 heofonfir_logo_h_width = $04 39 28000 ???? 00 00 heofonfir_logo_f_tallsprite_00_mode = $00 40 28000 ???? 00 1c heofonfir_logo_f_tallsprite_00_width_twoscompliment = $1c 41 28000 ???? 00 04 heofonfir_logo_f_tallsprite_00_width = $04 42 28000 ???? 00 00 heofonfir_logo_f_mode = $00 43 28000 ???? 00 1c heofonfir_logo_f_width_twoscompliment = $1c 44 28000 ???? 00 04 heofonfir_logo_f_width = $04 45 28000 ???? 00 00 heofonfir_logo_e_tallsprite_00_mode = $00 46 28000 ???? 00 1c heofonfir_logo_e_tallsprite_00_width_twoscompliment = $1c 47 28000 ???? 00 04 heofonfir_logo_e_tallsprite_00_width = $04 48 28000 ???? 00 00 heofonfir_logo_e_mode = $00 49 28000 ???? 00 1c heofonfir_logo_e_width_twoscompliment = $1c 50 28000 ???? 00 04 heofonfir_logo_e_width = $04 51 28000 ???? 00 00 heofonfir_complete_font_color3 = 0 52 28000 ???? 00 28 heofonfir_complete_font_color2 = $28 53 28000 ???? 00 0f heofonfir_complete_font_color1 = $0f 54 28000 ???? 00 00 heofonfir_complete_font_color0 = $00 55 28000 ???? 00 0f heofonfir_push_fire_banner_color3 = $0f 56 28000 ???? 00 2c heofonfir_push_fire_banner_color2 = $2c 57 28000 ???? 00 28 heofonfir_push_fire_banner_color1 = $28 58 28000 ???? 00 00 heofonfir_push_fire_banner_color0 = $00 59 28000 ???? 00 00 heofonfir_logo_r_tallsprite_00_color3 = 0 60 28000 ???? 00 2c heofonfir_logo_r_tallsprite_00_color2 = $2c 61 28000 ???? 00 28 heofonfir_logo_r_tallsprite_00_color1 = $28 62 28000 ???? 00 00 heofonfir_logo_r_tallsprite_00_color0 = $00 63 28000 ???? 00 00 heofonfir_logo_r_color3 = 0 64 28000 ???? 00 2c heofonfir_logo_r_color2 = $2c 65 28000 ???? 00 28 heofonfir_logo_r_color1 = $28 66 28000 ???? 00 00 heofonfir_logo_r_color0 = $00 67 28000 ???? 00 00 heofonfir_logo_o_tallsprite_00_color3 = 0 68 28000 ???? 00 2c heofonfir_logo_o_tallsprite_00_color2 = $2c 69 28000 ???? 00 28 heofonfir_logo_o_tallsprite_00_color1 = $28 70 28000 ???? 00 00 heofonfir_logo_o_tallsprite_00_color0 = $00 71 28000 ???? 00 00 heofonfir_logo_o_color3 = 0 72 28000 ???? 00 2c heofonfir_logo_o_color2 = $2c 73 28000 ???? 00 28 heofonfir_logo_o_color1 = $28 74 28000 ???? 00 00 heofonfir_logo_o_color0 = $00 75 28000 ???? 00 00 heofonfir_logo_n_tallsprite_00_color3 = 0 76 28000 ???? 00 2c heofonfir_logo_n_tallsprite_00_color2 = $2c 77 28000 ???? 00 28 heofonfir_logo_n_tallsprite_00_color1 = $28 78 28000 ???? 00 00 heofonfir_logo_n_tallsprite_00_color0 = $00 79 28000 ???? 00 00 heofonfir_logo_n_color3 = 0 80 28000 ???? 00 2c heofonfir_logo_n_color2 = $2c 81 28000 ???? 00 28 heofonfir_logo_n_color1 = $28 82 28000 ???? 00 00 heofonfir_logo_n_color0 = $00 83 28000 ???? 00 00 heofonfir_logo_i_tallsprite_00_color3 = 0 84 28000 ???? 00 2c heofonfir_logo_i_tallsprite_00_color2 = $2c 85 28000 ???? 00 28 heofonfir_logo_i_tallsprite_00_color1 = $28 86 28000 ???? 00 00 heofonfir_logo_i_tallsprite_00_color0 = $00 87 28000 ???? 00 00 heofonfir_logo_i_color3 = 0 88 28000 ???? 00 2c heofonfir_logo_i_color2 = $2c 89 28000 ???? 00 28 heofonfir_logo_i_color1 = $28 90 28000 ???? 00 00 heofonfir_logo_i_color0 = $00 91 28000 ???? 00 00 heofonfir_logo_h_tallsprite_00_color3 = 0 92 28000 ???? 00 2c heofonfir_logo_h_tallsprite_00_color2 = $2c 93 28000 ???? 00 28 heofonfir_logo_h_tallsprite_00_color1 = $28 94 28000 ???? 00 00 heofonfir_logo_h_tallsprite_00_color0 = $00 95 28000 ???? 00 00 heofonfir_logo_h_color3 = 0 96 28000 ???? 00 2c heofonfir_logo_h_color2 = $2c 97 28000 ???? 00 28 heofonfir_logo_h_color1 = $28 98 28000 ???? 00 00 heofonfir_logo_h_color0 = $00 99 28000 ???? 00 00 heofonfir_logo_f_tallsprite_00_color3 = 0 100 28000 ???? 00 2c heofonfir_logo_f_tallsprite_00_color2 = $2c 101 28000 ???? 00 28 heofonfir_logo_f_tallsprite_00_color1 = $28 102 28000 ???? 00 00 heofonfir_logo_f_tallsprite_00_color0 = $00 103 28000 ???? 00 00 heofonfir_logo_f_color3 = 0 104 28000 ???? 00 2c heofonfir_logo_f_color2 = $2c 105 28000 ???? 00 28 heofonfir_logo_f_color1 = $28 106 28000 ???? 00 00 heofonfir_logo_f_color0 = $00 107 28000 ???? 00 00 heofonfir_logo_e_tallsprite_00_color3 = 0 108 28000 ???? 00 2c heofonfir_logo_e_tallsprite_00_color2 = $2c 109 28000 ???? 00 28 heofonfir_logo_e_tallsprite_00_color1 = $28 110 28000 ???? 00 00 heofonfir_logo_e_tallsprite_00_color0 = $00 111 28000 ???? 00 00 heofonfir_logo_e_color3 = 0 112 28000 ???? 00 2c heofonfir_logo_e_color2 = $2c 113 28000 ???? 00 28 heofonfir_logo_e_color1 = $28 114 28000 ???? 00 00 heofonfir_logo_e_color0 = $00 115 28000 ???? 01 55 menu_selection_color6 = var21 116 28000 ???? 117 28000 ???? 01 54 menu_selection_color5 = var20 118 28000 ???? 119 28000 ???? 01 53 menu_selection_color4 = var19 120 28000 ???? 121 28000 ???? 01 52 menu_selection_color3 = var18 122 28000 ???? 123 28000 ???? 01 51 menu_selection_color2 = var17 124 28000 ???? 125 28000 ???? 01 50 menu_selection_color1 = var16 126 28000 ???? 127 28000 ???? 01 4f menu_option_time = var15 128 28000 ???? 129 28000 ???? 01 4e menu_option_lives = var14 130 28000 ???? 131 28000 ???? 01 4d menu_option_skill = var13 132 28000 ???? 133 28000 ???? 01 4c menu_option_players = var12 134 28000 ???? 135 28000 ???? 01 4b menu_yposition = var11 136 28000 ???? 137 28000 ???? 01 4a menu_xposition = var10 138 28000 ???? 139 28000 ???? 01 49 joyposright = var9 140 28000 ???? 141 28000 ???? 01 48 joyposleft = var8 142 28000 ???? 143 28000 ???? 01 47 joyposup = var7 144 28000 ???? 145 28000 ???? 01 46 joyposdown = var6 146 28000 ???? 147 28000 ???? 01 45 debounce_fire = var5 148 28000 ???? 149 28000 ???? 01 44 debounce_right = var4 150 28000 ???? 151 28000 ???? 01 43 debounce_left = var3 152 28000 ???? 153 28000 ???? 01 42 debounce_down = var2 154 28000 ???? 155 28000 ???? 01 41 debounce_up = var1 156 28000 ???? 157 28000 ???? 01 40 frameCounter = var0 158 28000 ???? 159 28000 ???? 00 01 EXTRADLMEMORY = 1 160 28000 ???? 00 01 NTSC = 1 161 28000 ???? 00 10 ZONEHEIGHT = 16 162 28000 ???? 00 08 bankswitchmode = 8 163 28000 ???? 00 01 ROM128K = 1 ------- FILE 7800basic.h 6 28000 ???? 7 28000 ???? ;************ 7800 overall RAM map ************** 8 28000 ???? 9 28000 ???? ; 40-FF zero page RAM 10 28000 ???? ; 140-1FF RAM (stack) 11 28000 ???? ; 1800-203F RAM 12 28000 ???? ; 2100-213F RAM 13 28000 ???? ; 2200-27FF RAM 14 28000 ???? 15 28000 ???? ;************ 7800basic RAM usage map ************** 16 28000 ???? 17 28000 ???? ; 40-FF numerous defines, listed below 18 28000 ???? ; 140-1FF RAM (stack) 19 28000 ???? 20 28000 ???? ; 1800-187F DLL (1800-18DF with page flipping enabled) 21 28000 ???? ; 1880-1FFF DLs (18E0-1FFF with page flipping enabled) 22 28000 ???? 23 28000 ???? ; 2000-203F Reserved 24 28000 ???? ; 2100-213F Reserved 25 28000 ???? ; 2200-27FF Free 26 28000 ???? 27 28000 ???? 1f e0 eeprombuffer = $1FE0 28 28000 ???? 18 00 DLLMEM = $1800 29 28000 ???? 00 70 DBOFFSET = $70 ; $E0 length DL is /2 for double-buffering 30 28000 ???? 31 28000 ???? - ifconst PLOTVALUEPAGE 32 28000 ???? -VALBUFFER = (PLOTVALUEPAGE*256) 33 28000 ???? else 34 28000 ???? 20 00 VALBUFFER = $2000 ; to $203F ** never let VALBUFFER straddle pages 35 28000 ???? endif 36 28000 ???? 37 28000 ???? 38 28000 ???? 21 00 pausestate = $2100 39 28000 ???? 21 01 dlzero = $2101 ; zero to force end of $2100 DL, which we use in vblank and overscan 40 28000 ???? 21 02 sINPT1 = $2102 ; save register for joy button joy0 41 28000 ???? 21 03 sINPT3 = $2103 ; save register for joy button joy1 42 28000 ???? 21 04 currentbank = $2104 43 28000 ???? 44 28000 ???? 21 05 currentrambank = $2105 45 28000 ???? 21 06 charactermode = $2106 46 28000 ???? 21 07 sCTRL = $2107 47 28000 ???? 21 08 pokeydetected = $2108 48 28000 ???? 21 09 paldetected = $2109 49 28000 ???? 21 0a avoxdetected = $210A 50 28000 ???? 21 0b sCHARBASE = $210B ; save register for CHARBASE 51 28000 ???? 52 28000 ???? 21 0c hsdevice = $210C 53 28000 ???? 21 0d hsdifficulty = $210D 54 28000 ???? 21 0e hserror = $210E 55 28000 ???? 21 0f hsgameslot = $210F 56 28000 ???? 21 10 hsnewscoreline = $2110 57 28000 ???? 21 11 hsnewscorerank = $2111 58 28000 ???? 21 12 HSRAMTable = $2112 ; to $212F (30 bytes) Format: III*5, SSS*5 59 28000 ???? 21 12 HSRAMInitials = $2112 ; see above 60 28000 ???? 21 21 HSRAMScores = $2121 ; see above 61 28000 ???? 62 28000 ???? 21 31 ssCTRL = $2131 63 28000 ???? 21 32 ssCHARBASE = $2132 64 28000 ???? 21 33 hsdisplaymode = $2133 65 28000 ???? 21 34 gamedifficulty = $2134 66 28000 ???? 21 35 hsinitialpos = $2135 67 28000 ???? 21 36 hsinitialhold = $2136 68 28000 ???? 21 37 hscursorx = $2137 69 28000 ???? 21 38 hsjoydebounce = $2138 70 28000 ???? 21 39 hsswcha = $2139 71 28000 ???? 21 3a hsinpt1 = $213A 72 28000 ???? 21 3b hscolorchaseindex = $213B 73 28000 ???? 21 3c visibleDLLstart = $213C 74 28000 ???? 21 3d overscanDLLstart = $213D 75 28000 ???? 21 3e frameslost = $213E 76 28000 ???? 21 3f hsreturn = $213F 77 28000 ???? 78 28000 ???? 79 28000 ???? 00 40 rand = $40 80 28000 ???? 00 41 rand16 = $41 81 28000 ???? 00 42 temp1 = $42 82 28000 ???? 00 43 temp2 = $43 83 28000 ???? 00 44 temp3 = $44 84 28000 ???? 00 45 temp4 = $45 85 28000 ???? 00 46 temp5 = $46 86 28000 ???? 00 47 temp6 = $47 87 28000 ???? 00 48 temp7 = $48 88 28000 ???? 00 49 temp8 = $49 89 28000 ???? 00 4a temp9 = $4a 90 28000 ???? 91 28000 ???? 00 4b pokeybase = $4b 92 28000 ???? 00 4b pokeybaselo = $4b 93 28000 ???? 00 4c pokeybasehi = $4c 94 28000 ???? 95 28000 ???? 00 4d visibleover = $4d 96 28000 ???? 97 28000 ???? 00 4e sfx1pointlo = $4e 98 28000 ???? 00 4f sfx2pointlo = $4f 99 28000 ???? 00 50 sfx1pointhi = $50 100 28000 ???? 00 51 sfx2pointhi = $51 101 28000 ???? 102 28000 ???? 00 52 sfx1priority = $52 103 28000 ???? 00 53 sfx2priority = $53 104 28000 ???? 00 54 sfx1poffset = $54 105 28000 ???? 00 55 sfx2poffset = $55 106 28000 ???? 107 28000 ???? 00 56 sfx1frames = $56 108 28000 ???? 00 57 sfx2frames = $57 109 28000 ???? 00 58 sfx1tick = $58 110 28000 ???? 00 59 sfx2tick = $59 111 28000 ???? 112 28000 ???? 00 5a tempmath = $5a 113 28000 ???? 114 28000 ???? 00 5b pokey1pointlo = $5b 115 28000 ???? 00 5c pokey1pointhi = $5c 116 28000 ???? 00 5d pokey2pointlo = $5d 117 28000 ???? 00 5e pokey2pointhi = $5e 118 28000 ???? 00 5f pokey3pointlo = $5f 119 28000 ???? 00 60 pokey3pointhi = $60 120 28000 ???? 00 61 pokey4pointlo = $61 121 28000 ???? 00 62 pokey4pointhi = $62 122 28000 ???? 123 28000 ???? 00 63 dlpnt = $63 ; to $64 124 28000 ???? 00 65 dlend = $65 ; to $81 - for 28 possible visible dll entries 125 28000 ???? 00 82 dlendsave = $82 ; to $9e - for 28 possible visible dll entries 126 28000 ???? 127 28000 ???? 00 9f speech_addr = $9f 128 28000 ???? 00 a0 speech_addr_hi = $a0 129 28000 ???? 130 28000 ???? 00 a1 HSGameTableLo = $a1 131 28000 ???? 00 a2 HSGameTableHi = $a2 132 28000 ???? 00 a3 HSVoxHi = $a3 133 28000 ???? 00 a4 HSVoxLo = $a4 134 28000 ???? 135 28000 ???? ;channel pointers 136 28000 ???? 137 28000 ???? 00 a5 songchannel1layer1lo = $a5 138 28000 ???? 00 a6 songchannel2layer1lo = $a6 139 28000 ???? 00 a7 songchannel3layer1lo = $a7 140 28000 ???? 00 a8 songchannel4layer1lo = $a8 141 28000 ???? 142 28000 ???? 00 a9 songchannel1layer2lo = $a9 143 28000 ???? 00 aa songchannel2layer2lo = $aA 144 28000 ???? 00 ab songchannel3layer2lo = $aB 145 28000 ???? 00 ac songchannel4layer2lo = $aC 146 28000 ???? 147 28000 ???? 00 ad songchannel1layer3lo = $aD 148 28000 ???? 00 ae songchannel2layer3lo = $aE 149 28000 ???? 00 af songchannel3layer3lo = $aF 150 28000 ???? 00 b0 songchannel4layer3lo = $b0 151 28000 ???? 152 28000 ???? 00 b1 songchannel1layer1hi = $b1 153 28000 ???? 00 b2 songchannel2layer1hi = $b2 154 28000 ???? 00 b3 songchannel3layer1hi = $b3 155 28000 ???? 00 b4 songchannel4layer1hi = $b4 156 28000 ???? 157 28000 ???? 00 b5 songchannel1layer2hi = $b5 158 28000 ???? 00 b6 songchannel2layer2hi = $b6 159 28000 ???? 00 b7 songchannel3layer2hi = $b7 160 28000 ???? 00 b8 songchannel4layer2hi = $b8 161 28000 ???? 162 28000 ???? 00 b9 songchannel1layer3hi = $b9 163 28000 ???? 00 ba songchannel2layer3hi = $bA 164 28000 ???? 00 bb songchannel3layer3hi = $bB 165 28000 ???? 00 bc songchannel4layer3hi = $bC 166 28000 ???? 167 28000 ???? 00 bd songdatalo = $bd 168 28000 ???? 00 be songdatahi = $be 169 28000 ???? 170 28000 ???? 00 bf inactivechannelcount = $bf 171 28000 ???? 172 28000 ???? 00 c0 songchannel1transpose = $c0 173 28000 ???? 00 c1 songchannel2transpose = $c1 174 28000 ???? 00 c2 songchannel3transpose = $c2 175 28000 ???? 00 c3 songchannel4transpose = $c3 176 28000 ???? 177 28000 ???? 00 c4 songstackindex = $c4 178 28000 ???? 179 28000 ???? 00 c5 songchannel1instrumentlo = $c5 180 28000 ???? 00 c6 songchannel2instrumentlo = $c6 181 28000 ???? 00 c7 songchannel3instrumentlo = $c7 182 28000 ???? 00 c8 songchannel4instrumentlo = $c8 183 28000 ???? 184 28000 ???? 00 c9 songchannel1instrumenthi = $c9 185 28000 ???? 00 ca songchannel2instrumenthi = $ca 186 28000 ???? 00 cb songchannel3instrumenthi = $cb 187 28000 ???? 00 cc songchannel4instrumenthi = $cc 188 28000 ???? 189 28000 ???? 00 cd sfx1notedata = $cd 190 28000 ???? 00 ce sfx2notedata = $ce 191 28000 ???? 192 28000 ???? 00 cf songloops = $cf 193 28000 ???? 194 28000 ???? 00 d0 songpointerlo = $D0 195 28000 ???? 00 d1 songpointerhi = $D1 196 28000 ???? 197 28000 ???? 00 d2 voxlock = $D2 198 28000 ???? 00 d3 voxqueuesize = $D3 199 28000 ???? 200 28000 ???? 00 d4 vblankroutines = $D4 201 28000 ???? 202 28000 ???? 00 d5 doublebufferstate = $D5 203 28000 ???? 00 d6 doublebufferdloffset = $D6 204 28000 ???? 00 d7 doublebufferbufferdirty = $D7 205 28000 ???? 206 28000 ???? 00 d8 inttemp1 = $D8 207 28000 ???? 00 d9 inttemp2 = $D9 208 28000 ???? 00 da inttemp3 = $DA 209 28000 ???? 00 db inttemp4 = $DB 210 28000 ???? 00 dc inttemp5 = $DC 211 28000 ???? 00 dd inttemp6 = $DD 212 28000 ???? 213 28000 ???? 00 de sfxschedulelock = $DE 214 28000 ???? 00 df sfxschedulemissed = $DF 215 28000 ???? 00 e0 sfxinstrumentlo = $E0 216 28000 ???? 00 e1 sfxinstrumenthi = $E1 217 28000 ???? 00 e2 sfxpitchoffset = $E2 218 28000 ???? 00 e3 sfxnoteindex = $E3 219 28000 ???? 220 28000 ???? 00 e4 CTLSWAs = $E4 221 28000 ???? 00 e5 CTLSWBs = $E5 222 28000 ???? 223 28000 ???? 00 e6 A = $e6 224 28000 ???? 00 e6 a = $e6 225 28000 ???? 00 e7 B = $e7 226 28000 ???? 00 e7 b = $e7 227 28000 ???? 00 e8 C = $e8 228 28000 ???? 00 e8 c = $e8 229 28000 ???? 00 e9 D = $e9 230 28000 ???? 00 e9 d = $e9 231 28000 ???? 00 ea E = $ea 232 28000 ???? 00 ea e = $ea 233 28000 ???? 00 eb F = $eb 234 28000 ???? 00 eb f = $eb 235 28000 ???? 00 ec G = $ec 236 28000 ???? 00 ec g = $ec 237 28000 ???? 00 ed H = $ed 238 28000 ???? 00 ed h = $ed 239 28000 ???? 00 ee I = $ee 240 28000 ???? 00 ee i = $ee 241 28000 ???? 00 ef J = $ef 242 28000 ???? 00 ef j = $ef 243 28000 ???? 00 f0 K = $f0 244 28000 ???? 00 f0 k = $f0 245 28000 ???? 00 f1 L = $f1 246 28000 ???? 00 f1 l = $f1 247 28000 ???? 00 f2 M = $f2 248 28000 ???? 00 f2 m = $f2 249 28000 ???? 00 f3 N = $f3 250 28000 ???? 00 f3 n = $f3 251 28000 ???? 00 f4 O = $f4 252 28000 ???? 00 f4 o = $f4 253 28000 ???? 00 f5 P = $f5 254 28000 ???? 00 f5 p = $f5 255 28000 ???? 00 f6 Q = $f6 256 28000 ???? 00 f6 q = $f6 257 28000 ???? 00 f7 R = $f7 258 28000 ???? 00 f7 r = $f7 259 28000 ???? 00 f8 S = $f8 260 28000 ???? 00 f8 s = $f8 261 28000 ???? 00 f9 T = $f9 262 28000 ???? 00 f9 t = $f9 263 28000 ???? 00 fa U = $fa 264 28000 ???? 00 fa u = $fa 265 28000 ???? 00 fb V = $fb 266 28000 ???? 00 fb v = $fb 267 28000 ???? 00 fc W = $fc 268 28000 ???? 00 fc w = $fc 269 28000 ???? 00 fd X = $fd 270 28000 ???? 00 fd x = $fd 271 28000 ???? 00 fe Y = $fe 272 28000 ???? 00 fe y = $fe 273 28000 ???? 00 ff Z = $ff 274 28000 ???? 00 ff z = $ff 275 28000 ???? 276 28000 ???? ; var0-var99 variables use the top of the stack 277 28000 ???? 01 40 var0 = $140 278 28000 ???? 01 41 var1 = $141 279 28000 ???? 01 42 var2 = $142 280 28000 ???? 01 43 var3 = $143 281 28000 ???? 01 44 var4 = $144 282 28000 ???? 01 45 var5 = $145 283 28000 ???? 01 46 var6 = $146 284 28000 ???? 01 47 var7 = $147 285 28000 ???? 01 48 var8 = $148 286 28000 ???? 01 49 var9 = $149 287 28000 ???? 01 4a var10 = $14a 288 28000 ???? 01 4b var11 = $14b 289 28000 ???? 01 4c var12 = $14c 290 28000 ???? 01 4d var13 = $14d 291 28000 ???? 01 4e var14 = $14e 292 28000 ???? 01 4f var15 = $14f 293 28000 ???? 01 50 var16 = $150 294 28000 ???? 01 51 var17 = $151 295 28000 ???? 01 52 var18 = $152 296 28000 ???? 01 53 var19 = $153 297 28000 ???? 01 54 var20 = $154 298 28000 ???? 01 55 var21 = $155 299 28000 ???? 01 56 var22 = $156 300 28000 ???? 01 57 var23 = $157 301 28000 ???? 01 58 var24 = $158 302 28000 ???? 01 59 var25 = $159 303 28000 ???? 01 5a var26 = $15a 304 28000 ???? 01 5b var27 = $15b 305 28000 ???? 01 5c var28 = $15c 306 28000 ???? 01 5d var29 = $15d 307 28000 ???? 01 5e var30 = $15e 308 28000 ???? 01 5f var31 = $15f 309 28000 ???? 01 60 var32 = $160 310 28000 ???? 01 61 var33 = $161 311 28000 ???? 01 62 var34 = $162 312 28000 ???? 01 63 var35 = $163 313 28000 ???? 01 64 var36 = $164 314 28000 ???? 01 65 var37 = $165 315 28000 ???? 01 66 var38 = $166 316 28000 ???? 01 67 var39 = $167 317 28000 ???? 01 68 var40 = $168 318 28000 ???? 01 69 var41 = $169 319 28000 ???? 01 6a var42 = $16a 320 28000 ???? 01 6b var43 = $16b 321 28000 ???? 01 6c var44 = $16c 322 28000 ???? 01 6d var45 = $16d 323 28000 ???? 01 6e var46 = $16e 324 28000 ???? 01 6f var47 = $16f 325 28000 ???? 01 70 var48 = $170 326 28000 ???? 01 71 var49 = $171 327 28000 ???? 01 72 var50 = $172 328 28000 ???? 01 73 var51 = $173 329 28000 ???? 01 74 var52 = $174 330 28000 ???? 01 75 var53 = $175 331 28000 ???? 01 76 var54 = $176 332 28000 ???? 01 77 var55 = $177 333 28000 ???? 01 78 var56 = $178 334 28000 ???? 01 79 var57 = $179 335 28000 ???? 01 7a var58 = $17a 336 28000 ???? 01 7b var59 = $17b 337 28000 ???? 01 7c var60 = $17c 338 28000 ???? 01 7d var61 = $17d 339 28000 ???? 01 7e var62 = $17e 340 28000 ???? 01 7f var63 = $17f 341 28000 ???? 01 80 var64 = $180 342 28000 ???? 01 81 var65 = $181 343 28000 ???? 01 82 var66 = $182 344 28000 ???? 01 83 var67 = $183 345 28000 ???? 01 84 var68 = $184 346 28000 ???? 01 85 var69 = $185 347 28000 ???? 01 86 var70 = $186 348 28000 ???? 01 87 var71 = $187 349 28000 ???? 01 88 var72 = $188 350 28000 ???? 01 89 var73 = $189 351 28000 ???? 01 8a var74 = $18a 352 28000 ???? 01 8b var75 = $18b 353 28000 ???? 01 8c var76 = $18c 354 28000 ???? 01 8d var77 = $18d 355 28000 ???? 01 8e var78 = $18e 356 28000 ???? 01 8f var79 = $18f 357 28000 ???? 01 90 var80 = $190 358 28000 ???? 01 91 var81 = $191 359 28000 ???? 01 92 var82 = $192 360 28000 ???? 01 93 var83 = $193 361 28000 ???? 01 94 var84 = $194 362 28000 ???? 01 95 var85 = $195 363 28000 ???? 01 96 var86 = $196 364 28000 ???? 01 97 var87 = $197 365 28000 ???? 01 98 var88 = $198 366 28000 ???? 01 99 var89 = $199 367 28000 ???? 01 9a var90 = $19a 368 28000 ???? 01 9b var91 = $19b 369 28000 ???? 01 9c var92 = $19c 370 28000 ???? 01 9d var93 = $19d 371 28000 ???? 01 9e var94 = $19e 372 28000 ???? 01 9f var95 = $19f 373 28000 ???? 01 a0 var96 = $1a0 374 28000 ???? 01 a1 var97 = $1a1 375 28000 ???? 01 a2 var98 = $1a2 376 28000 ???? 01 a3 var99 = $1a3 377 28000 ???? 378 U01c2 ???? SEG.U "7800basicRAM" 379 U01a4 ORG $1A4 380 U01a4 381 U01a4 ; MAX allocation locations are in comments... 382 U01a4 00 framecounter DS 1 ; $1A4 383 U01a5 00 countdownseconds DS 1 ; $1A5 384 U01a6 00 00 00 score0 DS 3 ; $1A6 $1A7 $1A8 385 U01a9 00 00 00 score1 DS 3 ; $1A9 $1AA $1AB 386 U01ac 00 pausebuttonflag DS 1 ; $1AC 387 U01ad 00 valbufend DS 1 ; $1AD 388 U01ae 00 valbufendsave DS 1 ; $1AE 389 U01af 00 finescrollx DS 1 ; $1AF 390 U01b0 00 finescrolly DS 1 ; $1B0 391 U01b1 00 joybuttonmode DS 1 ; $1B1 ; track joysticks that were changed to one-button mode 392 U01b2 00 interruptindex DS 1 ; $1B2 393 U01b3 394 U01b3 - ifconst DOUBLEBUFFER 395 U01b3 -doublebufferminimumframetarget DS 1 ; $1B3 396 U01b3 -doublebufferminimumframeindex DS 1 ; $1B4 397 U01b3 endif 398 U01b3 399 U01b3 00 pausedisable DS 1 ; $1B5 400 U01b4 00 XCTRL1s DS 1 ; $1B6 401 U01b5 402 U01b5 - ifconst AVOXVOICE 403 U01b5 -avoxenable DS 1 ; $1B7 404 U01b5 -tempavox DS 1 ; $1B8 405 U01b5 endif 406 U01b5 407 U01b5 - ifconst MUSICTRACKER 408 U01b5 -songtempo DS 1 ; $1B9 409 U01b5 -songtick DS 1 ; $1BA 410 U01b5 - 411 U01b5 -songchannel1layer1loops DS 1 ; $1BB 412 U01b5 -songchannel2layer1loops DS 1 ; $1BC 413 U01b5 -songchannel3layer1loops DS 1 ; $1BD 414 U01b5 -songchannel4layer1loops DS 1 ; $1BE 415 U01b5 - 416 U01b5 -songchannel1layer2loops DS 1 ; $1BF 417 U01b5 -songchannel2layer2loops DS 1 ; $1C0 418 U01b5 -songchannel3layer2loops DS 1 ; $1C1 419 U01b5 -songchannel4layer2loops DS 1 ; $1C2 420 U01b5 - 421 U01b5 -songchannel1layer3loops DS 1 ; $1C3 422 U01b5 -songchannel2layer3loops DS 1 ; $1C4 423 U01b5 -songchannel3layer3loops DS 1 ; $1C5 424 U01b5 -songchannel4layer3loops DS 1 ; $1C6 425 U01b5 - 426 U01b5 -songchannel1busywait DS 1 ; $1C7 427 U01b5 -songchannel2busywait DS 1 ; $1C8 428 U01b5 -songchannel3busywait DS 1 ; $1C9 429 U01b5 -songchannel4busywait DS 1 ; $1CA 430 U01b5 - 431 U01b5 -songchannel1stackdepth DS 1 ; $1CB 432 U01b5 -songchannel2stackdepth DS 1 ; $1CC 433 U01b5 -songchannel3stackdepth DS 1 ; $1CD 434 U01b5 -songchannel4stackdepth DS 1 ; $1CE 435 U01b5 endif 436 U01b5 437 U01b5 00 palframes DS 1 ; $1CF 438 U01b6 00 palfastframe DS 1 ; $1D0 439 U01b7 440 U01b7 - ifconst MOUSESUPPORT 441 U01b7 -port0resolution DS 1 ; $1D1 442 U01b7 -port1resolution DS 1 ; $1D2 443 U01b7 else 444 U01b7 - ifconst TRAKBALLSUPPORT 445 U01b7 -port0resolution DS 1 ; $1D1 446 U01b7 -port1resolution DS 1 ; $1D2 447 U01b7 endif 448 U01b7 endif 449 U01b7 450 U01b7 00 port0control DS 1 ; $1D3 451 U01b8 00 port1control DS 1 ; $1D4 452 U01b9 453 U01b9 ; port#control values... 454 U01b9 ; 1 = proline 455 U01b9 ; 2 = lightgun 456 U01b9 ; 3 = paddle 457 U01b9 ; 4 = trakball 458 U01b9 ; 5 = vcs joystick 459 U01b9 ; 6 = driving 460 U01b9 ; 7 = keypad 461 U01b9 ; 8 = st mouse/cx80 462 U01b9 ; 9 = amiga mouse 463 U01b9 ; 10 = atarivox 464 U01b9 465 U01b9 ; controller 0 data... 466 U01b9 00 paddleposition0 DS 1 ; $1D5 467 U01b9 01 b9 keypadmatrix0a = paddleposition0 468 U01b9 01 b9 drivingposition0 = paddleposition0 469 U01b9 01 b9 trakballx0 = paddleposition0 470 U01b9 01 b9 mousex0 = paddleposition0 471 U01b9 01 b9 lighttgunx0 = paddleposition0 472 U01b9 01 b9 snes2atari0lo = paddleposition0 473 U01ba 474 U01ba ; controller 1 data... 475 U01ba 00 paddleposition2 DS 1 ; $1D6 476 U01ba 01 ba keypadmatrix1a = paddleposition2 477 U01ba 01 ba drivingposition1 = paddleposition2 478 U01ba 01 ba trakballx1 = paddleposition2 479 U01ba 01 ba mousex1 = paddleposition2 480 U01ba 01 ba lightgunx1 = paddleposition2 481 U01ba 01 ba snes2atari1lo = paddleposition2 482 U01bb 483 U01bb ; controller 0 altdata... 484 U01bb 00 paddleposition1 DS 1 ; $1D7 485 U01bb 01 bb keypadmatrix0b = paddleposition1 486 U01bb 01 bb trakbally0 = paddleposition1 487 U01bb 01 bb mousey0 = paddleposition1 488 U01bb 01 bb lightguny0 = paddleposition1 489 U01bb 01 bb snes2atari0hi = paddleposition1 490 U01bc 491 U01bc ; controller 1 altdata... 492 U01bc 00 paddleposition3 DS 1 ; $1D8 493 U01bc 01 bc keypadmatrix1b = paddleposition3 494 U01bc 01 bc trakbally1 = paddleposition3 495 U01bc 01 bc mousey1 = paddleposition3 496 U01bc 01 bc lightguny1 = paddleposition3 497 U01bc 01 bc snes2atari1hi = paddleposition3 498 U01bd 499 U01bd ; controller state save. for trakball state+dir codes, rotary position codes 500 U01bd 00 controller0statesave DS 1 ; $1D9 501 U01bd 01 bd paddleprevious0 = controller0statesave 502 U01bd 01 bd mousecodex0 = controller0statesave 503 U01bd 01 bd trakballcodex0 = controller0statesave 504 U01bd 01 bd keypadmatrix0c = controller0statesave 505 U01bd 01 bd snesdetected0 = controller0statesave 506 U01be 507 U01be 00 controller1statesave DS 1 ; $1DA 508 U01be 01 be paddleprevious2 = controller1statesave 509 U01be 01 be mousecodex1 = controller1statesave 510 U01be 01 be trakballcodex1 = controller1statesave 511 U01be 01 be keypadmatrix1c = controller1statesave 512 U01be 01 be snesdetected1 = controller1statesave 513 U01bf 514 U01bf 00 paddleprevious1 DS 1 ; $1DB 515 U01bf 01 bf keypadmatrix0d = paddleprevious1 516 U01bf 01 bf mousecodey0 = paddleprevious1 517 U01bf 01 bf trakballcodey0 = paddleprevious1 518 U01c0 519 U01c0 00 paddleprevious3 DS 1 ; $1DC 520 U01c0 01 c0 keypadmatrix1d = paddleprevious3 521 U01c0 01 c0 mousecodey1 = paddleprevious3 522 U01c0 01 c0 trakballcodey1 = paddleprevious3 523 U01c1 524 U01c1 - ifconst pokeysupport 525 U01c1 -pokey1frames DS 1 ; $1DD 526 U01c1 -pokey1tick DS 1 ; $1DE 527 U01c1 -pokey2frames DS 1 ; $1DF 528 U01c1 -pokey2tick DS 1 ; $1E0 529 U01c1 -pokey3frames DS 1 ; $1E1 530 U01c1 -pokey3tick DS 1 ; $1E2 531 U01c1 -pokey4frames DS 1 ; $1E3 532 U01c1 -pokey4tick DS 1 ; $1E4 533 U01c1 -pokey1priority DS 1 ; $1E5 534 U01c1 -pokey1offset DS 1 ; $1E6 535 U01c1 -pokey2priority DS 1 ; $1E7 536 U01c1 -pokey2offset DS 1 ; $1E8 537 U01c1 -pokey3priority DS 1 ; $1E9 538 U01c1 -pokey3offset DS 1 ; $1EA 539 U01c1 -pokey4priority DS 1 ; $1EB 540 U01c1 -pokey4offset DS 1 ; $1EC 541 U01c1 endif 542 U01c1 543 U01c1 - ifconst pokeykeysupport 544 U01c1 -pokeylastkeycode DS 1 545 U01c1 -pokeykeycode DS 1 546 U01c1 -pokeykeydebounce DS 1 547 U01c1 endif 548 U01c1 549 U01c1 - ifconst RMT 550 U01c1 -rasterpause DS 1 551 U01c1 endif ; RMT 552 U01c1 - ifconst RMTVOLUME 553 U01c1 -rmtvolume DS 1 554 U01c1 endif ; RMTVOLUME 555 U01c1 - ifconst TIAVOLUME 556 U01c1 -tiavolume DS 1 557 U01c1 endif ; TIAVOLUME 558 U01c1 559 U01c1 - ifconst FOURBITFADE 560 U01c1 -fourbittemp1 DS 1 561 U01c1 -fourbitfadevalue DS 1 562 U01c1 -fourbittemp1int DS 1 563 U01c1 -fourbitfadevalueint DS 1 564 U01c1 endif ; FOURBITFADE 565 U01c1 566 U01c1 - ifconst SNES2ATARISUPPORT 567 U01c1 -snesport DS 1 568 U01c1 endif 569 U01c1 570 U01c1 - ifconst KEYPADSUPPORT 571 U01c1 -keypadcounter DS 1 572 U01c1 endif 573 U01c1 574 U01c1 ; see if we need an interrupthold byte... 575 U01c1 INTERRUPTNEEDED SET 0 576 U01c1 - ifconst .topscreenroutine 577 U01c1 -INTERRUPTNEEDED SET 1 578 U01c1 endif 579 U01c1 - ifconst .bottomscreenroutine 580 U01c1 -INTERRUPTNEEDED SET 1 581 U01c1 endif 582 U01c1 - ifconst .userinterrupt 583 U01c1 -INTERRUPTNEEDED SET 1 584 U01c1 endif 585 U01c1 - if INTERRUPTNEEDED = 1 586 U01c1 -interrupthold DS 1 ; $1ED 587 U01c1 endif 588 U01c1 589 U01c1 ifnconst CANARYOFF 590 U01c1 00 canary DS 1 ; $1EF 591 U01c2 endif 592 U01c2 593 U01c2 594 U01c2 - ifnconst bankswitchmode 595 U01c2 - echo " stack allowance:",[($1FF - .)/2]d,"nested subroutines." 596 U01c2 else stack allowance: 20 nested subroutines. 597 U01c2 echo " stack allowance:",[($1FF - .)/3]d,"nested subroutines." 598 U01c2 endif 599 U01c2 ifnconst CANARYOFF the canary is situated at: $1c1 600 U01c2 echo " the canary is situated at:",[canary] 601 U01c2 - else 602 U01c2 - echo " the canary is disabled." 603 U01c2 endif 604 U01c2 605 U01c2 ; $1EE - $1FF reserved for stack 606 U01c2 607 28000 ???? SEG "GAME" 608 28000 ???? ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Menu_Demo_v2.78b.asm ------- FILE 7800basic_variable_redefs.h LEVEL 2 PASS 3 0 28000 ???? include "7800basic_variable_redefs.h" 1 28000 ???? ; This file contains variable mapping and other information for the current project. 2 28000 ???? 3 28000 ???? 00 00 heofonfir_complete_font_mode = $00 4 28000 ???? 00 0f heofonfir_complete_font_width_twoscompliment = $0f 5 28000 ???? 00 51 heofonfir_complete_font_width = $51 6 28000 ???? 00 00 heofonfir_push_fire_banner_mode = $00 7 28000 ???? 00 16 heofonfir_push_fire_banner_width_twoscompliment = $16 8 28000 ???? 00 0a heofonfir_push_fire_banner_width = $0a 9 28000 ???? 00 00 heofonfir_logo_r_tallsprite_00_mode = $00 10 28000 ???? 00 1c heofonfir_logo_r_tallsprite_00_width_twoscompliment = $1c 11 28000 ???? 00 04 heofonfir_logo_r_tallsprite_00_width = $04 12 28000 ???? 00 00 heofonfir_logo_r_mode = $00 13 28000 ???? 00 1c heofonfir_logo_r_width_twoscompliment = $1c 14 28000 ???? 00 04 heofonfir_logo_r_width = $04 15 28000 ???? 00 00 heofonfir_logo_o_tallsprite_00_mode = $00 16 28000 ???? 00 1c heofonfir_logo_o_tallsprite_00_width_twoscompliment = $1c 17 28000 ???? 00 04 heofonfir_logo_o_tallsprite_00_width = $04 18 28000 ???? 00 00 heofonfir_logo_o_mode = $00 19 28000 ???? 00 1c heofonfir_logo_o_width_twoscompliment = $1c 20 28000 ???? 00 04 heofonfir_logo_o_width = $04 21 28000 ???? 00 00 heofonfir_logo_n_tallsprite_00_mode = $00 22 28000 ???? 00 1c heofonfir_logo_n_tallsprite_00_width_twoscompliment = $1c 23 28000 ???? 00 04 heofonfir_logo_n_tallsprite_00_width = $04 24 28000 ???? 00 00 heofonfir_logo_n_mode = $00 25 28000 ???? 00 1c heofonfir_logo_n_width_twoscompliment = $1c 26 28000 ???? 00 04 heofonfir_logo_n_width = $04 27 28000 ???? 00 00 heofonfir_logo_i_tallsprite_00_mode = $00 28 28000 ???? 00 1c heofonfir_logo_i_tallsprite_00_width_twoscompliment = $1c 29 28000 ???? 00 04 heofonfir_logo_i_tallsprite_00_width = $04 30 28000 ???? 00 00 heofonfir_logo_i_mode = $00 31 28000 ???? 00 1c heofonfir_logo_i_width_twoscompliment = $1c 32 28000 ???? 00 04 heofonfir_logo_i_width = $04 33 28000 ???? 00 00 heofonfir_logo_h_tallsprite_00_mode = $00 34 28000 ???? 00 1c heofonfir_logo_h_tallsprite_00_width_twoscompliment = $1c 35 28000 ???? 00 04 heofonfir_logo_h_tallsprite_00_width = $04 36 28000 ???? 00 00 heofonfir_logo_h_mode = $00 37 28000 ???? 00 1c heofonfir_logo_h_width_twoscompliment = $1c 38 28000 ???? 00 04 heofonfir_logo_h_width = $04 39 28000 ???? 00 00 heofonfir_logo_f_tallsprite_00_mode = $00 40 28000 ???? 00 1c heofonfir_logo_f_tallsprite_00_width_twoscompliment = $1c 41 28000 ???? 00 04 heofonfir_logo_f_tallsprite_00_width = $04 42 28000 ???? 00 00 heofonfir_logo_f_mode = $00 43 28000 ???? 00 1c heofonfir_logo_f_width_twoscompliment = $1c 44 28000 ???? 00 04 heofonfir_logo_f_width = $04 45 28000 ???? 00 00 heofonfir_logo_e_tallsprite_00_mode = $00 46 28000 ???? 00 1c heofonfir_logo_e_tallsprite_00_width_twoscompliment = $1c 47 28000 ???? 00 04 heofonfir_logo_e_tallsprite_00_width = $04 48 28000 ???? 00 00 heofonfir_logo_e_mode = $00 49 28000 ???? 00 1c heofonfir_logo_e_width_twoscompliment = $1c 50 28000 ???? 00 04 heofonfir_logo_e_width = $04 51 28000 ???? 00 00 heofonfir_complete_font_color3 = 0 52 28000 ???? 00 28 heofonfir_complete_font_color2 = $28 53 28000 ???? 00 0f heofonfir_complete_font_color1 = $0f 54 28000 ???? 00 00 heofonfir_complete_font_color0 = $00 55 28000 ???? 00 0f heofonfir_push_fire_banner_color3 = $0f 56 28000 ???? 00 2c heofonfir_push_fire_banner_color2 = $2c 57 28000 ???? 00 28 heofonfir_push_fire_banner_color1 = $28 58 28000 ???? 00 00 heofonfir_push_fire_banner_color0 = $00 59 28000 ???? 00 00 heofonfir_logo_r_tallsprite_00_color3 = 0 60 28000 ???? 00 2c heofonfir_logo_r_tallsprite_00_color2 = $2c 61 28000 ???? 00 28 heofonfir_logo_r_tallsprite_00_color1 = $28 62 28000 ???? 00 00 heofonfir_logo_r_tallsprite_00_color0 = $00 63 28000 ???? 00 00 heofonfir_logo_r_color3 = 0 64 28000 ???? 00 2c heofonfir_logo_r_color2 = $2c 65 28000 ???? 00 28 heofonfir_logo_r_color1 = $28 66 28000 ???? 00 00 heofonfir_logo_r_color0 = $00 67 28000 ???? 00 00 heofonfir_logo_o_tallsprite_00_color3 = 0 68 28000 ???? 00 2c heofonfir_logo_o_tallsprite_00_color2 = $2c 69 28000 ???? 00 28 heofonfir_logo_o_tallsprite_00_color1 = $28 70 28000 ???? 00 00 heofonfir_logo_o_tallsprite_00_color0 = $00 71 28000 ???? 00 00 heofonfir_logo_o_color3 = 0 72 28000 ???? 00 2c heofonfir_logo_o_color2 = $2c 73 28000 ???? 00 28 heofonfir_logo_o_color1 = $28 74 28000 ???? 00 00 heofonfir_logo_o_color0 = $00 75 28000 ???? 00 00 heofonfir_logo_n_tallsprite_00_color3 = 0 76 28000 ???? 00 2c heofonfir_logo_n_tallsprite_00_color2 = $2c 77 28000 ???? 00 28 heofonfir_logo_n_tallsprite_00_color1 = $28 78 28000 ???? 00 00 heofonfir_logo_n_tallsprite_00_color0 = $00 79 28000 ???? 00 00 heofonfir_logo_n_color3 = 0 80 28000 ???? 00 2c heofonfir_logo_n_color2 = $2c 81 28000 ???? 00 28 heofonfir_logo_n_color1 = $28 82 28000 ???? 00 00 heofonfir_logo_n_color0 = $00 83 28000 ???? 00 00 heofonfir_logo_i_tallsprite_00_color3 = 0 84 28000 ???? 00 2c heofonfir_logo_i_tallsprite_00_color2 = $2c 85 28000 ???? 00 28 heofonfir_logo_i_tallsprite_00_color1 = $28 86 28000 ???? 00 00 heofonfir_logo_i_tallsprite_00_color0 = $00 87 28000 ???? 00 00 heofonfir_logo_i_color3 = 0 88 28000 ???? 00 2c heofonfir_logo_i_color2 = $2c 89 28000 ???? 00 28 heofonfir_logo_i_color1 = $28 90 28000 ???? 00 00 heofonfir_logo_i_color0 = $00 91 28000 ???? 00 00 heofonfir_logo_h_tallsprite_00_color3 = 0 92 28000 ???? 00 2c heofonfir_logo_h_tallsprite_00_color2 = $2c 93 28000 ???? 00 28 heofonfir_logo_h_tallsprite_00_color1 = $28 94 28000 ???? 00 00 heofonfir_logo_h_tallsprite_00_color0 = $00 95 28000 ???? 00 00 heofonfir_logo_h_color3 = 0 96 28000 ???? 00 2c heofonfir_logo_h_color2 = $2c 97 28000 ???? 00 28 heofonfir_logo_h_color1 = $28 98 28000 ???? 00 00 heofonfir_logo_h_color0 = $00 99 28000 ???? 00 00 heofonfir_logo_f_tallsprite_00_color3 = 0 100 28000 ???? 00 2c heofonfir_logo_f_tallsprite_00_color2 = $2c 101 28000 ???? 00 28 heofonfir_logo_f_tallsprite_00_color1 = $28 102 28000 ???? 00 00 heofonfir_logo_f_tallsprite_00_color0 = $00 103 28000 ???? 00 00 heofonfir_logo_f_color3 = 0 104 28000 ???? 00 2c heofonfir_logo_f_color2 = $2c 105 28000 ???? 00 28 heofonfir_logo_f_color1 = $28 106 28000 ???? 00 00 heofonfir_logo_f_color0 = $00 107 28000 ???? 00 00 heofonfir_logo_e_tallsprite_00_color3 = 0 108 28000 ???? 00 2c heofonfir_logo_e_tallsprite_00_color2 = $2c 109 28000 ???? 00 28 heofonfir_logo_e_tallsprite_00_color1 = $28 110 28000 ???? 00 00 heofonfir_logo_e_tallsprite_00_color0 = $00 111 28000 ???? 00 00 heofonfir_logo_e_color3 = 0 112 28000 ???? 00 2c heofonfir_logo_e_color2 = $2c 113 28000 ???? 00 28 heofonfir_logo_e_color1 = $28 114 28000 ???? 00 00 heofonfir_logo_e_color0 = $00 115 28000 ???? 01 55 menu_selection_color6 = var21 116 28000 ???? 117 28000 ???? 01 54 menu_selection_color5 = var20 118 28000 ???? 119 28000 ???? 01 53 menu_selection_color4 = var19 120 28000 ???? 121 28000 ???? 01 52 menu_selection_color3 = var18 122 28000 ???? 123 28000 ???? 01 51 menu_selection_color2 = var17 124 28000 ???? 125 28000 ???? 01 50 menu_selection_color1 = var16 126 28000 ???? 127 28000 ???? 01 4f menu_option_time = var15 128 28000 ???? 129 28000 ???? 01 4e menu_option_lives = var14 130 28000 ???? 131 28000 ???? 01 4d menu_option_skill = var13 132 28000 ???? 133 28000 ???? 01 4c menu_option_players = var12 134 28000 ???? 135 28000 ???? 01 4b menu_yposition = var11 136 28000 ???? 137 28000 ???? 01 4a menu_xposition = var10 138 28000 ???? 139 28000 ???? 01 49 joyposright = var9 140 28000 ???? 141 28000 ???? 01 48 joyposleft = var8 142 28000 ???? 143 28000 ???? 01 47 joyposup = var7 144 28000 ???? 145 28000 ???? 01 46 joyposdown = var6 146 28000 ???? 147 28000 ???? 01 45 debounce_fire = var5 148 28000 ???? 149 28000 ???? 01 44 debounce_right = var4 150 28000 ???? 151 28000 ???? 01 43 debounce_left = var3 152 28000 ???? 153 28000 ???? 01 42 debounce_down = var2 154 28000 ???? 155 28000 ???? 01 41 debounce_up = var1 156 28000 ???? 157 28000 ???? 01 40 frameCounter = var0 158 28000 ???? 159 28000 ???? 00 01 EXTRADLMEMORY = 1 160 28000 ???? 00 01 NTSC = 1 161 28000 ???? 00 10 ZONEHEIGHT = 16 162 28000 ???? 00 08 bankswitchmode = 8 163 28000 ???? 00 01 ROM128K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Menu_Demo_v2.78b.asm 633 28000 ???? 634 28000 ???? ; BEADHEADER... disabled for now 635 28000 ???? ; A BEAD header gets automatically incorportated into the ROM header. 636 28000 ???? ; For more BEAD executable info, check out the spec... 637 28000 ???? ; http://7800.8bitdev.org/index.php/The_Atari_7800_BEAD_Execuable_Specification 638 28000 ???? 639 28000 ???? 00 01 GAMEDESCRIPTIONSET = 1 640 28000 ???? 4e 61 6d 65 GAMEDESCRIPTION = "Test Name" 641 28000 ???? 642 28000 ???? 643 28000 ???? 00 40 BDHSC = %01000000 644 28000 ???? 00 20 BDYM = %00100000 645 28000 ???? 00 10 BDPOKEY = %00010000 646 28000 ???? 00 08 BDROF = %00001000 647 28000 ???? 00 00 BD16K = %00000000 648 28000 ???? 00 01 BD32K = %00000001 649 28000 ???? 00 02 BD48K = %00000010 650 28000 ???? 00 05 BD1800 = %00000101 651 28000 ???? 00 06 BD4000 = %00000110 652 28000 ???? 653 28000 ???? - ifconst BEADHEADER 654 28000 ???? -BEADHARDWARE SET 0 655 28000 ???? - ifconst ROM16K 656 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD16K) 657 28000 ???? - endif 658 28000 ???? - ifconst ROM32K 659 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD32K) 660 28000 ???? - endif 661 28000 ???? - ifconst ROM48K 662 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD48K) 663 28000 ???? - endif 664 28000 ???? - ifconst pokeysupport 665 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDPOKEY) 666 28000 ???? - endif 667 28000 ???? - ifconst HSSUPPORT 668 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDHSC) 669 28000 ???? - endif 670 28000 ???? endif 671 28000 ???? 672 28000 ???? ;start address of cart... 673 28000 ???? 674 28000 ???? BANK_WAS_SET SET 0 675 28000 ???? 676 28000 ???? - ifconst ROM8K 677 28000 ???? - ORG $E000,0 678 28000 ???? -BANK_WAS_SET SET 1 679 28000 ???? endif ; ROM8K 680 28000 ???? 681 28000 ???? - ifconst ROM16K 682 28000 ???? - ORG $C000,0 683 28000 ???? -BANK_WAS_SET SET 1 684 28000 ???? - ifconst BEADHEADER 685 28000 ???? - .byte $BE,$AD,BEADHARDWARE 686 28000 ???? - ifconst GAMEDESCRIPTION 687 28000 ???? - CLC 688 28000 ???? - BCC _SKIPDESCRIPTION 689 28000 ???? - .byte GAMEDESCRIPTION,0 690 28000 ???? -_SKIPDESCRIPTION 691 28000 ???? - endif ; GAMEDESCRIPTION 692 28000 ???? - jmp ($FFFC) 693 28000 ???? - endif ; BEADHEADER 694 28000 ???? endif ; ROM16K 695 28000 ???? 696 28000 ???? - ifconst ROM32K 697 28000 ???? - ORG $8000,0 698 28000 ???? -BANK_WAS_SET SET 1 699 28000 ???? - ifconst BEADHEADER 700 28000 ???? - .byte $BE,$AD,BEADHARDWARE 701 28000 ???? - ifconst GAMEDESCRIPTION 702 28000 ???? - CLC 703 28000 ???? - BCC _SKIPDESCRIPTION 704 28000 ???? - .byte GAMEDESCRIPTION,0 705 28000 ???? -_SKIPDESCRIPTION 706 28000 ???? - endif ; GAMEDESCRIPTION 707 28000 ???? - jmp ($FFFC) 708 28000 ???? - endif ; BEADHEADER 709 28000 ???? endif ; ROM32K 710 28000 ???? 711 28000 ???? - ifconst ROM48K 712 28000 ???? - ORG $4000,0 713 28000 ???? -BANK_WAS_SET SET 1 714 28000 ???? - ifconst BEADHEADER 715 28000 ???? - .byte $BE,$AD,BEADHARDWARE 716 28000 ???? - ifconst GAMEDESCRIPTIONSET 717 28000 ???? - CLC 718 28000 ???? - BCC _SKIPDESCRIPTION 719 28000 ???? - .byte GAMEDESCRIPTION,0 720 28000 ???? -_SKIPDESCRIPTION 721 28000 ???? - endif ; GAMEDESCRIPTIONSET 722 28000 ???? - jmp ($FFFC) 723 28000 ???? - endif ; BEADHEADER 724 28000 ???? endif ; ROM48K 725 28000 ???? 726 28000 ???? - ifconst ROM52K 727 28000 ???? -BANK_WAS_SET SET 1 728 28000 ???? - ORG $3000,0 729 28000 ???? endif ; ROM52K 730 28000 ???? 731 28000 ???? ifconst bankswitchmode 732 28000 ???? - ifconst ROMAT4K 733 28000 ???? -BANK_WAS_SET SET 1 734 28000 ???? - ORG $4000,0 735 28000 ???? - RORG $4000 736 28000 ???? else ; ROMAT4K 737 28000 ???? BANK_WAS_SET SET 1 738 8000 ORG $8000,0 739 8000 RORG $8000 740 8000 endif 741 8000 endif 742 8000 743 8000 - if BANK_WAS_SET = 0 744 8000 - ORG $8000,0 ; default is 32K 745 8000 endif 746 8000 747 8000 START_OF_ROM SET . 748 8000 ;7800basic v0.23 Feb 9 2023 12:05:06 749 8000 SPACEOVERFLOW SET 0 750 8000 game 751 8000 . 752 8000 ;; 753 8000 754 8000 .L00 ;; set romsize 128k 755 8000 756 8000 .L01 ;; set zoneheight 16 757 8000 758 8000 .L02 ;; set basepath graphics 759 8000 760 8000 .L03 ;; set tallsprite on 761 8000 762 8000 .L04 ;; set tv ntsc 763 8000 764 8000 .L05 ;; set extradlmemory on 765 8000 766 8000 .L06 ;; displaymode 160A 767 8000 768 8000 a9 40 lda #%01000000 ;Enable DMA, mode=160x2/160x4 769 8002 85 3c sta CTRL 770 8004 771 8004 8d 07 21 sta sCTRL 772 8007 773 8007 . 774 8007 ;; 775 8007 776 8007 . 777 8007 ;; 778 8007 779 8007 .L07 ;; dim frameCounter = var0 780 8007 781 8007 .L08 ;; dim debounce_up = var1 782 8007 783 8007 .L09 ;; dim debounce_down = var2 784 8007 785 8007 .L010 ;; dim debounce_left = var3 786 8007 787 8007 .L011 ;; dim debounce_right = var4 788 8007 789 8007 .L012 ;; dim debounce_fire = var5 790 8007 791 8007 .L013 ;; dim joyposdown = var6 792 8007 793 8007 .L014 ;; dim joyposup = var7 794 8007 795 8007 .L015 ;; dim joyposleft = var8 796 8007 797 8007 .L016 ;; dim joyposright = var9 798 8007 799 8007 .L017 ;; dim menu_xposition = var10 800 8007 801 8007 .L018 ;; dim menu_yposition = var11 802 8007 803 8007 .L019 ;; dim menu_option_players = var12 804 8007 805 8007 .L020 ;; dim menu_option_skill = var13 806 8007 807 8007 .L021 ;; dim menu_option_lives = var14 808 8007 809 8007 .L022 ;; dim menu_option_time = var15 810 8007 811 8007 .L023 ;; dim menu_selection_color1 = var16 812 8007 813 8007 .L024 ;; dim menu_selection_color2 = var17 814 8007 815 8007 .L025 ;; dim menu_selection_color3 = var18 816 8007 817 8007 .L026 ;; dim menu_selection_color4 = var19 818 8007 819 8007 .L027 ;; dim menu_selection_color5 = var20 820 8007 821 8007 .L028 ;; dim menu_selection_color6 = var21 822 8007 823 8007 . 824 8007 ;; 825 8007 826 8007 .L029 ;; debounce_up = 0 : debounce_down = 0 : debounce_left = 0 : debounce_right = 0 : debounce_fire = 0 827 8007 828 8007 a9 00 LDA #0 829 8009 8d 41 01 STA debounce_up 830 800c 8d 42 01 STA debounce_down 831 800f 8d 43 01 STA debounce_left 832 8012 8d 44 01 STA debounce_right 833 8015 8d 45 01 STA debounce_fire 834 8018 .L030 ;; joyposdown = 0 : joyposup = 0 : joyposleft = 0 : joyposright = 0 835 8018 836 8018 a9 00 LDA #0 837 801a 8d 46 01 STA joyposdown 838 801d 8d 47 01 STA joyposup 839 8020 8d 48 01 STA joyposleft 840 8023 8d 49 01 STA joyposright 841 8026 . 842 8026 ;; 843 8026 844 8026 .L031 ;; incgraphic heofonfir_logo_e.png 160A 845 8026 846 8026 .L032 ;; incgraphic heofonfir_logo_f.png 160A 847 8026 848 8026 .L033 ;; incgraphic heofonfir_logo_h.png 160A 849 8026 850 8026 .L034 ;; incgraphic heofonfir_logo_i.png 160A 851 8026 852 8026 .L035 ;; incgraphic heofonfir_logo_n.png 160A 853 8026 854 8026 .L036 ;; incgraphic heofonfir_logo_o.png 160A 855 8026 856 8026 .L037 ;; incgraphic heofonfir_logo_r.png 160A 857 8026 858 8026 .L038 ;; incgraphic heofonfir_push_fire_banner.png 160A 859 8026 860 8026 .L039 ;; incgraphic heofonfir_complete_font.png 160A 861 8026 862 8026 . 863 8026 ;; 864 8026 865 8026 .L040 ;; BACKGRND = $00 866 8026 867 8026 a9 00 LDA #$00 868 8028 85 20 STA BACKGRND 869 802a . 870 802a ;; 871 802a 872 802a .L041 ;; P0C1 = $F7 : P0C2 = $1C : P0C3 = $0F 873 802a 874 802a a9 f7 LDA #$F7 875 802c 85 21 STA P0C1 876 802e a9 1c LDA #$1C 877 8030 85 22 STA P0C2 878 8032 a9 0f LDA #$0F 879 8034 85 23 STA P0C3 880 8036 .L042 ;; P1C1 = $05 : P1C2 = $15 : P1C3 = $3D 881 8036 882 8036 a9 05 LDA #$05 883 8038 85 25 STA P1C1 884 803a a9 15 LDA #$15 885 803c 85 26 STA P1C2 886 803e a9 3d LDA #$3D 887 8040 85 27 STA P1C3 888 8042 .L043 ;; P2C1 = $90 : P2C2 = $96 : P2C3 = $AF 889 8042 890 8042 a9 90 LDA #$90 891 8044 85 29 STA P2C1 892 8046 a9 96 LDA #$96 893 8048 85 2a STA P2C2 894 804a a9 af LDA #$AF 895 804c 85 2b STA P2C3 896 804e .L044 ;; P3C1 = $77 : P3C2 = $7A : P3C3 = $6F 897 804e 898 804e a9 77 LDA #$77 899 8050 85 2d STA P3C1 900 8052 a9 7a LDA #$7A 901 8054 85 2e STA P3C2 902 8056 a9 6f LDA #$6F 903 8058 85 2f STA P3C3 904 805a .L045 ;; P4C1 = $E1 : P4C2 = $CA : P4C3 = $DD 905 805a 906 805a a9 e1 LDA #$E1 907 805c 85 31 STA P4C1 908 805e a9 ca LDA #$CA 909 8060 85 32 STA P4C2 910 8062 a9 dd LDA #$DD 911 8064 85 33 STA P4C3 912 8066 .L046 ;; P5C1 = $02 : P5C2 = $31 : P5C3 = $25 913 8066 914 8066 a9 02 LDA #$02 915 8068 85 35 STA P5C1 916 806a a9 31 LDA #$31 917 806c 85 36 STA P5C2 918 806e a9 25 LDA #$25 919 8070 85 37 STA P5C3 920 8072 .L047 ;; P6C1 = $07 : P6C2 = $0A : P6C3 = $0C 921 8072 922 8072 a9 07 LDA #$07 923 8074 85 39 STA P6C1 924 8076 a9 0a LDA #$0A 925 8078 85 3a STA P6C2 926 807a a9 0c LDA #$0C 927 807c 85 3b STA P6C3 928 807e .L048 ;; P7C1 = $50 : P7C2 = $64 : P7C3 = $78 929 807e 930 807e a9 50 LDA #$50 931 8080 85 3d STA P7C1 932 8082 a9 64 LDA #$64 933 8084 85 3e STA P7C2 934 8086 a9 78 LDA #$78 935 8088 85 3f STA P7C3 936 808a . 937 808a ;; 938 808a 939 808a .L049 ;; characterset heofonfir_complete_font 940 808a 941 808a a9 a0 lda #>heofonfir_complete_font 942 808c 8d 0b 21 sta sCHARBASE 943 808f 944 808f 85 34 sta CHARBASE 945 8091 a9 60 lda #(heofonfir_complete_font_mode | %01100000) 946 8093 8d 06 21 sta charactermode 947 8096 948 8096 .L050 ;; alphachars '0123456789abcdefghijklmnopqrstuvwxyz.,!?:; &+-=*/\^ˇ_~¸`¡¿()[]æðȝœþƿγδθλξσφψω' 949 8096 950 8096 . 951 8096 ;; 952 8096 953 8096 .L051 ;; goto titlescreen 954 8096 955 8096 4c 84 8e jmp .titlescreen 956 8099 957 8099 .main 958 8099 ;; main 959 8099 960 8099 .L052 ;; if switchreset then reboot 961 8099 962 8099 20 49 f4 jsr checkresetswitch 963 809c d0 03 BNE .skipL052 964 809e .condpart0 965 809e 4c 40 f5 JMP START 966 80a1 .skipL052 967 80a1 .L053 ;; frameCounter = 0 968 80a1 969 80a1 a9 00 LDA #0 970 80a3 8d 40 01 STA frameCounter 971 80a6 .mainloop 972 80a6 ;; mainloop 973 80a6 974 80a6 .L054 ;; drawwait 975 80a6 976 80a6 20 d0 f1 jsr drawwait 977 80a9 .L055 ;; clearscreen 978 80a9 979 80a9 20 7f f0 jsr clearscreen 980 80ac . 981 80ac ;; 982 80ac 983 80ac .L056 ;; if menu_option_skill = 1 then plotchars 'beginner^skill^chosen' 2 0 0 984 80ac 985 80ac ad 4d 01 LDA menu_option_skill 986 80af c9 01 CMP #1 987 80b1 d0 31 BNE .skipL056 988 80b3 .condpart1 989 80b3 4c cb 80 JMP skipalphadata0 990 80b6 alphadata0 991 80b6 4d .byte.b (alphadata0 1017 80d1 85 43 sta temp2 1018 80d3 1019 80d3 a9 0b lda #11 ; width in two's complement 1020 80d5 09 40 ora #64 ; palette left shifted 5 bits 1021 80d7 85 44 sta temp3 1022 80d9 a9 00 lda #0 1023 80db 85 45 sta temp4 1024 80dd 1025 80dd a9 00 lda #0 1026 80df 1027 80df 85 46 sta temp5 1028 80e1 1029 80e1 20 7a f3 jsr plotcharacters 1030 80e4 .skipL056 1031 80e4 .L057 ;; if menu_option_skill = 2 then plotchars 'standard^skill^chosen' 2 0 0 1032 80e4 1033 80e4 ad 4d 01 LDA menu_option_skill 1034 80e7 c9 02 CMP #2 1035 80e9 d0 31 BNE .skipL057 1036 80eb .condpart2 1037 80eb 4c 03 81 JMP skipalphadata1 1038 80ee alphadata1 1039 80ee 5e .byte.b (alphadata1 1065 8109 85 43 sta temp2 1066 810b 1067 810b a9 0b lda #11 ; width in two's complement 1068 810d 09 40 ora #64 ; palette left shifted 5 bits 1069 810f 85 44 sta temp3 1070 8111 a9 00 lda #0 1071 8113 85 45 sta temp4 1072 8115 1073 8115 a9 00 lda #0 1074 8117 1075 8117 85 46 sta temp5 1076 8119 1077 8119 20 7a f3 jsr plotcharacters 1078 811c .skipL057 1079 811c .L058 ;; if menu_option_skill = 3 then plotchars 'quarter^muncher^skill^chosen' 2 0 0 1080 811c 1081 811c ad 4d 01 LDA menu_option_skill 1082 811f c9 03 CMP #3 1083 8121 d0 38 BNE .skipL058 1084 8123 .condpart3 1085 8123 4c 42 81 JMP skipalphadata2 1086 8126 alphadata2 1087 8126 5c .byte.b (alphadata2 1120 8148 85 43 sta temp2 1121 814a 1122 814a a9 04 lda #4 ; width in two's complement 1123 814c 09 40 ora #64 ; palette left shifted 5 bits 1124 814e 85 44 sta temp3 1125 8150 a9 00 lda #0 1126 8152 85 45 sta temp4 1127 8154 1128 8154 a9 00 lda #0 1129 8156 1130 8156 85 46 sta temp5 1131 8158 1132 8158 20 7a f3 jsr plotcharacters 1133 815b .skipL058 1134 815b .L059 ;; if menu_option_lives = 1 then plotchars 'one^life^chosen' 2 0 1 1135 815b 1136 815b ad 4e 01 LDA menu_option_lives 1137 815e c9 01 CMP #1 1138 8160 d0 2b BNE .skipL059 1139 8162 .condpart4 1140 8162 4c 74 81 JMP skipalphadata3 1141 8165 alphadata3 1142 8165 5a .byte.b (alphadata3 1162 817a 85 43 sta temp2 1163 817c 1164 817c a9 11 lda #17 ; width in two's complement 1165 817e 09 40 ora #64 ; palette left shifted 5 bits 1166 8180 85 44 sta temp3 1167 8182 a9 00 lda #0 1168 8184 85 45 sta temp4 1169 8186 1170 8186 a9 01 lda #1 1171 8188 1172 8188 85 46 sta temp5 1173 818a 1174 818a 20 7a f3 jsr plotcharacters 1175 818d .skipL059 1176 818d .L060 ;; if menu_option_lives = 2 then plotchars 'two^lives^chosen' 2 0 1 1177 818d 1178 818d ad 4e 01 LDA menu_option_lives 1179 8190 c9 02 CMP #2 1180 8192 d0 2c BNE .skipL060 1181 8194 .condpart5 1182 8194 4c a7 81 JMP skipalphadata4 1183 8197 alphadata4 1184 8197 5f .byte.b (alphadata4 1205 81ad 85 43 sta temp2 1206 81af 1207 81af a9 10 lda #16 ; width in two's complement 1208 81b1 09 40 ora #64 ; palette left shifted 5 bits 1209 81b3 85 44 sta temp3 1210 81b5 a9 00 lda #0 1211 81b7 85 45 sta temp4 1212 81b9 1213 81b9 a9 01 lda #1 1214 81bb 1215 81bb 85 46 sta temp5 1216 81bd 1217 81bd 20 7a f3 jsr plotcharacters 1218 81c0 .skipL060 1219 81c0 .L061 ;; if menu_option_lives = 3 then plotchars 'three^lives^chosen' 2 0 1 1220 81c0 1221 81c0 ad 4e 01 LDA menu_option_lives 1222 81c3 c9 03 CMP #3 1223 81c5 d0 2e BNE .skipL061 1224 81c7 .condpart6 1225 81c7 4c dc 81 JMP skipalphadata5 1226 81ca alphadata5 1227 81ca 5f .byte.b (alphadata5 1250 81e2 85 43 sta temp2 1251 81e4 1252 81e4 a9 0e lda #14 ; width in two's complement 1253 81e6 09 40 ora #64 ; palette left shifted 5 bits 1254 81e8 85 44 sta temp3 1255 81ea a9 00 lda #0 1256 81ec 85 45 sta temp4 1257 81ee 1258 81ee a9 01 lda #1 1259 81f0 1260 81f0 85 46 sta temp5 1261 81f2 1262 81f2 20 7a f3 jsr plotcharacters 1263 81f5 .skipL061 1264 81f5 .L062 ;; if menu_option_time = 1 then plotchars 'normal^game^chosen' 2 0 3 1265 81f5 1266 81f5 ad 4f 01 LDA menu_option_time 1267 81f8 c9 01 CMP #1 1268 81fa d0 2e BNE .skipL062 1269 81fc .condpart7 1270 81fc 4c 11 82 JMP skipalphadata6 1271 81ff alphadata6 1272 81ff 59 .byte.b (alphadata6 1295 8217 85 43 sta temp2 1296 8219 1297 8219 a9 0e lda #14 ; width in two's complement 1298 821b 09 40 ora #64 ; palette left shifted 5 bits 1299 821d 85 44 sta temp3 1300 821f a9 00 lda #0 1301 8221 85 45 sta temp4 1302 8223 1303 8223 a9 03 lda #3 1304 8225 1305 8225 85 46 sta temp5 1306 8227 1307 8227 20 7a f3 jsr plotcharacters 1308 822a .skipL062 1309 822a .L063 ;; if menu_option_time = 2 then plotchars 'two^minutes^chosen' 2 0 3 1310 822a 1311 822a ad 4f 01 LDA menu_option_time 1312 822d c9 02 CMP #2 1313 822f d0 2e BNE .skipL063 1314 8231 .condpart8 1315 8231 4c 46 82 JMP skipalphadata7 1316 8234 alphadata7 1317 8234 5f .byte.b (alphadata7 1340 824c 85 43 sta temp2 1341 824e 1342 824e a9 0e lda #14 ; width in two's complement 1343 8250 09 40 ora #64 ; palette left shifted 5 bits 1344 8252 85 44 sta temp3 1345 8254 a9 00 lda #0 1346 8256 85 45 sta temp4 1347 8258 1348 8258 a9 03 lda #3 1349 825a 1350 825a 85 46 sta temp5 1351 825c 1352 825c 20 7a f3 jsr plotcharacters 1353 825f .skipL063 1354 825f .L064 ;; if menu_option_time = 3 then plotchars 'five^minutes^chosen' 2 0 3 1355 825f 1356 825f ad 4f 01 LDA menu_option_time 1357 8262 c9 03 CMP #3 1358 8264 d0 2f BNE .skipL064 1359 8266 .condpart9 1360 8266 4c 7c 82 JMP skipalphadata8 1361 8269 alphadata8 1362 8269 51 .byte.b (alphadata8 1386 8282 85 43 sta temp2 1387 8284 1388 8284 a9 0d lda #13 ; width in two's complement 1389 8286 09 40 ora #64 ; palette left shifted 5 bits 1390 8288 85 44 sta temp3 1391 828a a9 00 lda #0 1392 828c 85 45 sta temp4 1393 828e 1394 828e a9 03 lda #3 1395 8290 1396 8290 85 46 sta temp5 1397 8292 1398 8292 20 7a f3 jsr plotcharacters 1399 8295 .skipL064 1400 8295 .L065 ;; if menu_option_players = 1 then plotchars 'one-player^mode^chosen' 2 0 4 1401 8295 1402 8295 ad 4c 01 LDA menu_option_players 1403 8298 c9 01 CMP #1 1404 829a d0 32 BNE .skipL065 1405 829c .condpart10 1406 829c 4c b5 82 JMP skipalphadata9 1407 829f alphadata9 1408 829f 5a .byte.b (alphadata9 1435 82bb 85 43 sta temp2 1436 82bd 1437 82bd a9 0a lda #10 ; width in two's complement 1438 82bf 09 40 ora #64 ; palette left shifted 5 bits 1439 82c1 85 44 sta temp3 1440 82c3 a9 00 lda #0 1441 82c5 85 45 sta temp4 1442 82c7 1443 82c7 a9 04 lda #4 1444 82c9 1445 82c9 85 46 sta temp5 1446 82cb 1447 82cb 20 7a f3 jsr plotcharacters 1448 82ce .skipL065 1449 82ce .L066 ;; if menu_option_players = 2 then plotchars 'two-player^mode^chosen' 2 0 4 1450 82ce 1451 82ce ad 4c 01 LDA menu_option_players 1452 82d1 c9 02 CMP #2 1453 82d3 d0 32 BNE .skipL066 1454 82d5 .condpart11 1455 82d5 4c ee 82 JMP skipalphadata10 1456 82d8 alphadata10 1457 82d8 5f .byte.b (alphadata10 1484 82f4 85 43 sta temp2 1485 82f6 1486 82f6 a9 0a lda #10 ; width in two's complement 1487 82f8 09 40 ora #64 ; palette left shifted 5 bits 1488 82fa 85 44 sta temp3 1489 82fc a9 00 lda #0 1490 82fe 85 45 sta temp4 1491 8300 1492 8300 a9 04 lda #4 1493 8302 1494 8302 85 46 sta temp5 1495 8304 1496 8304 20 7a f3 jsr plotcharacters 1497 8307 .skipL066 1498 8307 . 1499 8307 ;; 1500 8307 1501 8307 . 1502 8307 ;; 1503 8307 1504 8307 .L067 ;; drawscreen 1505 8307 1506 8307 20 b3 f0 jsr drawscreen 1507 830a .L068 ;; goto mainloop 1508 830a 1509 830a 4c a6 80 jmp .mainloop 1510 830d 1511 830d . 1512 830d ;; 1513 830d 1514 830d .menuscreen 1515 830d ;; menuscreen 1516 830d 1517 830d .L069 ;; menu_xposition = 72 1518 830d 1519 830d a9 48 LDA #72 1520 830f 8d 4a 01 STA menu_xposition 1521 8312 .L070 ;; menu_yposition = 5 1522 8312 1523 8312 a9 05 LDA #5 1524 8314 8d 4b 01 STA menu_yposition 1525 8317 . 1526 8317 ;; 1527 8317 1528 8317 .L071 ;; menu_option_lives = 3 1529 8317 1530 8317 a9 03 LDA #3 1531 8319 8d 4e 01 STA menu_option_lives 1532 831c .L072 ;; menu_option_skill = 1 1533 831c 1534 831c a9 01 LDA #1 1535 831e 8d 4d 01 STA menu_option_skill 1536 8321 .L073 ;; menu_option_time = 1 1537 8321 1538 8321 a9 01 LDA #1 1539 8323 8d 4f 01 STA menu_option_time 1540 8326 .L074 ;; menu_option_players = 1 1541 8326 1542 8326 a9 01 LDA #1 1543 8328 8d 4c 01 STA menu_option_players 1544 832b . 1545 832b ;; 1546 832b 1547 832b .L075 ;; menu_selection_color1 = 7 1548 832b 1549 832b a9 07 LDA #7 1550 832d 8d 50 01 STA menu_selection_color1 1551 8330 .L076 ;; menu_selection_color2 = 2 1552 8330 1553 8330 a9 02 LDA #2 1554 8332 8d 51 01 STA menu_selection_color2 1555 8335 .L077 ;; menu_selection_color3 = 2 1556 8335 1557 8335 a9 02 LDA #2 1558 8337 8d 52 01 STA menu_selection_color3 1559 833a .L078 ;; menu_selection_color4 = 2 1560 833a 1561 833a a9 02 LDA #2 1562 833c 8d 53 01 STA menu_selection_color4 1563 833f .L079 ;; menu_selection_color5 = 2 1564 833f 1565 833f a9 02 LDA #2 1566 8341 8d 54 01 STA menu_selection_color5 1567 8344 . 1568 8344 ;; 1569 8344 1570 8344 .menuscreen_loop 1571 8344 ;; menuscreen_loop 1572 8344 1573 8344 .L080 ;; drawwait 1574 8344 1575 8344 20 d0 f1 jsr drawwait 1576 8347 .L081 ;; clearscreen 1577 8347 1578 8347 20 7f f0 jsr clearscreen 1579 834a .L082 ;; if joy0up then debounce_up = 5 1580 834a 1581 834a a9 10 lda #$10 1582 834c 2c 80 02 bit SWCHA 1583 834f d0 05 BNE .skipL082 1584 8351 .condpart12 1585 8351 a9 05 LDA #5 1586 8353 8d 41 01 STA debounce_up 1587 8356 .skipL082 1588 8356 .L083 ;; if !joy0up && debounce_up = 5 then debounce_up = 6 1589 8356 1590 8356 a9 10 lda #$10 1591 8358 2c 80 02 bit SWCHA 1592 835b f0 0c BEQ .skipL083 1593 835d .condpart13 1594 835d ad 41 01 LDA debounce_up 1595 8360 c9 05 CMP #5 1596 8362 d0 05 BNE .skip13then 1597 8364 .condpart14 1598 8364 a9 06 LDA #6 1599 8366 8d 41 01 STA debounce_up 1600 8369 .skip13then 1601 8369 .skipL083 1602 8369 .L084 ;; if joy0down then debounce_down = 5 1603 8369 1604 8369 a9 20 lda #$20 1605 836b 2c 80 02 bit SWCHA 1606 836e d0 05 BNE .skipL084 1607 8370 .condpart15 1608 8370 a9 05 LDA #5 1609 8372 8d 42 01 STA debounce_down 1610 8375 .skipL084 1611 8375 .L085 ;; if !joy0down && debounce_down = 5 then debounce_down = 6 1612 8375 1613 8375 a9 20 lda #$20 1614 8377 2c 80 02 bit SWCHA 1615 837a f0 0c BEQ .skipL085 1616 837c .condpart16 1617 837c ad 42 01 LDA debounce_down 1618 837f c9 05 CMP #5 1619 8381 d0 05 BNE .skip16then 1620 8383 .condpart17 1621 8383 a9 06 LDA #6 1622 8385 8d 42 01 STA debounce_down 1623 8388 .skip16then 1624 8388 .skipL085 1625 8388 .L086 ;; if joy0left then debounce_left = 5 1626 8388 1627 8388 2c 80 02 bit SWCHA 1628 838b 70 05 BVS .skipL086 1629 838d .condpart18 1630 838d a9 05 LDA #5 1631 838f 8d 43 01 STA debounce_left 1632 8392 .skipL086 1633 8392 .L087 ;; if !joy0left && debounce_left = 5 then debounce_left = 6 1634 8392 1635 8392 2c 80 02 bit SWCHA 1636 8395 50 0c BVC .skipL087 1637 8397 .condpart19 1638 8397 ad 43 01 LDA debounce_left 1639 839a c9 05 CMP #5 1640 839c d0 05 BNE .skip19then 1641 839e .condpart20 1642 839e a9 06 LDA #6 1643 83a0 8d 43 01 STA debounce_left 1644 83a3 .skip19then 1645 83a3 .skipL087 1646 83a3 .L088 ;; if joy0right then debounce_right = 5 1647 83a3 1648 83a3 2c 80 02 bit SWCHA 1649 83a6 30 05 BMI .skipL088 1650 83a8 .condpart21 1651 83a8 a9 05 LDA #5 1652 83aa 8d 44 01 STA debounce_right 1653 83ad .skipL088 1654 83ad .L089 ;; if !joy0right && debounce_right = 5 then debounce_right = 6 1655 83ad 1656 83ad 2c 80 02 bit SWCHA 1657 83b0 10 0c BPL .skipL089 1658 83b2 .condpart22 1659 83b2 ad 44 01 LDA debounce_right 1660 83b5 c9 05 CMP #5 1661 83b7 d0 05 BNE .skip22then 1662 83b9 .condpart23 1663 83b9 a9 06 LDA #6 1664 83bb 8d 44 01 STA debounce_right 1665 83be .skip22then 1666 83be .skipL089 1667 83be . 1668 83be ;; 1669 83be 1670 83be . 1671 83be ;; 1672 83be 1673 83be .L090 ;; plotsprite heofonfir_logo_h 0 9 2 1674 83be 1675 83be a9 10 lda #heofonfir_logo_h 1679 83c4 85 43 sta temp2 1680 83c6 1681 83c6 a9 1c lda #(0|heofonfir_logo_h_width_twoscompliment) 1682 83c8 85 44 sta temp3 1683 83ca 1684 83ca a9 09 lda #9 1685 83cc 85 45 sta temp4 1686 83ce 1687 83ce a9 02 lda #2 1688 83d0 1689 83d0 85 46 sta temp5 1690 83d2 1691 83d2 a9 40 lda #(heofonfir_logo_h_mode|%01000000) 1692 83d4 85 47 sta temp6 1693 83d6 1694 83d6 20 c9 f2 jsr plotsprite 1695 83d9 ; +tall sprite replot 1696 83d9 18 clc 1697 83da a5 42 lda temp1 1698 83dc 69 04 adc #heofonfir_logo_h_width 1699 83de 85 42 sta temp1 1700 83e0 a5 46 lda temp5 1701 83e2 69 10 adc #WZONEHEIGHT 1702 83e4 85 46 sta temp5 1703 83e6 20 c9 f2 jsr plotsprite 1704 83e9 .L091 ;; plotsprite heofonfir_logo_e 0 26 2 1705 83e9 1706 83e9 a9 00 lda #heofonfir_logo_e 1710 83ef 85 43 sta temp2 1711 83f1 1712 83f1 a9 1c lda #(0|heofonfir_logo_e_width_twoscompliment) 1713 83f3 85 44 sta temp3 1714 83f5 1715 83f5 a9 1a lda #26 1716 83f7 85 45 sta temp4 1717 83f9 1718 83f9 a9 02 lda #2 1719 83fb 1720 83fb 85 46 sta temp5 1721 83fd 1722 83fd a9 40 lda #(heofonfir_logo_e_mode|%01000000) 1723 83ff 85 47 sta temp6 1724 8401 1725 8401 20 c9 f2 jsr plotsprite 1726 8404 ; +tall sprite replot 1727 8404 18 clc 1728 8405 a5 42 lda temp1 1729 8407 69 04 adc #heofonfir_logo_e_width 1730 8409 85 42 sta temp1 1731 840b a5 46 lda temp5 1732 840d 69 10 adc #WZONEHEIGHT 1733 840f 85 46 sta temp5 1734 8411 20 c9 f2 jsr plotsprite 1735 8414 .L092 ;; plotsprite heofonfir_logo_o 0 42 2 1736 8414 1737 8414 a9 28 lda #heofonfir_logo_o 1741 841a 85 43 sta temp2 1742 841c 1743 841c a9 1c lda #(0|heofonfir_logo_o_width_twoscompliment) 1744 841e 85 44 sta temp3 1745 8420 1746 8420 a9 2a lda #42 1747 8422 85 45 sta temp4 1748 8424 1749 8424 a9 02 lda #2 1750 8426 1751 8426 85 46 sta temp5 1752 8428 1753 8428 a9 40 lda #(heofonfir_logo_o_mode|%01000000) 1754 842a 85 47 sta temp6 1755 842c 1756 842c 20 c9 f2 jsr plotsprite 1757 842f ; +tall sprite replot 1758 842f 18 clc 1759 8430 a5 42 lda temp1 1760 8432 69 04 adc #heofonfir_logo_o_width 1761 8434 85 42 sta temp1 1762 8436 a5 46 lda temp5 1763 8438 69 10 adc #WZONEHEIGHT 1764 843a 85 46 sta temp5 1765 843c 20 c9 f2 jsr plotsprite 1766 843f .L093 ;; plotsprite heofonfir_logo_f 0 58 2 1767 843f 1768 843f a9 08 lda #heofonfir_logo_f 1772 8445 85 43 sta temp2 1773 8447 1774 8447 a9 1c lda #(0|heofonfir_logo_f_width_twoscompliment) 1775 8449 85 44 sta temp3 1776 844b 1777 844b a9 3a lda #58 1778 844d 85 45 sta temp4 1779 844f 1780 844f a9 02 lda #2 1781 8451 1782 8451 85 46 sta temp5 1783 8453 1784 8453 a9 40 lda #(heofonfir_logo_f_mode|%01000000) 1785 8455 85 47 sta temp6 1786 8457 1787 8457 20 c9 f2 jsr plotsprite 1788 845a ; +tall sprite replot 1789 845a 18 clc 1790 845b a5 42 lda temp1 1791 845d 69 04 adc #heofonfir_logo_f_width 1792 845f 85 42 sta temp1 1793 8461 a5 46 lda temp5 1794 8463 69 10 adc #WZONEHEIGHT 1795 8465 85 46 sta temp5 1796 8467 20 c9 f2 jsr plotsprite 1797 846a .L094 ;; plotsprite heofonfir_logo_o 0 74 2 1798 846a 1799 846a a9 28 lda #heofonfir_logo_o 1803 8470 85 43 sta temp2 1804 8472 1805 8472 a9 1c lda #(0|heofonfir_logo_o_width_twoscompliment) 1806 8474 85 44 sta temp3 1807 8476 1808 8476 a9 4a lda #74 1809 8478 85 45 sta temp4 1810 847a 1811 847a a9 02 lda #2 1812 847c 1813 847c 85 46 sta temp5 1814 847e 1815 847e a9 40 lda #(heofonfir_logo_o_mode|%01000000) 1816 8480 85 47 sta temp6 1817 8482 1818 8482 20 c9 f2 jsr plotsprite 1819 8485 ; +tall sprite replot 1820 8485 18 clc 1821 8486 a5 42 lda temp1 1822 8488 69 04 adc #heofonfir_logo_o_width 1823 848a 85 42 sta temp1 1824 848c a5 46 lda temp5 1825 848e 69 10 adc #WZONEHEIGHT 1826 8490 85 46 sta temp5 1827 8492 20 c9 f2 jsr plotsprite 1828 8495 .L095 ;; plotsprite heofonfir_logo_n 0 90 2 1829 8495 1830 8495 a9 20 lda #heofonfir_logo_n 1834 849b 85 43 sta temp2 1835 849d 1836 849d a9 1c lda #(0|heofonfir_logo_n_width_twoscompliment) 1837 849f 85 44 sta temp3 1838 84a1 1839 84a1 a9 5a lda #90 1840 84a3 85 45 sta temp4 1841 84a5 1842 84a5 a9 02 lda #2 1843 84a7 1844 84a7 85 46 sta temp5 1845 84a9 1846 84a9 a9 40 lda #(heofonfir_logo_n_mode|%01000000) 1847 84ab 85 47 sta temp6 1848 84ad 1849 84ad 20 c9 f2 jsr plotsprite 1850 84b0 ; +tall sprite replot 1851 84b0 18 clc 1852 84b1 a5 42 lda temp1 1853 84b3 69 04 adc #heofonfir_logo_n_width 1854 84b5 85 42 sta temp1 1855 84b7 a5 46 lda temp5 1856 84b9 69 10 adc #WZONEHEIGHT 1857 84bb 85 46 sta temp5 1858 84bd 20 c9 f2 jsr plotsprite 1859 84c0 .L096 ;; plotsprite heofonfir_logo_f 0 107 2 1860 84c0 1861 84c0 a9 08 lda #heofonfir_logo_f 1865 84c6 85 43 sta temp2 1866 84c8 1867 84c8 a9 1c lda #(0|heofonfir_logo_f_width_twoscompliment) 1868 84ca 85 44 sta temp3 1869 84cc 1870 84cc a9 6b lda #107 1871 84ce 85 45 sta temp4 1872 84d0 1873 84d0 a9 02 lda #2 1874 84d2 1875 84d2 85 46 sta temp5 1876 84d4 1877 84d4 a9 40 lda #(heofonfir_logo_f_mode|%01000000) 1878 84d6 85 47 sta temp6 1879 84d8 1880 84d8 20 c9 f2 jsr plotsprite 1881 84db ; +tall sprite replot 1882 84db 18 clc 1883 84dc a5 42 lda temp1 1884 84de 69 04 adc #heofonfir_logo_f_width 1885 84e0 85 42 sta temp1 1886 84e2 a5 46 lda temp5 1887 84e4 69 10 adc #WZONEHEIGHT 1888 84e6 85 46 sta temp5 1889 84e8 20 c9 f2 jsr plotsprite 1890 84eb .L097 ;; plotsprite heofonfir_logo_i 0 121 2 1891 84eb 1892 84eb a9 18 lda #heofonfir_logo_i 1896 84f1 85 43 sta temp2 1897 84f3 1898 84f3 a9 1c lda #(0|heofonfir_logo_i_width_twoscompliment) 1899 84f5 85 44 sta temp3 1900 84f7 1901 84f7 a9 79 lda #121 1902 84f9 85 45 sta temp4 1903 84fb 1904 84fb a9 02 lda #2 1905 84fd 1906 84fd 85 46 sta temp5 1907 84ff 1908 84ff a9 40 lda #(heofonfir_logo_i_mode|%01000000) 1909 8501 85 47 sta temp6 1910 8503 1911 8503 20 c9 f2 jsr plotsprite 1912 8506 ; +tall sprite replot 1913 8506 18 clc 1914 8507 a5 42 lda temp1 1915 8509 69 04 adc #heofonfir_logo_i_width 1916 850b 85 42 sta temp1 1917 850d a5 46 lda temp5 1918 850f 69 10 adc #WZONEHEIGHT 1919 8511 85 46 sta temp5 1920 8513 20 c9 f2 jsr plotsprite 1921 8516 .L098 ;; plotsprite heofonfir_logo_r 0 136 2 1922 8516 1923 8516 a9 30 lda #heofonfir_logo_r 1927 851c 85 43 sta temp2 1928 851e 1929 851e a9 1c lda #(0|heofonfir_logo_r_width_twoscompliment) 1930 8520 85 44 sta temp3 1931 8522 1932 8522 a9 88 lda #136 1933 8524 85 45 sta temp4 1934 8526 1935 8526 a9 02 lda #2 1936 8528 1937 8528 85 46 sta temp5 1938 852a 1939 852a a9 40 lda #(heofonfir_logo_r_mode|%01000000) 1940 852c 85 47 sta temp6 1941 852e 1942 852e 20 c9 f2 jsr plotsprite 1943 8531 ; +tall sprite replot 1944 8531 18 clc 1945 8532 a5 42 lda temp1 1946 8534 69 04 adc #heofonfir_logo_r_width 1947 8536 85 42 sta temp1 1948 8538 a5 46 lda temp5 1949 853a 69 10 adc #WZONEHEIGHT 1950 853c 85 46 sta temp5 1951 853e 20 c9 f2 jsr plotsprite 1952 8541 . 1953 8541 ;; 1954 8541 1955 8541 .L099 ;; plotchars 'game^setup' 0 26 4 1956 8541 1957 8541 4c 4e 85 JMP skipalphadata11 1958 8544 alphadata11 1959 8544 52 .byte.b (alphadata11 1974 8554 85 43 sta temp2 1975 8556 1976 8556 a9 16 lda #22 ; width in two's complement 1977 8558 09 00 ora #0 ; palette left shifted 5 bits 1978 855a 85 44 sta temp3 1979 855c a9 1a lda #26 1980 855e 85 45 sta temp4 1981 8560 1982 8560 a9 04 lda #4 1983 8562 1984 8562 85 46 sta temp5 1985 8564 1986 8564 20 7a f3 jsr plotcharacters 1987 8567 . 1988 8567 ;; 1989 8567 1990 8567 .L0100 ;; if menu_yposition = 5 then menu_selection_color1 = 7 : menu_selection_color2 = 2 : menu_selection_color3 = 2 : menu_selection_color4 = 2 : menu_selection_color5 = 2 1991 8567 1992 8567 ad 4b 01 LDA menu_yposition 1993 856a c9 05 CMP #5 1994 856c d0 13 BNE .skipL0100 1995 856e .condpart24 1996 856e a9 07 LDA #7 1997 8570 8d 50 01 STA menu_selection_color1 1998 8573 a9 02 LDA #2 1999 8575 8d 51 01 STA menu_selection_color2 2000 8578 8d 52 01 STA menu_selection_color3 2001 857b 8d 53 01 STA menu_selection_color4 2002 857e 8d 54 01 STA menu_selection_color5 2003 8581 .skipL0100 2004 8581 .L0101 ;; if menu_yposition = 6 then menu_selection_color1 = 2 : menu_selection_color2 = 7 : menu_selection_color3 = 2 : menu_selection_color4 = 2 : menu_selection_color5 = 2 2005 8581 2006 8581 ad 4b 01 LDA menu_yposition 2007 8584 c9 06 CMP #6 2008 8586 d0 15 BNE .skipL0101 2009 8588 .condpart25 2010 8588 a9 02 LDA #2 2011 858a 8d 50 01 STA menu_selection_color1 2012 858d a9 07 LDA #7 2013 858f 8d 51 01 STA menu_selection_color2 2014 8592 a9 02 LDA #2 2015 8594 8d 52 01 STA menu_selection_color3 2016 8597 8d 53 01 STA menu_selection_color4 2017 859a 8d 54 01 STA menu_selection_color5 2018 859d .skipL0101 2019 859d .L0102 ;; if menu_yposition = 7 then menu_selection_color1 = 2 : menu_selection_color2 = 2 : menu_selection_color3 = 7 : menu_selection_color4 = 2 : menu_selection_color5 = 2 2020 859d 2021 859d ad 4b 01 LDA menu_yposition 2022 85a0 c9 07 CMP #7 2023 85a2 d0 15 BNE .skipL0102 2024 85a4 .condpart26 2025 85a4 a9 02 LDA #2 2026 85a6 8d 50 01 STA menu_selection_color1 2027 85a9 8d 51 01 STA menu_selection_color2 2028 85ac a9 07 LDA #7 2029 85ae 8d 52 01 STA menu_selection_color3 2030 85b1 a9 02 LDA #2 2031 85b3 8d 53 01 STA menu_selection_color4 2032 85b6 8d 54 01 STA menu_selection_color5 2033 85b9 .skipL0102 2034 85b9 .L0103 ;; if menu_yposition = 8 then menu_selection_color1 = 2 : menu_selection_color2 = 2 : menu_selection_color3 = 2 : menu_selection_color4 = 7 : menu_selection_color5 = 2 2035 85b9 2036 85b9 ad 4b 01 LDA menu_yposition 2037 85bc c9 08 CMP #8 2038 85be d0 15 BNE .skipL0103 2039 85c0 .condpart27 2040 85c0 a9 02 LDA #2 2041 85c2 8d 50 01 STA menu_selection_color1 2042 85c5 8d 51 01 STA menu_selection_color2 2043 85c8 8d 52 01 STA menu_selection_color3 2044 85cb a9 07 LDA #7 2045 85cd 8d 53 01 STA menu_selection_color4 2046 85d0 a9 02 LDA #2 2047 85d2 8d 54 01 STA menu_selection_color5 2048 85d5 .skipL0103 2049 85d5 .L0104 ;; if menu_yposition = 9 then menu_selection_color1 = 2 : menu_selection_color2 = 2 : menu_selection_color3 = 2 : menu_selection_color4 = 2 : menu_selection_color5 = 7 2050 85d5 2051 85d5 ad 4b 01 LDA menu_yposition 2052 85d8 c9 09 CMP #9 2053 85da d0 13 BNE .skipL0104 2054 85dc .condpart28 2055 85dc a9 02 LDA #2 2056 85de 8d 50 01 STA menu_selection_color1 2057 85e1 8d 51 01 STA menu_selection_color2 2058 85e4 8d 52 01 STA menu_selection_color3 2059 85e7 8d 53 01 STA menu_selection_color4 2060 85ea a9 07 LDA #7 2061 85ec 8d 54 01 STA menu_selection_color5 2062 85ef .skipL0104 2063 85ef . 2064 85ef ;; 2065 85ef 2066 85ef .L0105 ;; plotchars 'skill:' 0 28 5 2067 85ef 2068 85ef 4c f8 85 JMP skipalphadata12 2069 85f2 alphadata12 2070 85f2 5e .byte.b (alphadata12 2081 85fe 85 43 sta temp2 2082 8600 2083 8600 a9 1a lda #26 ; width in two's complement 2084 8602 09 00 ora #0 ; palette left shifted 5 bits 2085 8604 85 44 sta temp3 2086 8606 a9 1c lda #28 2087 8608 85 45 sta temp4 2088 860a 2089 860a a9 05 lda #5 2090 860c 2091 860c 85 46 sta temp5 2092 860e 2093 860e 20 7a f3 jsr plotcharacters 2094 8611 .L0106 ;; plotchars 'lives:' 0 28 6 2095 8611 2096 8611 4c 1a 86 JMP skipalphadata13 2097 8614 alphadata13 2098 8614 57 .byte.b (alphadata13 2109 8620 85 43 sta temp2 2110 8622 2111 8622 a9 1a lda #26 ; width in two's complement 2112 8624 09 00 ora #0 ; palette left shifted 5 bits 2113 8626 85 44 sta temp3 2114 8628 a9 1c lda #28 2115 862a 85 45 sta temp4 2116 862c 2117 862c a9 06 lda #6 2118 862e 2119 862e 85 46 sta temp5 2120 8630 2121 8630 20 7a f3 jsr plotcharacters 2122 8633 .L0107 ;; plotchars 'time^trial:' 0 28 8 2123 8633 2124 8633 4c 41 86 JMP skipalphadata14 2125 8636 alphadata14 2126 8636 5f .byte.b (alphadata14 2142 8647 85 43 sta temp2 2143 8649 2144 8649 a9 15 lda #21 ; width in two's complement 2145 864b 09 00 ora #0 ; palette left shifted 5 bits 2146 864d 85 44 sta temp3 2147 864f a9 1c lda #28 2148 8651 85 45 sta temp4 2149 8653 2150 8653 a9 08 lda #8 2151 8655 2152 8655 85 46 sta temp5 2153 8657 2154 8657 20 7a f3 jsr plotcharacters 2155 865a .L0108 ;; plotchars 'players:' 0 28 9 2156 865a 2157 865a 4c 65 86 JMP skipalphadata15 2158 865d alphadata15 2159 865d 5b .byte.b (alphadata15 2172 866b 85 43 sta temp2 2173 866d 2174 866d a9 18 lda #24 ; width in two's complement 2175 866f 09 00 ora #0 ; palette left shifted 5 bits 2176 8671 85 44 sta temp3 2177 8673 a9 1c lda #28 2178 8675 85 45 sta temp4 2179 8677 2180 8677 a9 09 lda #9 2181 8679 2182 8679 85 46 sta temp5 2183 867b 2184 867b 20 7a f3 jsr plotcharacters 2185 867e .L0109 ;; plotchars 'start^game' 0 28 10 2186 867e 2187 867e 4c 8b 86 JMP skipalphadata16 2188 8681 alphadata16 2189 8681 5e .byte.b (alphadata16 2204 8691 85 43 sta temp2 2205 8693 2206 8693 a9 16 lda #22 ; width in two's complement 2207 8695 09 00 ora #0 ; palette left shifted 5 bits 2208 8697 85 44 sta temp3 2209 8699 a9 1c lda #28 2210 869b 85 45 sta temp4 2211 869d 2212 869d a9 0a lda #10 2213 869f 2214 869f 85 46 sta temp5 2215 86a1 2216 86a1 20 7a f3 jsr plotcharacters 2217 86a4 . 2218 86a4 ;; 2219 86a4 2220 86a4 . 2221 86a4 ;; 2222 86a4 2223 86a4 .L0110 ;; if debounce_down = 6 && menu_yposition = 5 then debounce_down = 0 : menu_yposition = 6 2224 86a4 2225 86a4 ad 42 01 LDA debounce_down 2226 86a7 c9 06 CMP #6 2227 86a9 d0 11 BNE .skipL0110 2228 86ab .condpart29 2229 86ab ad 4b 01 LDA menu_yposition 2230 86ae c9 05 CMP #5 2231 86b0 d0 0a BNE .skip29then 2232 86b2 .condpart30 2233 86b2 a9 00 LDA #0 2234 86b4 8d 42 01 STA debounce_down 2235 86b7 a9 06 LDA #6 2236 86b9 8d 4b 01 STA menu_yposition 2237 86bc .skip29then 2238 86bc .skipL0110 2239 86bc .L0111 ;; if debounce_down = 6 && menu_yposition = 6 then debounce_down = 0 : menu_yposition = 7 2240 86bc 2241 86bc ad 42 01 LDA debounce_down 2242 86bf c9 06 CMP #6 2243 86c1 d0 11 BNE .skipL0111 2244 86c3 .condpart31 2245 86c3 ad 4b 01 LDA menu_yposition 2246 86c6 c9 06 CMP #6 2247 86c8 d0 0a BNE .skip31then 2248 86ca .condpart32 2249 86ca a9 00 LDA #0 2250 86cc 8d 42 01 STA debounce_down 2251 86cf a9 07 LDA #7 2252 86d1 8d 4b 01 STA menu_yposition 2253 86d4 .skip31then 2254 86d4 .skipL0111 2255 86d4 .L0112 ;; if debounce_down = 6 && menu_yposition = 7 then debounce_down = 0 : menu_yposition = 8 2256 86d4 2257 86d4 ad 42 01 LDA debounce_down 2258 86d7 c9 06 CMP #6 2259 86d9 d0 11 BNE .skipL0112 2260 86db .condpart33 2261 86db ad 4b 01 LDA menu_yposition 2262 86de c9 07 CMP #7 2263 86e0 d0 0a BNE .skip33then 2264 86e2 .condpart34 2265 86e2 a9 00 LDA #0 2266 86e4 8d 42 01 STA debounce_down 2267 86e7 a9 08 LDA #8 2268 86e9 8d 4b 01 STA menu_yposition 2269 86ec .skip33then 2270 86ec .skipL0112 2271 86ec .L0113 ;; if debounce_down = 6 && menu_yposition = 8 then debounce_down = 0 : menu_yposition = 9 2272 86ec 2273 86ec ad 42 01 LDA debounce_down 2274 86ef c9 06 CMP #6 2275 86f1 d0 11 BNE .skipL0113 2276 86f3 .condpart35 2277 86f3 ad 4b 01 LDA menu_yposition 2278 86f6 c9 08 CMP #8 2279 86f8 d0 0a BNE .skip35then 2280 86fa .condpart36 2281 86fa a9 00 LDA #0 2282 86fc 8d 42 01 STA debounce_down 2283 86ff a9 09 LDA #9 2284 8701 8d 4b 01 STA menu_yposition 2285 8704 .skip35then 2286 8704 .skipL0113 2287 8704 .L0114 ;; if debounce_down = 6 && menu_yposition = 9 then debounce_down = 0 : menu_yposition = 9 2288 8704 2289 8704 ad 42 01 LDA debounce_down 2290 8707 c9 06 CMP #6 2291 8709 d0 11 BNE .skipL0114 2292 870b .condpart37 2293 870b ad 4b 01 LDA menu_yposition 2294 870e c9 09 CMP #9 2295 8710 d0 0a BNE .skip37then 2296 8712 .condpart38 2297 8712 a9 00 LDA #0 2298 8714 8d 42 01 STA debounce_down 2299 8717 a9 09 LDA #9 2300 8719 8d 4b 01 STA menu_yposition 2301 871c .skip37then 2302 871c .skipL0114 2303 871c . 2304 871c ;; 2305 871c 2306 871c .L0115 ;; if debounce_up = 6 && menu_yposition = 8 then debounce_up = 0 : menu_yposition = 9 2307 871c 2308 871c ad 41 01 LDA debounce_up 2309 871f c9 06 CMP #6 2310 8721 d0 11 BNE .skipL0115 2311 8723 .condpart39 2312 8723 ad 4b 01 LDA menu_yposition 2313 8726 c9 08 CMP #8 2314 8728 d0 0a BNE .skip39then 2315 872a .condpart40 2316 872a a9 00 LDA #0 2317 872c 8d 41 01 STA debounce_up 2318 872f a9 09 LDA #9 2319 8731 8d 4b 01 STA menu_yposition 2320 8734 .skip39then 2321 8734 .skipL0115 2322 8734 .L0116 ;; if debounce_up = 6 && menu_yposition = 7 then debounce_up = 0 : menu_yposition = 8 2323 8734 2324 8734 ad 41 01 LDA debounce_up 2325 8737 c9 06 CMP #6 2326 8739 d0 11 BNE .skipL0116 2327 873b .condpart41 2328 873b ad 4b 01 LDA menu_yposition 2329 873e c9 07 CMP #7 2330 8740 d0 0a BNE .skip41then 2331 8742 .condpart42 2332 8742 a9 00 LDA #0 2333 8744 8d 41 01 STA debounce_up 2334 8747 a9 08 LDA #8 2335 8749 8d 4b 01 STA menu_yposition 2336 874c .skip41then 2337 874c .skipL0116 2338 874c .L0117 ;; if debounce_up = 6 && menu_yposition = 6 then debounce_up = 0 : menu_yposition = 7 2339 874c 2340 874c ad 41 01 LDA debounce_up 2341 874f c9 06 CMP #6 2342 8751 d0 11 BNE .skipL0117 2343 8753 .condpart43 2344 8753 ad 4b 01 LDA menu_yposition 2345 8756 c9 06 CMP #6 2346 8758 d0 0a BNE .skip43then 2347 875a .condpart44 2348 875a a9 00 LDA #0 2349 875c 8d 41 01 STA debounce_up 2350 875f a9 07 LDA #7 2351 8761 8d 4b 01 STA menu_yposition 2352 8764 .skip43then 2353 8764 .skipL0117 2354 8764 .L0118 ;; if debounce_up = 6 && menu_yposition = 5 then debounce_up = 0 : menu_yposition = 6 2355 8764 2356 8764 ad 41 01 LDA debounce_up 2357 8767 c9 06 CMP #6 2358 8769 d0 11 BNE .skipL0118 2359 876b .condpart45 2360 876b ad 4b 01 LDA menu_yposition 2361 876e c9 05 CMP #5 2362 8770 d0 0a BNE .skip45then 2363 8772 .condpart46 2364 8772 a9 00 LDA #0 2365 8774 8d 41 01 STA debounce_up 2366 8777 a9 06 LDA #6 2367 8779 8d 4b 01 STA menu_yposition 2368 877c .skip45then 2369 877c .skipL0118 2370 877c .L0119 ;; if debounce_up = 6 && menu_yposition = 5 then debounce_up = 0 : menu_yposition = 5 2371 877c 2372 877c ad 41 01 LDA debounce_up 2373 877f c9 06 CMP #6 2374 8781 d0 11 BNE .skipL0119 2375 8783 .condpart47 2376 8783 ad 4b 01 LDA menu_yposition 2377 8786 c9 05 CMP #5 2378 8788 d0 0a BNE .skip47then 2379 878a .condpart48 2380 878a a9 00 LDA #0 2381 878c 8d 41 01 STA debounce_up 2382 878f a9 05 LDA #5 2383 8791 8d 4b 01 STA menu_yposition 2384 8794 .skip47then 2385 8794 .skipL0119 2386 8794 . 2387 8794 ;; 2388 8794 2389 8794 .L0120 ;; if menu_yposition = 5 && debounce_right = 6 && menu_option_skill = 1 then menu_option_skill = 2 : debounce_right = 0 : playsfx sfx_bling 2390 8794 2391 8794 ad 4b 01 LDA menu_yposition 2392 8797 c9 05 CMP #5 2393 8799 d0 31 BNE .skipL0120 2394 879b .condpart49 2395 879b ad 44 01 LDA debounce_right 2396 879e c9 06 CMP #6 2397 87a0 d0 2a BNE .skip49then 2398 87a2 .condpart50 2399 87a2 ad 4d 01 LDA menu_option_skill 2400 87a5 c9 01 CMP #1 2401 87a7 d0 23 BNE .skip50then 2402 87a9 .condpart51 2403 87a9 a9 02 LDA #2 2404 87ab 8d 4d 01 STA menu_option_skill 2405 87ae a9 00 LDA #0 2406 87b0 8d 44 01 STA debounce_right 2407 87b3 ifnconst NOTIALOCKMUTE 2408 87b3 a9 01 lda #1 2409 87b5 85 de sta sfxschedulelock 2410 87b7 a9 77 lda #sfx_bling 2413 87bd 85 e1 sta sfxinstrumenthi 2414 87bf a9 00 lda #0 2415 87c1 85 e2 sta sfxpitchoffset ; no pitch modification 2416 87c3 85 e3 sta sfxnoteindex ; not a musical note 2417 87c5 20 81 f2 jsr schedulesfx 2418 87c8 a9 00 lda #0 2419 87ca 85 de sta sfxschedulelock 2420 87cc endif ; NOTIALOCKMUTE 2421 87cc .skip50then 2422 87cc .skip49then 2423 87cc .skipL0120 2424 87cc .L0121 ;; if menu_yposition = 5 && debounce_right = 6 && menu_option_skill = 2 then menu_option_skill = 3 : debounce_right = 0 : playsfx sfx_bling 2425 87cc 2426 87cc ad 4b 01 LDA menu_yposition 2427 87cf c9 05 CMP #5 2428 87d1 d0 31 BNE .skipL0121 2429 87d3 .condpart52 2430 87d3 ad 44 01 LDA debounce_right 2431 87d6 c9 06 CMP #6 2432 87d8 d0 2a BNE .skip52then 2433 87da .condpart53 2434 87da ad 4d 01 LDA menu_option_skill 2435 87dd c9 02 CMP #2 2436 87df d0 23 BNE .skip53then 2437 87e1 .condpart54 2438 87e1 a9 03 LDA #3 2439 87e3 8d 4d 01 STA menu_option_skill 2440 87e6 a9 00 LDA #0 2441 87e8 8d 44 01 STA debounce_right 2442 87eb ifnconst NOTIALOCKMUTE 2443 87eb a9 01 lda #1 2444 87ed 85 de sta sfxschedulelock 2445 87ef a9 77 lda #sfx_bling 2448 87f5 85 e1 sta sfxinstrumenthi 2449 87f7 a9 00 lda #0 2450 87f9 85 e2 sta sfxpitchoffset ; no pitch modification 2451 87fb 85 e3 sta sfxnoteindex ; not a musical note 2452 87fd 20 81 f2 jsr schedulesfx 2453 8800 a9 00 lda #0 2454 8802 85 de sta sfxschedulelock 2455 8804 endif ; NOTIALOCKMUTE 2456 8804 .skip53then 2457 8804 .skip52then 2458 8804 .skipL0121 2459 8804 .L0122 ;; if menu_yposition = 5 && debounce_right = 6 && menu_option_skill = 3 then menu_option_skill = 1 : debounce_right = 0 : playsfx sfx_bling 2460 8804 2461 8804 ad 4b 01 LDA menu_yposition 2462 8807 c9 05 CMP #5 2463 8809 d0 31 BNE .skipL0122 2464 880b .condpart55 2465 880b ad 44 01 LDA debounce_right 2466 880e c9 06 CMP #6 2467 8810 d0 2a BNE .skip55then 2468 8812 .condpart56 2469 8812 ad 4d 01 LDA menu_option_skill 2470 8815 c9 03 CMP #3 2471 8817 d0 23 BNE .skip56then 2472 8819 .condpart57 2473 8819 a9 01 LDA #1 2474 881b 8d 4d 01 STA menu_option_skill 2475 881e a9 00 LDA #0 2476 8820 8d 44 01 STA debounce_right 2477 8823 ifnconst NOTIALOCKMUTE 2478 8823 a9 01 lda #1 2479 8825 85 de sta sfxschedulelock 2480 8827 a9 77 lda #sfx_bling 2483 882d 85 e1 sta sfxinstrumenthi 2484 882f a9 00 lda #0 2485 8831 85 e2 sta sfxpitchoffset ; no pitch modification 2486 8833 85 e3 sta sfxnoteindex ; not a musical note 2487 8835 20 81 f2 jsr schedulesfx 2488 8838 a9 00 lda #0 2489 883a 85 de sta sfxschedulelock 2490 883c endif ; NOTIALOCKMUTE 2491 883c .skip56then 2492 883c .skip55then 2493 883c .skipL0122 2494 883c .L0123 ;; if menu_yposition = 5 && debounce_left = 6 && menu_option_skill = 1 then menu_option_skill = 3 : debounce_left = 0 : playsfx sfx_bling 2495 883c 2496 883c ad 4b 01 LDA menu_yposition 2497 883f c9 05 CMP #5 2498 8841 d0 31 BNE .skipL0123 2499 8843 .condpart58 2500 8843 ad 43 01 LDA debounce_left 2501 8846 c9 06 CMP #6 2502 8848 d0 2a BNE .skip58then 2503 884a .condpart59 2504 884a ad 4d 01 LDA menu_option_skill 2505 884d c9 01 CMP #1 2506 884f d0 23 BNE .skip59then 2507 8851 .condpart60 2508 8851 a9 03 LDA #3 2509 8853 8d 4d 01 STA menu_option_skill 2510 8856 a9 00 LDA #0 2511 8858 8d 43 01 STA debounce_left 2512 885b ifnconst NOTIALOCKMUTE 2513 885b a9 01 lda #1 2514 885d 85 de sta sfxschedulelock 2515 885f a9 77 lda #sfx_bling 2518 8865 85 e1 sta sfxinstrumenthi 2519 8867 a9 00 lda #0 2520 8869 85 e2 sta sfxpitchoffset ; no pitch modification 2521 886b 85 e3 sta sfxnoteindex ; not a musical note 2522 886d 20 81 f2 jsr schedulesfx 2523 8870 a9 00 lda #0 2524 8872 85 de sta sfxschedulelock 2525 8874 endif ; NOTIALOCKMUTE 2526 8874 .skip59then 2527 8874 .skip58then 2528 8874 .skipL0123 2529 8874 .L0124 ;; if menu_yposition = 5 && debounce_left = 6 && menu_option_skill = 2 then menu_option_skill = 1 : debounce_left = 0 : playsfx sfx_bling 2530 8874 2531 8874 ad 4b 01 LDA menu_yposition 2532 8877 c9 05 CMP #5 2533 8879 d0 31 BNE .skipL0124 2534 887b .condpart61 2535 887b ad 43 01 LDA debounce_left 2536 887e c9 06 CMP #6 2537 8880 d0 2a BNE .skip61then 2538 8882 .condpart62 2539 8882 ad 4d 01 LDA menu_option_skill 2540 8885 c9 02 CMP #2 2541 8887 d0 23 BNE .skip62then 2542 8889 .condpart63 2543 8889 a9 01 LDA #1 2544 888b 8d 4d 01 STA menu_option_skill 2545 888e a9 00 LDA #0 2546 8890 8d 43 01 STA debounce_left 2547 8893 ifnconst NOTIALOCKMUTE 2548 8893 a9 01 lda #1 2549 8895 85 de sta sfxschedulelock 2550 8897 a9 77 lda #sfx_bling 2553 889d 85 e1 sta sfxinstrumenthi 2554 889f a9 00 lda #0 2555 88a1 85 e2 sta sfxpitchoffset ; no pitch modification 2556 88a3 85 e3 sta sfxnoteindex ; not a musical note 2557 88a5 20 81 f2 jsr schedulesfx 2558 88a8 a9 00 lda #0 2559 88aa 85 de sta sfxschedulelock 2560 88ac endif ; NOTIALOCKMUTE 2561 88ac .skip62then 2562 88ac .skip61then 2563 88ac .skipL0124 2564 88ac .L0125 ;; if menu_yposition = 5 && debounce_left = 6 && menu_option_skill = 3 then menu_option_skill = 2 : debounce_left = 0 : playsfx sfx_bling 2565 88ac 2566 88ac ad 4b 01 LDA menu_yposition 2567 88af c9 05 CMP #5 2568 88b1 d0 31 BNE .skipL0125 2569 88b3 .condpart64 2570 88b3 ad 43 01 LDA debounce_left 2571 88b6 c9 06 CMP #6 2572 88b8 d0 2a BNE .skip64then 2573 88ba .condpart65 2574 88ba ad 4d 01 LDA menu_option_skill 2575 88bd c9 03 CMP #3 2576 88bf d0 23 BNE .skip65then 2577 88c1 .condpart66 2578 88c1 a9 02 LDA #2 2579 88c3 8d 4d 01 STA menu_option_skill 2580 88c6 a9 00 LDA #0 2581 88c8 8d 43 01 STA debounce_left 2582 88cb ifnconst NOTIALOCKMUTE 2583 88cb a9 01 lda #1 2584 88cd 85 de sta sfxschedulelock 2585 88cf a9 77 lda #sfx_bling 2588 88d5 85 e1 sta sfxinstrumenthi 2589 88d7 a9 00 lda #0 2590 88d9 85 e2 sta sfxpitchoffset ; no pitch modification 2591 88db 85 e3 sta sfxnoteindex ; not a musical note 2592 88dd 20 81 f2 jsr schedulesfx 2593 88e0 a9 00 lda #0 2594 88e2 85 de sta sfxschedulelock 2595 88e4 endif ; NOTIALOCKMUTE 2596 88e4 .skip65then 2597 88e4 .skip64then 2598 88e4 .skipL0125 2599 88e4 . 2600 88e4 ;; 2601 88e4 2602 88e4 .L0126 ;; if menu_yposition = 6 && debounce_right = 6 && menu_option_lives = 1 then menu_option_lives = 2 : debounce_right = 0 : playsfx sfx_bling 2603 88e4 2604 88e4 ad 4b 01 LDA menu_yposition 2605 88e7 c9 06 CMP #6 2606 88e9 d0 31 BNE .skipL0126 2607 88eb .condpart67 2608 88eb ad 44 01 LDA debounce_right 2609 88ee c9 06 CMP #6 2610 88f0 d0 2a BNE .skip67then 2611 88f2 .condpart68 2612 88f2 ad 4e 01 LDA menu_option_lives 2613 88f5 c9 01 CMP #1 2614 88f7 d0 23 BNE .skip68then 2615 88f9 .condpart69 2616 88f9 a9 02 LDA #2 2617 88fb 8d 4e 01 STA menu_option_lives 2618 88fe a9 00 LDA #0 2619 8900 8d 44 01 STA debounce_right 2620 8903 ifnconst NOTIALOCKMUTE 2621 8903 a9 01 lda #1 2622 8905 85 de sta sfxschedulelock 2623 8907 a9 77 lda #sfx_bling 2626 890d 85 e1 sta sfxinstrumenthi 2627 890f a9 00 lda #0 2628 8911 85 e2 sta sfxpitchoffset ; no pitch modification 2629 8913 85 e3 sta sfxnoteindex ; not a musical note 2630 8915 20 81 f2 jsr schedulesfx 2631 8918 a9 00 lda #0 2632 891a 85 de sta sfxschedulelock 2633 891c endif ; NOTIALOCKMUTE 2634 891c .skip68then 2635 891c .skip67then 2636 891c .skipL0126 2637 891c .L0127 ;; if menu_yposition = 6 && debounce_right = 6 && menu_option_lives = 2 then menu_option_lives = 3 : debounce_right = 0 : playsfx sfx_bling 2638 891c 2639 891c ad 4b 01 LDA menu_yposition 2640 891f c9 06 CMP #6 2641 8921 d0 31 BNE .skipL0127 2642 8923 .condpart70 2643 8923 ad 44 01 LDA debounce_right 2644 8926 c9 06 CMP #6 2645 8928 d0 2a BNE .skip70then 2646 892a .condpart71 2647 892a ad 4e 01 LDA menu_option_lives 2648 892d c9 02 CMP #2 2649 892f d0 23 BNE .skip71then 2650 8931 .condpart72 2651 8931 a9 03 LDA #3 2652 8933 8d 4e 01 STA menu_option_lives 2653 8936 a9 00 LDA #0 2654 8938 8d 44 01 STA debounce_right 2655 893b ifnconst NOTIALOCKMUTE 2656 893b a9 01 lda #1 2657 893d 85 de sta sfxschedulelock 2658 893f a9 77 lda #sfx_bling 2661 8945 85 e1 sta sfxinstrumenthi 2662 8947 a9 00 lda #0 2663 8949 85 e2 sta sfxpitchoffset ; no pitch modification 2664 894b 85 e3 sta sfxnoteindex ; not a musical note 2665 894d 20 81 f2 jsr schedulesfx 2666 8950 a9 00 lda #0 2667 8952 85 de sta sfxschedulelock 2668 8954 endif ; NOTIALOCKMUTE 2669 8954 .skip71then 2670 8954 .skip70then 2671 8954 .skipL0127 2672 8954 .L0128 ;; if menu_yposition = 6 && debounce_right = 6 && menu_option_lives = 3 then menu_option_lives = 1 : debounce_right = 0 : playsfx sfx_bling 2673 8954 2674 8954 ad 4b 01 LDA menu_yposition 2675 8957 c9 06 CMP #6 2676 8959 d0 31 BNE .skipL0128 2677 895b .condpart73 2678 895b ad 44 01 LDA debounce_right 2679 895e c9 06 CMP #6 2680 8960 d0 2a BNE .skip73then 2681 8962 .condpart74 2682 8962 ad 4e 01 LDA menu_option_lives 2683 8965 c9 03 CMP #3 2684 8967 d0 23 BNE .skip74then 2685 8969 .condpart75 2686 8969 a9 01 LDA #1 2687 896b 8d 4e 01 STA menu_option_lives 2688 896e a9 00 LDA #0 2689 8970 8d 44 01 STA debounce_right 2690 8973 ifnconst NOTIALOCKMUTE 2691 8973 a9 01 lda #1 2692 8975 85 de sta sfxschedulelock 2693 8977 a9 77 lda #sfx_bling 2696 897d 85 e1 sta sfxinstrumenthi 2697 897f a9 00 lda #0 2698 8981 85 e2 sta sfxpitchoffset ; no pitch modification 2699 8983 85 e3 sta sfxnoteindex ; not a musical note 2700 8985 20 81 f2 jsr schedulesfx 2701 8988 a9 00 lda #0 2702 898a 85 de sta sfxschedulelock 2703 898c endif ; NOTIALOCKMUTE 2704 898c .skip74then 2705 898c .skip73then 2706 898c .skipL0128 2707 898c .L0129 ;; if menu_yposition = 6 && debounce_left = 6 && menu_option_lives = 1 then menu_option_lives = 2 : debounce_left = 0 : playsfx sfx_bling 2708 898c 2709 898c ad 4b 01 LDA menu_yposition 2710 898f c9 06 CMP #6 2711 8991 d0 31 BNE .skipL0129 2712 8993 .condpart76 2713 8993 ad 43 01 LDA debounce_left 2714 8996 c9 06 CMP #6 2715 8998 d0 2a BNE .skip76then 2716 899a .condpart77 2717 899a ad 4e 01 LDA menu_option_lives 2718 899d c9 01 CMP #1 2719 899f d0 23 BNE .skip77then 2720 89a1 .condpart78 2721 89a1 a9 02 LDA #2 2722 89a3 8d 4e 01 STA menu_option_lives 2723 89a6 a9 00 LDA #0 2724 89a8 8d 43 01 STA debounce_left 2725 89ab ifnconst NOTIALOCKMUTE 2726 89ab a9 01 lda #1 2727 89ad 85 de sta sfxschedulelock 2728 89af a9 77 lda #sfx_bling 2731 89b5 85 e1 sta sfxinstrumenthi 2732 89b7 a9 00 lda #0 2733 89b9 85 e2 sta sfxpitchoffset ; no pitch modification 2734 89bb 85 e3 sta sfxnoteindex ; not a musical note 2735 89bd 20 81 f2 jsr schedulesfx 2736 89c0 a9 00 lda #0 2737 89c2 85 de sta sfxschedulelock 2738 89c4 endif ; NOTIALOCKMUTE 2739 89c4 .skip77then 2740 89c4 .skip76then 2741 89c4 .skipL0129 2742 89c4 .L0130 ;; if menu_yposition = 6 && debounce_left = 6 && menu_option_lives = 2 then menu_option_lives = 3 : debounce_left = 0 : playsfx sfx_bling 2743 89c4 2744 89c4 ad 4b 01 LDA menu_yposition 2745 89c7 c9 06 CMP #6 2746 89c9 d0 31 BNE .skipL0130 2747 89cb .condpart79 2748 89cb ad 43 01 LDA debounce_left 2749 89ce c9 06 CMP #6 2750 89d0 d0 2a BNE .skip79then 2751 89d2 .condpart80 2752 89d2 ad 4e 01 LDA menu_option_lives 2753 89d5 c9 02 CMP #2 2754 89d7 d0 23 BNE .skip80then 2755 89d9 .condpart81 2756 89d9 a9 03 LDA #3 2757 89db 8d 4e 01 STA menu_option_lives 2758 89de a9 00 LDA #0 2759 89e0 8d 43 01 STA debounce_left 2760 89e3 ifnconst NOTIALOCKMUTE 2761 89e3 a9 01 lda #1 2762 89e5 85 de sta sfxschedulelock 2763 89e7 a9 77 lda #sfx_bling 2766 89ed 85 e1 sta sfxinstrumenthi 2767 89ef a9 00 lda #0 2768 89f1 85 e2 sta sfxpitchoffset ; no pitch modification 2769 89f3 85 e3 sta sfxnoteindex ; not a musical note 2770 89f5 20 81 f2 jsr schedulesfx 2771 89f8 a9 00 lda #0 2772 89fa 85 de sta sfxschedulelock 2773 89fc endif ; NOTIALOCKMUTE 2774 89fc .skip80then 2775 89fc .skip79then 2776 89fc .skipL0130 2777 89fc .L0131 ;; if menu_yposition = 6 && debounce_left = 6 && menu_option_lives = 3 then menu_option_lives = 1 : debounce_left = 0 : playsfx sfx_bling 2778 89fc 2779 89fc ad 4b 01 LDA menu_yposition 2780 89ff c9 06 CMP #6 2781 8a01 d0 31 BNE .skipL0131 2782 8a03 .condpart82 2783 8a03 ad 43 01 LDA debounce_left 2784 8a06 c9 06 CMP #6 2785 8a08 d0 2a BNE .skip82then 2786 8a0a .condpart83 2787 8a0a ad 4e 01 LDA menu_option_lives 2788 8a0d c9 03 CMP #3 2789 8a0f d0 23 BNE .skip83then 2790 8a11 .condpart84 2791 8a11 a9 01 LDA #1 2792 8a13 8d 4e 01 STA menu_option_lives 2793 8a16 a9 00 LDA #0 2794 8a18 8d 43 01 STA debounce_left 2795 8a1b ifnconst NOTIALOCKMUTE 2796 8a1b a9 01 lda #1 2797 8a1d 85 de sta sfxschedulelock 2798 8a1f a9 77 lda #sfx_bling 2801 8a25 85 e1 sta sfxinstrumenthi 2802 8a27 a9 00 lda #0 2803 8a29 85 e2 sta sfxpitchoffset ; no pitch modification 2804 8a2b 85 e3 sta sfxnoteindex ; not a musical note 2805 8a2d 20 81 f2 jsr schedulesfx 2806 8a30 a9 00 lda #0 2807 8a32 85 de sta sfxschedulelock 2808 8a34 endif ; NOTIALOCKMUTE 2809 8a34 .skip83then 2810 8a34 .skip82then 2811 8a34 .skipL0131 2812 8a34 . 2813 8a34 ;; 2814 8a34 2815 8a34 .L0132 ;; if menu_yposition = 8 && debounce_right = 6 && menu_option_time = 1 then menu_option_time = 2 : debounce_right = 0 : playsfx sfx_bling 2816 8a34 2817 8a34 ad 4b 01 LDA menu_yposition 2818 8a37 c9 08 CMP #8 2819 8a39 d0 31 BNE .skipL0132 2820 8a3b .condpart85 2821 8a3b ad 44 01 LDA debounce_right 2822 8a3e c9 06 CMP #6 2823 8a40 d0 2a BNE .skip85then 2824 8a42 .condpart86 2825 8a42 ad 4f 01 LDA menu_option_time 2826 8a45 c9 01 CMP #1 2827 8a47 d0 23 BNE .skip86then 2828 8a49 .condpart87 2829 8a49 a9 02 LDA #2 2830 8a4b 8d 4f 01 STA menu_option_time 2831 8a4e a9 00 LDA #0 2832 8a50 8d 44 01 STA debounce_right 2833 8a53 ifnconst NOTIALOCKMUTE 2834 8a53 a9 01 lda #1 2835 8a55 85 de sta sfxschedulelock 2836 8a57 a9 77 lda #sfx_bling 2839 8a5d 85 e1 sta sfxinstrumenthi 2840 8a5f a9 00 lda #0 2841 8a61 85 e2 sta sfxpitchoffset ; no pitch modification 2842 8a63 85 e3 sta sfxnoteindex ; not a musical note 2843 8a65 20 81 f2 jsr schedulesfx 2844 8a68 a9 00 lda #0 2845 8a6a 85 de sta sfxschedulelock 2846 8a6c endif ; NOTIALOCKMUTE 2847 8a6c .skip86then 2848 8a6c .skip85then 2849 8a6c .skipL0132 2850 8a6c .L0133 ;; if menu_yposition = 8 && debounce_right = 6 && menu_option_time = 2 then menu_option_time = 3 : debounce_right = 0 : playsfx sfx_bling 2851 8a6c 2852 8a6c ad 4b 01 LDA menu_yposition 2853 8a6f c9 08 CMP #8 2854 8a71 d0 31 BNE .skipL0133 2855 8a73 .condpart88 2856 8a73 ad 44 01 LDA debounce_right 2857 8a76 c9 06 CMP #6 2858 8a78 d0 2a BNE .skip88then 2859 8a7a .condpart89 2860 8a7a ad 4f 01 LDA menu_option_time 2861 8a7d c9 02 CMP #2 2862 8a7f d0 23 BNE .skip89then 2863 8a81 .condpart90 2864 8a81 a9 03 LDA #3 2865 8a83 8d 4f 01 STA menu_option_time 2866 8a86 a9 00 LDA #0 2867 8a88 8d 44 01 STA debounce_right 2868 8a8b ifnconst NOTIALOCKMUTE 2869 8a8b a9 01 lda #1 2870 8a8d 85 de sta sfxschedulelock 2871 8a8f a9 77 lda #sfx_bling 2874 8a95 85 e1 sta sfxinstrumenthi 2875 8a97 a9 00 lda #0 2876 8a99 85 e2 sta sfxpitchoffset ; no pitch modification 2877 8a9b 85 e3 sta sfxnoteindex ; not a musical note 2878 8a9d 20 81 f2 jsr schedulesfx 2879 8aa0 a9 00 lda #0 2880 8aa2 85 de sta sfxschedulelock 2881 8aa4 endif ; NOTIALOCKMUTE 2882 8aa4 .skip89then 2883 8aa4 .skip88then 2884 8aa4 .skipL0133 2885 8aa4 .L0134 ;; if menu_yposition = 8 && debounce_right = 6 && menu_option_time = 3 then menu_option_time = 1 : debounce_right = 0 : playsfx sfx_bling 2886 8aa4 2887 8aa4 ad 4b 01 LDA menu_yposition 2888 8aa7 c9 08 CMP #8 2889 8aa9 d0 31 BNE .skipL0134 2890 8aab .condpart91 2891 8aab ad 44 01 LDA debounce_right 2892 8aae c9 06 CMP #6 2893 8ab0 d0 2a BNE .skip91then 2894 8ab2 .condpart92 2895 8ab2 ad 4f 01 LDA menu_option_time 2896 8ab5 c9 03 CMP #3 2897 8ab7 d0 23 BNE .skip92then 2898 8ab9 .condpart93 2899 8ab9 a9 01 LDA #1 2900 8abb 8d 4f 01 STA menu_option_time 2901 8abe a9 00 LDA #0 2902 8ac0 8d 44 01 STA debounce_right 2903 8ac3 ifnconst NOTIALOCKMUTE 2904 8ac3 a9 01 lda #1 2905 8ac5 85 de sta sfxschedulelock 2906 8ac7 a9 77 lda #sfx_bling 2909 8acd 85 e1 sta sfxinstrumenthi 2910 8acf a9 00 lda #0 2911 8ad1 85 e2 sta sfxpitchoffset ; no pitch modification 2912 8ad3 85 e3 sta sfxnoteindex ; not a musical note 2913 8ad5 20 81 f2 jsr schedulesfx 2914 8ad8 a9 00 lda #0 2915 8ada 85 de sta sfxschedulelock 2916 8adc endif ; NOTIALOCKMUTE 2917 8adc .skip92then 2918 8adc .skip91then 2919 8adc .skipL0134 2920 8adc .L0135 ;; if menu_yposition = 8 && debounce_left = 6 && menu_option_time = 1 then menu_option_time = 2 : debounce_left = 0 : playsfx sfx_bling 2921 8adc 2922 8adc ad 4b 01 LDA menu_yposition 2923 8adf c9 08 CMP #8 2924 8ae1 d0 31 BNE .skipL0135 2925 8ae3 .condpart94 2926 8ae3 ad 43 01 LDA debounce_left 2927 8ae6 c9 06 CMP #6 2928 8ae8 d0 2a BNE .skip94then 2929 8aea .condpart95 2930 8aea ad 4f 01 LDA menu_option_time 2931 8aed c9 01 CMP #1 2932 8aef d0 23 BNE .skip95then 2933 8af1 .condpart96 2934 8af1 a9 02 LDA #2 2935 8af3 8d 4f 01 STA menu_option_time 2936 8af6 a9 00 LDA #0 2937 8af8 8d 43 01 STA debounce_left 2938 8afb ifnconst NOTIALOCKMUTE 2939 8afb a9 01 lda #1 2940 8afd 85 de sta sfxschedulelock 2941 8aff a9 77 lda #sfx_bling 2944 8b05 85 e1 sta sfxinstrumenthi 2945 8b07 a9 00 lda #0 2946 8b09 85 e2 sta sfxpitchoffset ; no pitch modification 2947 8b0b 85 e3 sta sfxnoteindex ; not a musical note 2948 8b0d 20 81 f2 jsr schedulesfx 2949 8b10 a9 00 lda #0 2950 8b12 85 de sta sfxschedulelock 2951 8b14 endif ; NOTIALOCKMUTE 2952 8b14 .skip95then 2953 8b14 .skip94then 2954 8b14 .skipL0135 2955 8b14 .L0136 ;; if menu_yposition = 8 && debounce_left = 6 && menu_option_time = 2 then menu_option_time = 3 : debounce_left = 0 : playsfx sfx_bling 2956 8b14 2957 8b14 ad 4b 01 LDA menu_yposition 2958 8b17 c9 08 CMP #8 2959 8b19 d0 31 BNE .skipL0136 2960 8b1b .condpart97 2961 8b1b ad 43 01 LDA debounce_left 2962 8b1e c9 06 CMP #6 2963 8b20 d0 2a BNE .skip97then 2964 8b22 .condpart98 2965 8b22 ad 4f 01 LDA menu_option_time 2966 8b25 c9 02 CMP #2 2967 8b27 d0 23 BNE .skip98then 2968 8b29 .condpart99 2969 8b29 a9 03 LDA #3 2970 8b2b 8d 4f 01 STA menu_option_time 2971 8b2e a9 00 LDA #0 2972 8b30 8d 43 01 STA debounce_left 2973 8b33 ifnconst NOTIALOCKMUTE 2974 8b33 a9 01 lda #1 2975 8b35 85 de sta sfxschedulelock 2976 8b37 a9 77 lda #sfx_bling 2979 8b3d 85 e1 sta sfxinstrumenthi 2980 8b3f a9 00 lda #0 2981 8b41 85 e2 sta sfxpitchoffset ; no pitch modification 2982 8b43 85 e3 sta sfxnoteindex ; not a musical note 2983 8b45 20 81 f2 jsr schedulesfx 2984 8b48 a9 00 lda #0 2985 8b4a 85 de sta sfxschedulelock 2986 8b4c endif ; NOTIALOCKMUTE 2987 8b4c .skip98then 2988 8b4c .skip97then 2989 8b4c .skipL0136 2990 8b4c .L0137 ;; if menu_yposition = 8 && debounce_left = 6 && menu_option_time = 3 then menu_option_time = 1 : debounce_left = 0 : playsfx sfx_bling 2991 8b4c 2992 8b4c ad 4b 01 LDA menu_yposition 2993 8b4f c9 08 CMP #8 2994 8b51 d0 31 BNE .skipL0137 2995 8b53 .condpart100 2996 8b53 ad 43 01 LDA debounce_left 2997 8b56 c9 06 CMP #6 2998 8b58 d0 2a BNE .skip100then 2999 8b5a .condpart101 3000 8b5a ad 4f 01 LDA menu_option_time 3001 8b5d c9 03 CMP #3 3002 8b5f d0 23 BNE .skip101then 3003 8b61 .condpart102 3004 8b61 a9 01 LDA #1 3005 8b63 8d 4f 01 STA menu_option_time 3006 8b66 a9 00 LDA #0 3007 8b68 8d 43 01 STA debounce_left 3008 8b6b ifnconst NOTIALOCKMUTE 3009 8b6b a9 01 lda #1 3010 8b6d 85 de sta sfxschedulelock 3011 8b6f a9 77 lda #sfx_bling 3014 8b75 85 e1 sta sfxinstrumenthi 3015 8b77 a9 00 lda #0 3016 8b79 85 e2 sta sfxpitchoffset ; no pitch modification 3017 8b7b 85 e3 sta sfxnoteindex ; not a musical note 3018 8b7d 20 81 f2 jsr schedulesfx 3019 8b80 a9 00 lda #0 3020 8b82 85 de sta sfxschedulelock 3021 8b84 endif ; NOTIALOCKMUTE 3022 8b84 .skip101then 3023 8b84 .skip100then 3024 8b84 .skipL0137 3025 8b84 . 3026 8b84 ;; 3027 8b84 3028 8b84 .L0138 ;; if menu_yposition = 9 && debounce_right = 6 && menu_option_players = 1 then menu_option_players = 2 : debounce_right = 0 : playsfx sfx_bling 3029 8b84 3030 8b84 ad 4b 01 LDA menu_yposition 3031 8b87 c9 09 CMP #9 3032 8b89 d0 31 BNE .skipL0138 3033 8b8b .condpart103 3034 8b8b ad 44 01 LDA debounce_right 3035 8b8e c9 06 CMP #6 3036 8b90 d0 2a BNE .skip103then 3037 8b92 .condpart104 3038 8b92 ad 4c 01 LDA menu_option_players 3039 8b95 c9 01 CMP #1 3040 8b97 d0 23 BNE .skip104then 3041 8b99 .condpart105 3042 8b99 a9 02 LDA #2 3043 8b9b 8d 4c 01 STA menu_option_players 3044 8b9e a9 00 LDA #0 3045 8ba0 8d 44 01 STA debounce_right 3046 8ba3 ifnconst NOTIALOCKMUTE 3047 8ba3 a9 01 lda #1 3048 8ba5 85 de sta sfxschedulelock 3049 8ba7 a9 77 lda #sfx_bling 3052 8bad 85 e1 sta sfxinstrumenthi 3053 8baf a9 00 lda #0 3054 8bb1 85 e2 sta sfxpitchoffset ; no pitch modification 3055 8bb3 85 e3 sta sfxnoteindex ; not a musical note 3056 8bb5 20 81 f2 jsr schedulesfx 3057 8bb8 a9 00 lda #0 3058 8bba 85 de sta sfxschedulelock 3059 8bbc endif ; NOTIALOCKMUTE 3060 8bbc .skip104then 3061 8bbc .skip103then 3062 8bbc .skipL0138 3063 8bbc .L0139 ;; if menu_yposition = 9 && debounce_right = 6 && menu_option_players = 2 then menu_option_players = 1 : debounce_right = 0 : playsfx sfx_bling 3064 8bbc 3065 8bbc ad 4b 01 LDA menu_yposition 3066 8bbf c9 09 CMP #9 3067 8bc1 d0 31 BNE .skipL0139 3068 8bc3 .condpart106 3069 8bc3 ad 44 01 LDA debounce_right 3070 8bc6 c9 06 CMP #6 3071 8bc8 d0 2a BNE .skip106then 3072 8bca .condpart107 3073 8bca ad 4c 01 LDA menu_option_players 3074 8bcd c9 02 CMP #2 3075 8bcf d0 23 BNE .skip107then 3076 8bd1 .condpart108 3077 8bd1 a9 01 LDA #1 3078 8bd3 8d 4c 01 STA menu_option_players 3079 8bd6 a9 00 LDA #0 3080 8bd8 8d 44 01 STA debounce_right 3081 8bdb ifnconst NOTIALOCKMUTE 3082 8bdb a9 01 lda #1 3083 8bdd 85 de sta sfxschedulelock 3084 8bdf a9 77 lda #sfx_bling 3087 8be5 85 e1 sta sfxinstrumenthi 3088 8be7 a9 00 lda #0 3089 8be9 85 e2 sta sfxpitchoffset ; no pitch modification 3090 8beb 85 e3 sta sfxnoteindex ; not a musical note 3091 8bed 20 81 f2 jsr schedulesfx 3092 8bf0 a9 00 lda #0 3093 8bf2 85 de sta sfxschedulelock 3094 8bf4 endif ; NOTIALOCKMUTE 3095 8bf4 .skip107then 3096 8bf4 .skip106then 3097 8bf4 .skipL0139 3098 8bf4 .L0140 ;; if menu_yposition = 9 && debounce_left = 6 && menu_option_players = 1 then menu_option_players = 2 : debounce_left = 0 : playsfx sfx_bling 3099 8bf4 3100 8bf4 ad 4b 01 LDA menu_yposition 3101 8bf7 c9 09 CMP #9 3102 8bf9 d0 31 BNE .skipL0140 3103 8bfb .condpart109 3104 8bfb ad 43 01 LDA debounce_left 3105 8bfe c9 06 CMP #6 3106 8c00 d0 2a BNE .skip109then 3107 8c02 .condpart110 3108 8c02 ad 4c 01 LDA menu_option_players 3109 8c05 c9 01 CMP #1 3110 8c07 d0 23 BNE .skip110then 3111 8c09 .condpart111 3112 8c09 a9 02 LDA #2 3113 8c0b 8d 4c 01 STA menu_option_players 3114 8c0e a9 00 LDA #0 3115 8c10 8d 43 01 STA debounce_left 3116 8c13 ifnconst NOTIALOCKMUTE 3117 8c13 a9 01 lda #1 3118 8c15 85 de sta sfxschedulelock 3119 8c17 a9 77 lda #sfx_bling 3122 8c1d 85 e1 sta sfxinstrumenthi 3123 8c1f a9 00 lda #0 3124 8c21 85 e2 sta sfxpitchoffset ; no pitch modification 3125 8c23 85 e3 sta sfxnoteindex ; not a musical note 3126 8c25 20 81 f2 jsr schedulesfx 3127 8c28 a9 00 lda #0 3128 8c2a 85 de sta sfxschedulelock 3129 8c2c endif ; NOTIALOCKMUTE 3130 8c2c .skip110then 3131 8c2c .skip109then 3132 8c2c .skipL0140 3133 8c2c .L0141 ;; if menu_yposition = 9 && debounce_left = 6 && menu_option_players = 2 then menu_option_players = 1 : debounce_left = 0 : playsfx sfx_bling 3134 8c2c 3135 8c2c ad 4b 01 LDA menu_yposition 3136 8c2f c9 09 CMP #9 3137 8c31 d0 31 BNE .skipL0141 3138 8c33 .condpart112 3139 8c33 ad 43 01 LDA debounce_left 3140 8c36 c9 06 CMP #6 3141 8c38 d0 2a BNE .skip112then 3142 8c3a .condpart113 3143 8c3a ad 4c 01 LDA menu_option_players 3144 8c3d c9 02 CMP #2 3145 8c3f d0 23 BNE .skip113then 3146 8c41 .condpart114 3147 8c41 a9 01 LDA #1 3148 8c43 8d 4c 01 STA menu_option_players 3149 8c46 a9 00 LDA #0 3150 8c48 8d 43 01 STA debounce_left 3151 8c4b ifnconst NOTIALOCKMUTE 3152 8c4b a9 01 lda #1 3153 8c4d 85 de sta sfxschedulelock 3154 8c4f a9 77 lda #sfx_bling 3157 8c55 85 e1 sta sfxinstrumenthi 3158 8c57 a9 00 lda #0 3159 8c59 85 e2 sta sfxpitchoffset ; no pitch modification 3160 8c5b 85 e3 sta sfxnoteindex ; not a musical note 3161 8c5d 20 81 f2 jsr schedulesfx 3162 8c60 a9 00 lda #0 3163 8c62 85 de sta sfxschedulelock 3164 8c64 endif ; NOTIALOCKMUTE 3165 8c64 .skip113then 3166 8c64 .skip112then 3167 8c64 .skipL0141 3168 8c64 . 3169 8c64 ;; 3170 8c64 3171 8c64 .L0142 ;; if menu_option_skill = 1 then plotchars 'beginner' 2 72 5 3172 8c64 3173 8c64 ad 4d 01 LDA menu_option_skill 3174 8c67 c9 01 CMP #1 3175 8c69 d0 24 BNE .skipL0142 3176 8c6b .condpart115 3177 8c6b 4c 76 8c JMP skipalphadata17 3178 8c6e alphadata17 3179 8c6e 4d .byte.b (alphadata17 3192 8c7c 85 43 sta temp2 3193 8c7e 3194 8c7e a9 18 lda #24 ; width in two's complement 3195 8c80 09 40 ora #64 ; palette left shifted 5 bits 3196 8c82 85 44 sta temp3 3197 8c84 a9 48 lda #72 3198 8c86 85 45 sta temp4 3199 8c88 3200 8c88 a9 05 lda #5 3201 8c8a 3202 8c8a 85 46 sta temp5 3203 8c8c 3204 8c8c 20 7a f3 jsr plotcharacters 3205 8c8f .skipL0142 3206 8c8f .L0143 ;; if menu_option_skill = 2 then plotchars 'fighter' 2 72 5 3207 8c8f 3208 8c8f ad 4d 01 LDA menu_option_skill 3209 8c92 c9 02 CMP #2 3210 8c94 d0 23 BNE .skipL0143 3211 8c96 .condpart116 3212 8c96 4c a0 8c JMP skipalphadata18 3213 8c99 alphadata18 3214 8c99 51 .byte.b (alphadata18 3226 8ca6 85 43 sta temp2 3227 8ca8 3228 8ca8 a9 19 lda #25 ; width in two's complement 3229 8caa 09 40 ora #64 ; palette left shifted 5 bits 3230 8cac 85 44 sta temp3 3231 8cae a9 48 lda #72 3232 8cb0 85 45 sta temp4 3233 8cb2 3234 8cb2 a9 05 lda #5 3235 8cb4 3236 8cb4 85 46 sta temp5 3237 8cb6 3238 8cb6 20 7a f3 jsr plotcharacters 3239 8cb9 .skipL0143 3240 8cb9 .L0144 ;; if menu_option_skill = 3 then plotchars 'mistress' 2 72 5 3241 8cb9 3242 8cb9 ad 4d 01 LDA menu_option_skill 3243 8cbc c9 03 CMP #3 3244 8cbe d0 24 BNE .skipL0144 3245 8cc0 .condpart117 3246 8cc0 4c cb 8c JMP skipalphadata19 3247 8cc3 alphadata19 3248 8cc3 58 .byte.b (alphadata19 3261 8cd1 85 43 sta temp2 3262 8cd3 3263 8cd3 a9 18 lda #24 ; width in two's complement 3264 8cd5 09 40 ora #64 ; palette left shifted 5 bits 3265 8cd7 85 44 sta temp3 3266 8cd9 a9 48 lda #72 3267 8cdb 85 45 sta temp4 3268 8cdd 3269 8cdd a9 05 lda #5 3270 8cdf 3271 8cdf 85 46 sta temp5 3272 8ce1 3273 8ce1 20 7a f3 jsr plotcharacters 3274 8ce4 .skipL0144 3275 8ce4 . 3276 8ce4 ;; 3277 8ce4 3278 8ce4 .L0145 ;; if menu_option_lives = 1 then plotchars 'one^life' 2 72 6 3279 8ce4 3280 8ce4 ad 4e 01 LDA menu_option_lives 3281 8ce7 c9 01 CMP #1 3282 8ce9 d0 24 BNE .skipL0145 3283 8ceb .condpart118 3284 8ceb 4c f6 8c JMP skipalphadata20 3285 8cee alphadata20 3286 8cee 5a .byte.b (alphadata20 3299 8cfc 85 43 sta temp2 3300 8cfe 3301 8cfe a9 18 lda #24 ; width in two's complement 3302 8d00 09 40 ora #64 ; palette left shifted 5 bits 3303 8d02 85 44 sta temp3 3304 8d04 a9 48 lda #72 3305 8d06 85 45 sta temp4 3306 8d08 3307 8d08 a9 06 lda #6 3308 8d0a 3309 8d0a 85 46 sta temp5 3310 8d0c 3311 8d0c 20 7a f3 jsr plotcharacters 3312 8d0f .skipL0145 3313 8d0f .L0146 ;; if menu_option_lives = 2 then plotchars 'two^lives' 2 72 6 3314 8d0f 3315 8d0f ad 4e 01 LDA menu_option_lives 3316 8d12 c9 02 CMP #2 3317 8d14 d0 25 BNE .skipL0146 3318 8d16 .condpart119 3319 8d16 4c 22 8d JMP skipalphadata21 3320 8d19 alphadata21 3321 8d19 5f .byte.b (alphadata21 3335 8d28 85 43 sta temp2 3336 8d2a 3337 8d2a a9 17 lda #23 ; width in two's complement 3338 8d2c 09 40 ora #64 ; palette left shifted 5 bits 3339 8d2e 85 44 sta temp3 3340 8d30 a9 48 lda #72 3341 8d32 85 45 sta temp4 3342 8d34 3343 8d34 a9 06 lda #6 3344 8d36 3345 8d36 85 46 sta temp5 3346 8d38 3347 8d38 20 7a f3 jsr plotcharacters 3348 8d3b .skipL0146 3349 8d3b .L0147 ;; if menu_option_lives = 3 then plotchars 'three^lives' 2 72 6 3350 8d3b 3351 8d3b ad 4e 01 LDA menu_option_lives 3352 8d3e c9 03 CMP #3 3353 8d40 d0 27 BNE .skipL0147 3354 8d42 .condpart120 3355 8d42 4c 50 8d JMP skipalphadata22 3356 8d45 alphadata22 3357 8d45 5f .byte.b (alphadata22 3373 8d56 85 43 sta temp2 3374 8d58 3375 8d58 a9 15 lda #21 ; width in two's complement 3376 8d5a 09 40 ora #64 ; palette left shifted 5 bits 3377 8d5c 85 44 sta temp3 3378 8d5e a9 48 lda #72 3379 8d60 85 45 sta temp4 3380 8d62 3381 8d62 a9 06 lda #6 3382 8d64 3383 8d64 85 46 sta temp5 3384 8d66 3385 8d66 20 7a f3 jsr plotcharacters 3386 8d69 .skipL0147 3387 8d69 . 3388 8d69 ;; 3389 8d69 3390 8d69 .L0148 ;; if menu_option_time = 1 then plotchars 'off' 2 72 8 3391 8d69 3392 8d69 ad 4f 01 LDA menu_option_time 3393 8d6c c9 01 CMP #1 3394 8d6e d0 1f BNE .skipL0148 3395 8d70 .condpart121 3396 8d70 4c 76 8d JMP skipalphadata23 3397 8d73 alphadata23 3398 8d73 5a .byte.b (alphadata23 3406 8d7c 85 43 sta temp2 3407 8d7e 3408 8d7e a9 1d lda #29 ; width in two's complement 3409 8d80 09 40 ora #64 ; palette left shifted 5 bits 3410 8d82 85 44 sta temp3 3411 8d84 a9 48 lda #72 3412 8d86 85 45 sta temp4 3413 8d88 3414 8d88 a9 08 lda #8 3415 8d8a 3416 8d8a 85 46 sta temp5 3417 8d8c 3418 8d8c 20 7a f3 jsr plotcharacters 3419 8d8f .skipL0148 3420 8d8f .L0149 ;; if menu_option_time = 2 then plotchars 'two^minutes' 2 72 8 3421 8d8f 3422 8d8f ad 4f 01 LDA menu_option_time 3423 8d92 c9 02 CMP #2 3424 8d94 d0 27 BNE .skipL0149 3425 8d96 .condpart122 3426 8d96 4c a4 8d JMP skipalphadata24 3427 8d99 alphadata24 3428 8d99 5f .byte.b (alphadata24 3444 8daa 85 43 sta temp2 3445 8dac 3446 8dac a9 15 lda #21 ; width in two's complement 3447 8dae 09 40 ora #64 ; palette left shifted 5 bits 3448 8db0 85 44 sta temp3 3449 8db2 a9 48 lda #72 3450 8db4 85 45 sta temp4 3451 8db6 3452 8db6 a9 08 lda #8 3453 8db8 3454 8db8 85 46 sta temp5 3455 8dba 3456 8dba 20 7a f3 jsr plotcharacters 3457 8dbd .skipL0149 3458 8dbd .L0150 ;; if menu_option_time = 3 then plotchars 'five^minutes' 2 72 8 3459 8dbd 3460 8dbd ad 4f 01 LDA menu_option_time 3461 8dc0 c9 03 CMP #3 3462 8dc2 d0 28 BNE .skipL0150 3463 8dc4 .condpart123 3464 8dc4 4c d3 8d JMP skipalphadata25 3465 8dc7 alphadata25 3466 8dc7 51 .byte.b (alphadata25 3483 8dd9 85 43 sta temp2 3484 8ddb 3485 8ddb a9 14 lda #20 ; width in two's complement 3486 8ddd 09 40 ora #64 ; palette left shifted 5 bits 3487 8ddf 85 44 sta temp3 3488 8de1 a9 48 lda #72 3489 8de3 85 45 sta temp4 3490 8de5 3491 8de5 a9 08 lda #8 3492 8de7 3493 8de7 85 46 sta temp5 3494 8de9 3495 8de9 20 7a f3 jsr plotcharacters 3496 8dec .skipL0150 3497 8dec . 3498 8dec ;; 3499 8dec 3500 8dec .L0151 ;; if menu_option_players = 1 then plotchars 'one^player' 2 72 9 3501 8dec 3502 8dec ad 4c 01 LDA menu_option_players 3503 8def c9 01 CMP #1 3504 8df1 d0 26 BNE .skipL0151 3505 8df3 .condpart124 3506 8df3 4c 00 8e JMP skipalphadata26 3507 8df6 alphadata26 3508 8df6 5a .byte.b (alphadata26 3523 8e06 85 43 sta temp2 3524 8e08 3525 8e08 a9 16 lda #22 ; width in two's complement 3526 8e0a 09 40 ora #64 ; palette left shifted 5 bits 3527 8e0c 85 44 sta temp3 3528 8e0e a9 48 lda #72 3529 8e10 85 45 sta temp4 3530 8e12 3531 8e12 a9 09 lda #9 3532 8e14 3533 8e14 85 46 sta temp5 3534 8e16 3535 8e16 20 7a f3 jsr plotcharacters 3536 8e19 .skipL0151 3537 8e19 .L0152 ;; if menu_option_players = 2 then plotchars 'two^players' 2 72 9 3538 8e19 3539 8e19 ad 4c 01 LDA menu_option_players 3540 8e1c c9 02 CMP #2 3541 8e1e d0 27 BNE .skipL0152 3542 8e20 .condpart125 3543 8e20 4c 2e 8e JMP skipalphadata27 3544 8e23 alphadata27 3545 8e23 5f .byte.b (alphadata27 3561 8e34 85 43 sta temp2 3562 8e36 3563 8e36 a9 15 lda #21 ; width in two's complement 3564 8e38 09 40 ora #64 ; palette left shifted 5 bits 3565 8e3a 85 44 sta temp3 3566 8e3c a9 48 lda #72 3567 8e3e 85 45 sta temp4 3568 8e40 3569 8e40 a9 09 lda #9 3570 8e42 3571 8e42 85 46 sta temp5 3572 8e44 3573 8e44 20 7a f3 jsr plotcharacters 3574 8e47 .skipL0152 3575 8e47 . 3576 8e47 ;; 3577 8e47 3578 8e47 .L0153 ;; if menu_yposition = 10 && debounce_fire = 6 then debounce_fire = 0 : playsfx sfx_plainlaser : goto main 3579 8e47 3580 8e47 ad 4b 01 LDA menu_yposition 3581 8e4a c9 0a CMP #10 3582 8e4c d0 28 BNE .skipL0153 3583 8e4e .condpart126 3584 8e4e ad 45 01 LDA debounce_fire 3585 8e51 c9 06 CMP #6 3586 8e53 d0 21 BNE .skip126then 3587 8e55 .condpart127 3588 8e55 a9 00 LDA #0 3589 8e57 8d 45 01 STA debounce_fire 3590 8e5a ifnconst NOTIALOCKMUTE 3591 8e5a a9 01 lda #1 3592 8e5c 85 de sta sfxschedulelock 3593 8e5e a9 b0 lda #sfx_plainlaser 3596 8e64 85 e1 sta sfxinstrumenthi 3597 8e66 a9 00 lda #0 3598 8e68 85 e2 sta sfxpitchoffset ; no pitch modification 3599 8e6a 85 e3 sta sfxnoteindex ; not a musical note 3600 8e6c 20 81 f2 jsr schedulesfx 3601 8e6f a9 00 lda #0 3602 8e71 85 de sta sfxschedulelock 3603 8e73 endif ; NOTIALOCKMUTE 3604 8e73 4c 99 80 jmp .main 3605 8e76 3606 8e76 .skip126then 3607 8e76 .skipL0153 3608 8e76 .L0154 ;; if switchreset then reboot 3609 8e76 3610 8e76 20 49 f4 jsr checkresetswitch 3611 8e79 d0 03 BNE .skipL0154 3612 8e7b .condpart128 3613 8e7b 4c 40 f5 JMP START 3614 8e7e .skipL0154 3615 8e7e .L0155 ;; drawscreen 3616 8e7e 3617 8e7e 20 b3 f0 jsr drawscreen 3618 8e81 .L0156 ;; goto menuscreen_loop 3619 8e81 3620 8e81 4c 44 83 jmp .menuscreen_loop 3621 8e84 3622 8e84 . 3623 8e84 ;; 3624 8e84 3625 8e84 .titlescreen 3626 8e84 ;; titlescreen 3627 8e84 3628 8e84 . 3629 8e84 ;; 3630 8e84 3631 8e84 . 3632 8e84 ;; 3633 8e84 3634 8e84 . 3635 8e84 ;; 3636 8e84 3637 8e84 .titlescreenloop 3638 8e84 ;; titlescreenloop 3639 8e84 3640 8e84 .L0157 ;; drawwait 3641 8e84 3642 8e84 20 d0 f1 jsr drawwait 3643 8e87 .L0158 ;; clearscreen 3644 8e87 3645 8e87 20 7f f0 jsr clearscreen 3646 8e8a .L0159 ;; if switchreset then reboot 3647 8e8a 3648 8e8a 20 49 f4 jsr checkresetswitch 3649 8e8d d0 03 BNE .skipL0159 3650 8e8f .condpart129 3651 8e8f 4c 40 f5 JMP START 3652 8e92 .skipL0159 3653 8e92 .L0160 ;; plotsprite heofonfir_logo_h 0 9 2 3654 8e92 3655 8e92 a9 10 lda #heofonfir_logo_h 3659 8e98 85 43 sta temp2 3660 8e9a 3661 8e9a a9 1c lda #(0|heofonfir_logo_h_width_twoscompliment) 3662 8e9c 85 44 sta temp3 3663 8e9e 3664 8e9e a9 09 lda #9 3665 8ea0 85 45 sta temp4 3666 8ea2 3667 8ea2 a9 02 lda #2 3668 8ea4 3669 8ea4 85 46 sta temp5 3670 8ea6 3671 8ea6 a9 40 lda #(heofonfir_logo_h_mode|%01000000) 3672 8ea8 85 47 sta temp6 3673 8eaa 3674 8eaa 20 c9 f2 jsr plotsprite 3675 8ead ; +tall sprite replot 3676 8ead 18 clc 3677 8eae a5 42 lda temp1 3678 8eb0 69 04 adc #heofonfir_logo_h_width 3679 8eb2 85 42 sta temp1 3680 8eb4 a5 46 lda temp5 3681 8eb6 69 10 adc #WZONEHEIGHT 3682 8eb8 85 46 sta temp5 3683 8eba 20 c9 f2 jsr plotsprite 3684 8ebd .L0161 ;; plotsprite heofonfir_logo_e 0 26 2 3685 8ebd 3686 8ebd a9 00 lda #heofonfir_logo_e 3690 8ec3 85 43 sta temp2 3691 8ec5 3692 8ec5 a9 1c lda #(0|heofonfir_logo_e_width_twoscompliment) 3693 8ec7 85 44 sta temp3 3694 8ec9 3695 8ec9 a9 1a lda #26 3696 8ecb 85 45 sta temp4 3697 8ecd 3698 8ecd a9 02 lda #2 3699 8ecf 3700 8ecf 85 46 sta temp5 3701 8ed1 3702 8ed1 a9 40 lda #(heofonfir_logo_e_mode|%01000000) 3703 8ed3 85 47 sta temp6 3704 8ed5 3705 8ed5 20 c9 f2 jsr plotsprite 3706 8ed8 ; +tall sprite replot 3707 8ed8 18 clc 3708 8ed9 a5 42 lda temp1 3709 8edb 69 04 adc #heofonfir_logo_e_width 3710 8edd 85 42 sta temp1 3711 8edf a5 46 lda temp5 3712 8ee1 69 10 adc #WZONEHEIGHT 3713 8ee3 85 46 sta temp5 3714 8ee5 20 c9 f2 jsr plotsprite 3715 8ee8 .L0162 ;; plotsprite heofonfir_logo_o 0 42 2 3716 8ee8 3717 8ee8 a9 28 lda #heofonfir_logo_o 3721 8eee 85 43 sta temp2 3722 8ef0 3723 8ef0 a9 1c lda #(0|heofonfir_logo_o_width_twoscompliment) 3724 8ef2 85 44 sta temp3 3725 8ef4 3726 8ef4 a9 2a lda #42 3727 8ef6 85 45 sta temp4 3728 8ef8 3729 8ef8 a9 02 lda #2 3730 8efa 3731 8efa 85 46 sta temp5 3732 8efc 3733 8efc a9 40 lda #(heofonfir_logo_o_mode|%01000000) 3734 8efe 85 47 sta temp6 3735 8f00 3736 8f00 20 c9 f2 jsr plotsprite 3737 8f03 ; +tall sprite replot 3738 8f03 18 clc 3739 8f04 a5 42 lda temp1 3740 8f06 69 04 adc #heofonfir_logo_o_width 3741 8f08 85 42 sta temp1 3742 8f0a a5 46 lda temp5 3743 8f0c 69 10 adc #WZONEHEIGHT 3744 8f0e 85 46 sta temp5 3745 8f10 20 c9 f2 jsr plotsprite 3746 8f13 .L0163 ;; plotsprite heofonfir_logo_f 0 58 2 3747 8f13 3748 8f13 a9 08 lda #heofonfir_logo_f 3752 8f19 85 43 sta temp2 3753 8f1b 3754 8f1b a9 1c lda #(0|heofonfir_logo_f_width_twoscompliment) 3755 8f1d 85 44 sta temp3 3756 8f1f 3757 8f1f a9 3a lda #58 3758 8f21 85 45 sta temp4 3759 8f23 3760 8f23 a9 02 lda #2 3761 8f25 3762 8f25 85 46 sta temp5 3763 8f27 3764 8f27 a9 40 lda #(heofonfir_logo_f_mode|%01000000) 3765 8f29 85 47 sta temp6 3766 8f2b 3767 8f2b 20 c9 f2 jsr plotsprite 3768 8f2e ; +tall sprite replot 3769 8f2e 18 clc 3770 8f2f a5 42 lda temp1 3771 8f31 69 04 adc #heofonfir_logo_f_width 3772 8f33 85 42 sta temp1 3773 8f35 a5 46 lda temp5 3774 8f37 69 10 adc #WZONEHEIGHT 3775 8f39 85 46 sta temp5 3776 8f3b 20 c9 f2 jsr plotsprite 3777 8f3e .L0164 ;; plotsprite heofonfir_logo_o 0 74 2 3778 8f3e 3779 8f3e a9 28 lda #heofonfir_logo_o 3783 8f44 85 43 sta temp2 3784 8f46 3785 8f46 a9 1c lda #(0|heofonfir_logo_o_width_twoscompliment) 3786 8f48 85 44 sta temp3 3787 8f4a 3788 8f4a a9 4a lda #74 3789 8f4c 85 45 sta temp4 3790 8f4e 3791 8f4e a9 02 lda #2 3792 8f50 3793 8f50 85 46 sta temp5 3794 8f52 3795 8f52 a9 40 lda #(heofonfir_logo_o_mode|%01000000) 3796 8f54 85 47 sta temp6 3797 8f56 3798 8f56 20 c9 f2 jsr plotsprite 3799 8f59 ; +tall sprite replot 3800 8f59 18 clc 3801 8f5a a5 42 lda temp1 3802 8f5c 69 04 adc #heofonfir_logo_o_width 3803 8f5e 85 42 sta temp1 3804 8f60 a5 46 lda temp5 3805 8f62 69 10 adc #WZONEHEIGHT 3806 8f64 85 46 sta temp5 3807 8f66 20 c9 f2 jsr plotsprite 3808 8f69 .L0165 ;; plotsprite heofonfir_logo_n 0 90 2 3809 8f69 3810 8f69 a9 20 lda #heofonfir_logo_n 3814 8f6f 85 43 sta temp2 3815 8f71 3816 8f71 a9 1c lda #(0|heofonfir_logo_n_width_twoscompliment) 3817 8f73 85 44 sta temp3 3818 8f75 3819 8f75 a9 5a lda #90 3820 8f77 85 45 sta temp4 3821 8f79 3822 8f79 a9 02 lda #2 3823 8f7b 3824 8f7b 85 46 sta temp5 3825 8f7d 3826 8f7d a9 40 lda #(heofonfir_logo_n_mode|%01000000) 3827 8f7f 85 47 sta temp6 3828 8f81 3829 8f81 20 c9 f2 jsr plotsprite 3830 8f84 ; +tall sprite replot 3831 8f84 18 clc 3832 8f85 a5 42 lda temp1 3833 8f87 69 04 adc #heofonfir_logo_n_width 3834 8f89 85 42 sta temp1 3835 8f8b a5 46 lda temp5 3836 8f8d 69 10 adc #WZONEHEIGHT 3837 8f8f 85 46 sta temp5 3838 8f91 20 c9 f2 jsr plotsprite 3839 8f94 .L0166 ;; plotsprite heofonfir_logo_f 0 107 2 3840 8f94 3841 8f94 a9 08 lda #heofonfir_logo_f 3845 8f9a 85 43 sta temp2 3846 8f9c 3847 8f9c a9 1c lda #(0|heofonfir_logo_f_width_twoscompliment) 3848 8f9e 85 44 sta temp3 3849 8fa0 3850 8fa0 a9 6b lda #107 3851 8fa2 85 45 sta temp4 3852 8fa4 3853 8fa4 a9 02 lda #2 3854 8fa6 3855 8fa6 85 46 sta temp5 3856 8fa8 3857 8fa8 a9 40 lda #(heofonfir_logo_f_mode|%01000000) 3858 8faa 85 47 sta temp6 3859 8fac 3860 8fac 20 c9 f2 jsr plotsprite 3861 8faf ; +tall sprite replot 3862 8faf 18 clc 3863 8fb0 a5 42 lda temp1 3864 8fb2 69 04 adc #heofonfir_logo_f_width 3865 8fb4 85 42 sta temp1 3866 8fb6 a5 46 lda temp5 3867 8fb8 69 10 adc #WZONEHEIGHT 3868 8fba 85 46 sta temp5 3869 8fbc 20 c9 f2 jsr plotsprite 3870 8fbf .L0167 ;; plotsprite heofonfir_logo_i 0 121 2 3871 8fbf 3872 8fbf a9 18 lda #heofonfir_logo_i 3876 8fc5 85 43 sta temp2 3877 8fc7 3878 8fc7 a9 1c lda #(0|heofonfir_logo_i_width_twoscompliment) 3879 8fc9 85 44 sta temp3 3880 8fcb 3881 8fcb a9 79 lda #121 3882 8fcd 85 45 sta temp4 3883 8fcf 3884 8fcf a9 02 lda #2 3885 8fd1 3886 8fd1 85 46 sta temp5 3887 8fd3 3888 8fd3 a9 40 lda #(heofonfir_logo_i_mode|%01000000) 3889 8fd5 85 47 sta temp6 3890 8fd7 3891 8fd7 20 c9 f2 jsr plotsprite 3892 8fda ; +tall sprite replot 3893 8fda 18 clc 3894 8fdb a5 42 lda temp1 3895 8fdd 69 04 adc #heofonfir_logo_i_width 3896 8fdf 85 42 sta temp1 3897 8fe1 a5 46 lda temp5 3898 8fe3 69 10 adc #WZONEHEIGHT 3899 8fe5 85 46 sta temp5 3900 8fe7 20 c9 f2 jsr plotsprite 3901 8fea .L0168 ;; plotsprite heofonfir_logo_r 0 136 2 3902 8fea 3903 8fea a9 30 lda #heofonfir_logo_r 3907 8ff0 85 43 sta temp2 3908 8ff2 3909 8ff2 a9 1c lda #(0|heofonfir_logo_r_width_twoscompliment) 3910 8ff4 85 44 sta temp3 3911 8ff6 3912 8ff6 a9 88 lda #136 3913 8ff8 85 45 sta temp4 3914 8ffa 3915 8ffa a9 02 lda #2 3916 8ffc 3917 8ffc 85 46 sta temp5 3918 8ffe 3919 8ffe a9 40 lda #(heofonfir_logo_r_mode|%01000000) 3920 9000 85 47 sta temp6 3921 9002 3922 9002 20 c9 f2 jsr plotsprite 3923 9005 ; +tall sprite replot 3924 9005 18 clc 3925 9006 a5 42 lda temp1 3926 9008 69 04 adc #heofonfir_logo_r_width 3927 900a 85 42 sta temp1 3928 900c a5 46 lda temp5 3929 900e 69 10 adc #WZONEHEIGHT 3930 9010 85 46 sta temp5 3931 9012 20 c9 f2 jsr plotsprite 3932 9015 .L0169 ;; plotsprite heofonfir_push_fire_banner 0 60 120 3933 9015 3934 9015 a9 38 lda #heofonfir_push_fire_banner 3938 901b 85 43 sta temp2 3939 901d 3940 901d a9 16 lda #(0|heofonfir_push_fire_banner_width_twoscompliment) 3941 901f 85 44 sta temp3 3942 9021 3943 9021 a9 3c lda #60 3944 9023 85 45 sta temp4 3945 9025 3946 9025 a9 78 lda #120 3947 9027 3948 9027 85 46 sta temp5 3949 9029 3950 9029 a9 40 lda #(heofonfir_push_fire_banner_mode|%01000000) 3951 902b 85 47 sta temp6 3952 902d 3953 902d 20 c9 f2 jsr plotsprite 3954 9030 .L0170 ;; if joy0fire then debounce_fire = 5 3955 9030 3956 9030 2c 02 21 bit sINPT1 3957 9033 10 05 BPL .skipL0170 3958 9035 .condpart130 3959 9035 a9 05 LDA #5 3960 9037 8d 45 01 STA debounce_fire 3961 903a .skipL0170 3962 903a .L0171 ;; if !joy0fire && debounce_fire = 5 then debounce_fire = 6 3963 903a 3964 903a 2c 02 21 bit sINPT1 3965 903d 30 0c BMI .skipL0171 3966 903f .condpart131 3967 903f ad 45 01 LDA debounce_fire 3968 9042 c9 05 CMP #5 3969 9044 d0 05 BNE .skip131then 3970 9046 .condpart132 3971 9046 a9 06 LDA #6 3972 9048 8d 45 01 STA debounce_fire 3973 904b .skip131then 3974 904b .skipL0171 3975 904b .L0172 ;; if debounce_fire = 6 then debounce_fire = 0 : goto menuscreen 3976 904b 3977 904b ad 45 01 LDA debounce_fire 3978 904e c9 06 CMP #6 3979 9050 d0 08 BNE .skipL0172 3980 9052 .condpart133 3981 9052 a9 00 LDA #0 3982 9054 8d 45 01 STA debounce_fire 3983 9057 4c 0d 83 jmp .menuscreen 3984 905a 3985 905a .skipL0172 3986 905a .L0173 ;; drawscreen 3987 905a 3988 905a 20 b3 f0 jsr drawscreen 3989 905d .L0174 ;; goto titlescreenloop 3990 905d 3991 905d 4c 84 8e jmp .titlescreenloop 3992 9060 3993 9060 . 3994 9060 ;; 3995 9060 3996 9060 . 3997 9060 ;; 3998 9060 3999 9060 .initialise_gamescreen 4000 9060 ;; initialise_gamescreen 4001 9060 4002 9060 .L0175 ;; clearscreen 4003 9060 4004 9060 20 7f f0 jsr clearscreen 4005 9063 .L0176 ;; BACKGRND = $00 4006 9063 4007 9063 a9 00 LDA #$00 4008 9065 85 20 STA BACKGRND 4009 9067 . 4010 9067 ;; 4011 9067 4012 9067 .L0177 ;; savescreen 4013 9067 4014 9067 20 a3 f0 jsr savescreen 4015 906a .L0178 ;; return 4016 906a 4017 906a ba tsx 4018 906b bd 02 01 lda $102,x 4019 906e f0 01 beq bankswitchret29 4020 9070 60 RTS 4021 9071 bankswitchret29 4022 9071 4c 2c f4 JMP BS_return 4023 9074 . 4024 9074 ;; 4025 9074 4026 9074 .L0179 ;; data sfx_bling 4027 9074 4028 9074 4c ad 90 JMP .skipL0179 4029 9077 sfx_bling 4030 9077 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4031 907a 4032 907a 1c 04 07 .byte.b $1c,$04,$07 4033 907d 4034 907d 1b 04 07 .byte.b $1b,$04,$07 4035 9080 4036 9080 04 0f 05 .byte.b $04,$0f,$05 4037 9083 4038 9083 15 04 09 .byte.b $15,$04,$09 4039 9086 4040 9086 16 04 07 .byte.b $16,$04,$07 4041 9089 4042 9089 03 0f 04 .byte.b $03,$0f,$04 4043 908c 4044 908c 11 04 08 .byte.b $11,$04,$08 4045 908f 4046 908f 11 04 08 .byte.b $11,$04,$08 4047 9092 4048 9092 11 04 04 .byte.b $11,$04,$04 4049 9095 4050 9095 0e 04 09 .byte.b $0e,$04,$09 4051 9098 4052 9098 0e 04 07 .byte.b $0e,$04,$07 4053 909b 4054 909b 0e 04 04 .byte.b $0e,$04,$04 4055 909e 4056 909e 1c 04 07 .byte.b $1c,$04,$07 4057 90a1 4058 90a1 1b 04 05 .byte.b $1b,$04,$05 4059 90a4 4060 90a4 1c 04 04 .byte.b $1c,$04,$04 4061 90a7 4062 90a7 1b 04 02 .byte.b $1b,$04,$02 4063 90aa 4064 90aa 00 00 00 .byte.b $00,$00,$00 4065 90ad 4066 90ad .skipL0179 4067 90ad 00 36 sfx_bling_length = [. - sfx_bling] 4068 90ad sfx_bling_lo SET #sfx_bling 4070 90ad . 4071 90ad ;; 4072 90ad 4073 90ad .L0180 ;; data sfx_plainlaser 4074 90ad 4075 90ad 4c e0 90 JMP .skipL0180 4076 90b0 sfx_plainlaser 4077 90b0 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4078 90b3 4079 90b3 10 04 06 .byte.b $10,$04,$06 ; first chunk of freq,channel,volume 4080 90b6 4081 90b6 13 04 08 .byte.b $13,$04,$08 4082 90b9 4083 90b9 16 04 08 .byte.b $16,$04,$08 4084 90bc 4085 90bc 16 04 07 .byte.b $16,$04,$07 4086 90bf 4087 90bf 1c 04 09 .byte.b $1c,$04,$09 4088 90c2 4089 90c2 0b 0c 0f .byte.b $0b,$0c,$0f 4090 90c5 4091 90c5 0d 0c 0f .byte.b $0d,$0c,$0f 4092 90c8 4093 90c8 0e 0c 0f .byte.b $0e,$0c,$0f 4094 90cb 4095 90cb 0e 0c 0f .byte.b $0e,$0c,$0f 4096 90ce 4097 90ce 12 0c 0f .byte.b $12,$0c,$0f 4098 90d1 4099 90d1 03 06 0d .byte.b $03,$06,$0d 4100 90d4 4101 90d4 1e 0c 0a .byte.b $1e,$0c,$0a 4102 90d7 4103 90d7 1e 0c 0c .byte.b $1e,$0c,$0c 4104 90da 4105 90da 0a 06 04 .byte.b $0a,$06,$04 4106 90dd 4107 90dd 00 00 00 .byte.b $00,$00,$00 4108 90e0 4109 90e0 .skipL0180 4110 90e0 00 30 sfx_plainlaser_length = [. - sfx_plainlaser] 4111 90e0 sfx_plainlaser_lo SET #sfx_plainlaser 4113 90e0 DMAHOLEEND0 SET . 4114 90e0 gameend 4115 90e0 DMAHOLEEND0 SET . 3872 bytes of ROM space left in the main area of bank 1. 4116 90e0 echo " ",[($A000 - .)]d , "bytes of ROM space left in the main area of bank 1." 4117 90e0 - if ($A000 - .) < 0 4118 90e0 -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 4119 90e0 endif 4120 90e0 - if START_OF_ROM = . ; avoid dasm empty start-rom truncation. 4121 90e0 - .byte 0 4122 90e0 endif 4123 90e0 START_OF_ROM SET 0 ; scuttle so we always fail subsequent banks 4124 90e0 4125 a000 ORG $A000,0 ; ************* 4126 a000 4127 a000 RORG $A000 ; ************* 4128 a000 4129 a000 a0 00 heofonfir_logo_e = $A000 4130 a000 4131 a000 heofonfir_logo_e 4132 a000 15 00 01 00 HEX 15000100 4133 a000 a0 04 heofonfir_logo_e_tallsprite_00 = $A004 4134 a004 4135 a004 heofonfir_logo_e_tallsprite_00 4136 a004 00 00 00 00 HEX 00000000 4137 a004 a0 08 heofonfir_logo_f = $A008 4138 a008 4139 a008 heofonfir_logo_f 4140 a008 15 00 01 00 HEX 15000100 4141 a008 a0 0c heofonfir_logo_f_tallsprite_00 = $A00C 4142 a00c 4143 a00c heofonfir_logo_f_tallsprite_00 4144 a00c 00 00 00 00 HEX 00000000 4145 a00c a0 10 heofonfir_logo_h = $A010 4146 a010 4147 a010 heofonfir_logo_h 4148 a010 15 50 00 58 HEX 15500058 4149 a010 a0 14 heofonfir_logo_h_tallsprite_00 = $A014 4150 a014 4151 a014 heofonfir_logo_h_tallsprite_00 4152 a014 00 00 00 00 HEX 00000000 4153 a014 a0 18 heofonfir_logo_i = $A018 4154 a018 4155 a018 heofonfir_logo_i 4156 a018 00 05 80 00 HEX 00058000 4157 a018 a0 1c heofonfir_logo_i_tallsprite_00 = $A01C 4158 a01c 4159 a01c heofonfir_logo_i_tallsprite_00 4160 a01c 00 00 00 00 HEX 00000000 4161 a01c a0 20 heofonfir_logo_n = $A020 4162 a020 4163 a020 heofonfir_logo_n 4164 a020 15 00 40 58 HEX 15004058 4165 a020 a0 24 heofonfir_logo_n_tallsprite_00 = $A024 4166 a024 4167 a024 heofonfir_logo_n_tallsprite_00 4168 a024 00 00 00 00 HEX 00000000 4169 a024 a0 28 heofonfir_logo_o = $A028 4170 a028 4171 a028 heofonfir_logo_o 4172 a028 10 00 00 08 HEX 10000008 4173 a028 a0 2c heofonfir_logo_o_tallsprite_00 = $A02C 4174 a02c 4175 a02c heofonfir_logo_o_tallsprite_00 4176 a02c 00 00 00 00 HEX 00000000 4177 a02c a0 30 heofonfir_logo_r = $A030 4178 a030 4179 a030 heofonfir_logo_r 4180 a030 15 00 80 00 HEX 15008000 4181 a030 a0 34 heofonfir_logo_r_tallsprite_00 = $A034 4182 a034 4183 a034 heofonfir_logo_r_tallsprite_00 4184 a034 00 00 00 00 HEX 00000000 4185 a034 a0 38 heofonfir_push_fire_banner = $A038 4186 a038 4187 a038 heofonfir_push_fire_banner 4188 a038 00 00 00 00* HEX 00000000000000000000 4189 a038 a0 42 heofonfir_complete_font = $A042 4190 a042 4191 a042 heofonfir_complete_font 4192 a042 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4193 a062 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4194 a082 00 00 00 00* HEX 0000000000000000000000000000000000 4195 a093 4196 a100 ORG $A100,0 ; ************* 4197 a100 4198 a100 RORG $A100 ; ************* 4199 a100 4200 a100 ;heofonfir_logo_e 4201 a100 15 55 55 40 HEX 15555540 4202 a104 ;heofonfir_logo_e_tallsprite_00 4203 a104 00 00 00 00 HEX 00000000 4204 a108 ;heofonfir_logo_f 4205 a108 15 55 55 40 HEX 15555540 4206 a10c ;heofonfir_logo_f_tallsprite_00 4207 a10c 00 00 00 00 HEX 00000000 4208 a110 ;heofonfir_logo_h 4209 a110 15 95 00 58 HEX 15950058 4210 a114 ;heofonfir_logo_h_tallsprite_00 4211 a114 00 00 00 00 HEX 00000000 4212 a118 ;heofonfir_logo_i 4213 a118 00 05 80 00 HEX 00058000 4214 a11c ;heofonfir_logo_i_tallsprite_00 4215 a11c 00 00 00 00 HEX 00000000 4216 a120 ;heofonfir_logo_n 4217 a120 15 01 00 58 HEX 15010058 4218 a124 ;heofonfir_logo_n_tallsprite_00 4219 a124 00 00 00 00 HEX 00000000 4220 a128 ;heofonfir_logo_o 4221 a128 10 00 00 08 HEX 10000008 4222 a12c ;heofonfir_logo_o_tallsprite_00 4223 a12c 00 01 40 00 HEX 00014000 4224 a130 ;heofonfir_logo_r 4225 a130 15 01 00 00 HEX 15010000 4226 a134 ;heofonfir_logo_r_tallsprite_00 4227 a134 00 00 00 00 HEX 00000000 4228 a138 ;heofonfir_push_fire_banner 4229 a138 40 41 41 10* HEX 40414110004054401410 4230 a142 ;heofonfir_complete_font 4231 a142 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4232 a162 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4233 a182 00 00 00 00* HEX 0000000000000000000000000000000000 4234 a193 4235 a200 ORG $A200,0 ; ************* 4236 a200 4237 a200 RORG $A200 ; ************* 4238 a200 4239 a200 ;heofonfir_logo_e 4240 a200 15 aa aa a0 HEX 15aaaaa0 4241 a204 ;heofonfir_logo_e_tallsprite_00 4242 a204 01 00 00 00 HEX 01000000 4243 a208 ;heofonfir_logo_f 4244 a208 15 aa aa a0 HEX 15aaaaa0 4245 a20c ;heofonfir_logo_f_tallsprite_00 4246 a20c 01 00 00 00 HEX 01000000 4247 a210 ;heofonfir_logo_h 4248 a210 16 09 50 58 HEX 16095058 4249 a214 ;heofonfir_logo_h_tallsprite_00 4250 a214 01 00 00 08 HEX 01000008 4251 a218 ;heofonfir_logo_i 4252 a218 00 05 80 00 HEX 00058000 4253 a21c ;heofonfir_logo_i_tallsprite_00 4254 a21c 00 00 80 00 HEX 00008000 4255 a220 ;heofonfir_logo_n 4256 a220 15 01 00 58 HEX 15010058 4257 a224 ;heofonfir_logo_n_tallsprite_00 4258 a224 01 00 00 08 HEX 01000008 4259 a228 ;heofonfir_logo_o 4260 a228 10 00 00 08 HEX 10000008 4261 a22c ;heofonfir_logo_o_tallsprite_00 4262 a22c 00 16 54 00 HEX 00165400 4263 a230 ;heofonfir_logo_r 4264 a230 15 a9 00 00 HEX 15a90000 4265 a234 ;heofonfir_logo_r_tallsprite_00 4266 a234 01 00 00 80 HEX 01000080 4267 a238 ;heofonfir_push_fire_banner 4268 a238 41 10 11 10* HEX 41101110004010404000 4269 a242 ;heofonfir_complete_font 4270 a242 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4271 a262 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4272 a282 00 00 00 00* HEX 0000000000000000000000000000000000 4273 a293 4274 a300 ORG $A300,0 ; ************* 4275 a300 4276 a300 RORG $A300 ; ************* 4277 a300 4278 a300 ;heofonfir_logo_e 4279 a300 15 00 00 00 HEX 15000000 4280 a304 ;heofonfir_logo_e_tallsprite_00 4281 a304 01 00 00 00 HEX 01000000 4282 a308 ;heofonfir_logo_f 4283 a308 15 00 00 00 HEX 15000000 4284 a30c ;heofonfir_logo_f_tallsprite_00 4285 a30c 01 00 00 00 HEX 01000000 4286 a310 ;heofonfir_logo_h 4287 a310 16 00 95 58 HEX 16009558 4288 a314 ;heofonfir_logo_h_tallsprite_00 4289 a314 01 00 00 08 HEX 01000008 4290 a318 ;heofonfir_logo_i 4291 a318 00 05 80 00 HEX 00058000 4292 a31c ;heofonfir_logo_i_tallsprite_00 4293 a31c 00 00 80 00 HEX 00008000 4294 a320 ;heofonfir_logo_n 4295 a320 15 01 00 58 HEX 15010058 4296 a324 ;heofonfir_logo_n_tallsprite_00 4297 a324 01 00 00 08 HEX 01000008 4298 a328 ;heofonfir_logo_o 4299 a328 10 00 00 08 HEX 10000008 4300 a32c ;heofonfir_logo_o_tallsprite_00 4301 a32c 01 68 25 40 HEX 01682540 4302 a330 ;heofonfir_logo_r 4303 a330 16 00 94 00 HEX 16009400 4304 a334 ;heofonfir_logo_r_tallsprite_00 4305 a334 01 00 00 80 HEX 01000080 4306 a338 ;heofonfir_push_fire_banner 4307 a338 41 10 11 10* HEX 41101110004010404000 4308 a342 ;heofonfir_complete_font 4309 a342 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4310 a362 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4311 a382 00 00 00 00* HEX 0000000000000000000000000000000000 4312 a393 4313 a400 ORG $A400,0 ; ************* 4314 a400 4315 a400 RORG $A400 ; ************* 4316 a400 4317 a400 ;heofonfir_logo_e 4318 a400 15 00 00 00 HEX 15000000 4319 a404 ;heofonfir_logo_e_tallsprite_00 4320 a404 05 00 00 00 HEX 05000000 4321 a408 ;heofonfir_logo_f 4322 a408 15 00 00 00 HEX 15000000 4323 a40c ;heofonfir_logo_f_tallsprite_00 4324 a40c 05 00 00 00 HEX 05000000 4325 a410 ;heofonfir_logo_h 4326 a410 16 00 09 58 HEX 16000958 4327 a414 ;heofonfir_logo_h_tallsprite_00 4328 a414 05 00 00 18 HEX 05000018 4329 a418 ;heofonfir_logo_i 4330 a418 00 05 80 00 HEX 00058000 4331 a41c ;heofonfir_logo_i_tallsprite_00 4332 a41c 00 01 80 00 HEX 00018000 4333 a420 ;heofonfir_logo_n 4334 a420 15 04 00 58 HEX 15040058 4335 a424 ;heofonfir_logo_n_tallsprite_00 4336 a424 05 00 00 18 HEX 05000018 4337 a428 ;heofonfir_logo_o 4338 a428 10 00 00 08 HEX 10000008 4339 a42c ;heofonfir_logo_o_tallsprite_00 4340 a42c 01 80 01 40 HEX 01800140 4341 a430 ;heofonfir_logo_r 4342 a430 15 00 01 00 HEX 15000100 4343 a434 ;heofonfir_logo_r_tallsprite_00 4344 a434 05 00 00 80 HEX 05000080 4345 a438 ;heofonfir_push_fire_banner 4346 a438 41 10 51 10* HEX 41105110004010404010 4347 a442 ;heofonfir_complete_font 4348 a442 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4349 a462 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4350 a482 00 00 00 00* HEX 0000000000000000000000000000000000 4351 a493 4352 a500 ORG $A500,0 ; ************* 4353 a500 4354 a500 RORG $A500 ; ************* 4355 a500 4356 a500 ;heofonfir_logo_e 4357 a500 15 00 00 00 HEX 15000000 4358 a504 ;heofonfir_logo_e_tallsprite_00 4359 a504 05 00 00 00 HEX 05000000 4360 a508 ;heofonfir_logo_f 4361 a508 15 00 00 00 HEX 15000000 4362 a50c ;heofonfir_logo_f_tallsprite_00 4363 a50c 05 00 00 00 HEX 05000000 4364 a510 ;heofonfir_logo_h 4365 a510 16 00 00 58 HEX 16000058 4366 a514 ;heofonfir_logo_h_tallsprite_00 4367 a514 05 00 00 18 HEX 05000018 4368 a518 ;heofonfir_logo_i 4369 a518 00 05 80 00 HEX 00058000 4370 a51c ;heofonfir_logo_i_tallsprite_00 4371 a51c 00 01 80 00 HEX 00018000 4372 a520 ;heofonfir_logo_n 4373 a520 15 04 00 58 HEX 15040058 4374 a524 ;heofonfir_logo_n_tallsprite_00 4375 a524 05 00 00 18 HEX 05000018 4376 a528 ;heofonfir_logo_o 4377 a528 10 00 00 08 HEX 10000008 4378 a52c ;heofonfir_logo_o_tallsprite_00 4379 a52c 06 80 01 50 HEX 06800150 4380 a530 ;heofonfir_logo_r 4381 a530 15 00 00 40 HEX 15000040 4382 a534 ;heofonfir_logo_r_tallsprite_00 4383 a534 05 00 00 80 HEX 05000080 4384 a538 ;heofonfir_push_fire_banner 4385 a538 41 11 41 10* HEX 41114110004010405410 4386 a542 ;heofonfir_complete_font 4387 a542 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4388 a562 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4389 a582 00 00 00 00* HEX 0000000000000000000000000000000000 4390 a593 4391 a600 ORG $A600,0 ; ************* 4392 a600 4393 a600 RORG $A600 ; ************* 4394 a600 4395 a600 ;heofonfir_logo_e 4396 a600 15 00 00 00 HEX 15000000 4397 a604 ;heofonfir_logo_e_tallsprite_00 4398 a604 15 00 01 00 HEX 15000100 4399 a608 ;heofonfir_logo_f 4400 a608 15 00 00 00 HEX 15000000 4401 a60c ;heofonfir_logo_f_tallsprite_00 4402 a60c 15 00 00 00 HEX 15000000 4403 a610 ;heofonfir_logo_h 4404 a610 16 00 00 58 HEX 16000058 4405 a614 ;heofonfir_logo_h_tallsprite_00 4406 a614 15 00 00 58 HEX 15000058 4407 a618 ;heofonfir_logo_i 4408 a618 00 05 80 00 HEX 00058000 4409 a61c ;heofonfir_logo_i_tallsprite_00 4410 a61c 00 05 80 00 HEX 00058000 4411 a620 ;heofonfir_logo_n 4412 a620 15 04 00 58 HEX 15040058 4413 a624 ;heofonfir_logo_n_tallsprite_00 4414 a624 15 00 00 58 HEX 15000058 4415 a628 ;heofonfir_logo_o 4416 a628 10 00 00 08 HEX 10000008 4417 a62c ;heofonfir_logo_o_tallsprite_00 4418 a62c 08 00 00 10 HEX 08000010 4419 a630 ;heofonfir_logo_r 4420 a630 15 00 00 20 HEX 15000020 4421 a634 ;heofonfir_logo_r_tallsprite_00 4422 a634 15 00 02 00 HEX 15000200 4423 a638 ;heofonfir_push_fire_banner 4424 a638 41 11 01 10* HEX 41110110004010404410 4425 a642 ;heofonfir_complete_font 4426 a642 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4427 a662 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4428 a682 00 00 00 00* HEX 0000000000000000000000000000000000 4429 a693 4430 a700 ORG $A700,0 ; ************* 4431 a700 4432 a700 RORG $A700 ; ************* 4433 a700 4434 a700 ;heofonfir_logo_e 4435 a700 15 00 00 00 HEX 15000000 4436 a704 ;heofonfir_logo_e_tallsprite_00 4437 a704 15 55 55 40 HEX 15555540 4438 a708 ;heofonfir_logo_f 4439 a708 15 00 00 00 HEX 15000000 4440 a70c ;heofonfir_logo_f_tallsprite_00 4441 a70c 15 00 00 00 HEX 15000000 4442 a710 ;heofonfir_logo_h 4443 a710 16 00 00 58 HEX 16000058 4444 a714 ;heofonfir_logo_h_tallsprite_00 4445 a714 15 00 00 58 HEX 15000058 4446 a718 ;heofonfir_logo_i 4447 a718 00 05 80 00 HEX 00058000 4448 a71c ;heofonfir_logo_i_tallsprite_00 4449 a71c 00 05 80 00 HEX 00058000 4450 a720 ;heofonfir_logo_n 4451 a720 15 20 00 58 HEX 15200058 4452 a724 ;heofonfir_logo_n_tallsprite_00 4453 a724 15 00 01 58 HEX 15000158 4454 a728 ;heofonfir_logo_o 4455 a728 10 00 00 08 HEX 10000008 4456 a72c ;heofonfir_logo_o_tallsprite_00 4457 a72c 08 00 00 10 HEX 08000010 4458 a730 ;heofonfir_logo_r 4459 a730 15 00 00 20 HEX 15000020 4460 a734 ;heofonfir_logo_r_tallsprite_00 4461 a734 15 00 02 00 HEX 15000200 4462 a738 ;heofonfir_push_fire_banner 4463 a738 82 22 02 20* HEX 822202200080a0a08820 4464 a742 ;heofonfir_complete_font 4465 a742 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4466 a762 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4467 a782 00 00 00 00* HEX 0000000000000000000000000000000000 4468 a793 4469 a800 ORG $A800,0 ; ************* 4470 a800 4471 a800 RORG $A800 ; ************* 4472 a800 4473 a800 ;heofonfir_logo_e 4474 a800 15 00 00 00 HEX 15000000 4475 a804 ;heofonfir_logo_e_tallsprite_00 4476 a804 15 aa aa a0 HEX 15aaaaa0 4477 a808 ;heofonfir_logo_f 4478 a808 15 00 00 00 HEX 15000000 4479 a80c ;heofonfir_logo_f_tallsprite_00 4480 a80c 15 00 00 00 HEX 15000000 4481 a810 ;heofonfir_logo_h 4482 a810 16 00 00 58 HEX 16000058 4483 a814 ;heofonfir_logo_h_tallsprite_00 4484 a814 15 00 00 58 HEX 15000058 4485 a818 ;heofonfir_logo_i 4486 a818 00 05 80 00 HEX 00058000 4487 a81c ;heofonfir_logo_i_tallsprite_00 4488 a81c 00 05 80 00 HEX 00058000 4489 a820 ;heofonfir_logo_n 4490 a820 15 20 00 58 HEX 15200058 4491 a824 ;heofonfir_logo_n_tallsprite_00 4492 a824 15 00 04 58 HEX 15000458 4493 a828 ;heofonfir_logo_o 4494 a828 04 00 00 20 HEX 04000020 4495 a82c ;heofonfir_logo_o_tallsprite_00 4496 a82c 10 00 00 08 HEX 10000008 4497 a830 ;heofonfir_logo_r 4498 a830 15 00 00 20 HEX 15000020 4499 a834 ;heofonfir_logo_r_tallsprite_00 4500 a834 15 00 02 00 HEX 15000200 4501 a838 ;heofonfir_push_fire_banner 4502 a838 82 20 a2 80* HEX 8220a28000a820882020 4503 a842 ;heofonfir_complete_font 4504 a842 08 2a 2a 08* HEX 082a2a0802280802080822280a282a202a222a08222a22222a200a2228080808 4505 a862 22 22 08 2a* HEX 2222082a202020082020000a000000002002220808222a220000020808202a2a 4506 a882 22 0a 28 08* HEX 220a28082020202a08222a22082a08082a 4507 a893 4508 a900 ORG $A900,0 ; ************* 4509 a900 4510 a900 RORG $A900 ; ************* 4511 a900 4512 a900 ;heofonfir_logo_e 4513 a900 15 00 00 00 HEX 15000000 4514 a904 ;heofonfir_logo_e_tallsprite_00 4515 a904 15 00 00 00 HEX 15000000 4516 a908 ;heofonfir_logo_f 4517 a908 15 00 00 00 HEX 15000000 4518 a90c ;heofonfir_logo_f_tallsprite_00 4519 a90c 15 00 00 00 HEX 15000000 4520 a910 ;heofonfir_logo_h 4521 a910 16 00 00 58 HEX 16000058 4522 a914 ;heofonfir_logo_h_tallsprite_00 4523 a914 15 00 00 58 HEX 15000058 4524 a918 ;heofonfir_logo_i 4525 a918 00 15 80 00 HEX 00158000 4526 a91c ;heofonfir_logo_i_tallsprite_00 4527 a91c 00 05 80 00 HEX 00058000 4528 a920 ;heofonfir_logo_n 4529 a920 15 20 00 58 HEX 15200058 4530 a924 ;heofonfir_logo_n_tallsprite_00 4531 a924 15 00 04 58 HEX 15000458 4532 a928 ;heofonfir_logo_o 4533 a928 04 00 00 20 HEX 04000020 4534 a92c ;heofonfir_logo_o_tallsprite_00 4535 a92c 10 00 00 08 HEX 10000008 4536 a930 ;heofonfir_logo_r 4537 a930 15 40 00 20 HEX 15400020 4538 a934 ;heofonfir_logo_r_tallsprite_00 4539 a934 15 00 02 00 HEX 15000200 4540 a938 ;heofonfir_push_fire_banner 4541 a938 a0 00 02 00* HEX a0000200008000000020 4542 a942 ;heofonfir_complete_font 4543 a942 12 54 54 12* HEX 1254541206521206121266521452546056665412665466665660166652181218 4544 a962 66 66 18 54* HEX 66661854406040104060001408002a2248044412104454440000061210485456 4545 a982 65 16 52 11* HEX 6516521160606056126654661854181854 4546 a993 4547 aa00 ORG $AA00,0 ; ************* 4548 aa00 4549 aa00 RORG $AA00 ; ************* 4550 aa00 4551 aa00 ;heofonfir_logo_e 4552 aa00 15 00 00 00 HEX 15000000 4553 aa04 ;heofonfir_logo_e_tallsprite_00 4554 aa04 15 00 00 00 HEX 15000000 4555 aa08 ;heofonfir_logo_f 4556 aa08 15 00 00 00 HEX 15000000 4557 aa0c ;heofonfir_logo_f_tallsprite_00 4558 aa0c 15 00 00 00 HEX 15000000 4559 aa10 ;heofonfir_logo_h 4560 aa10 16 00 00 58 HEX 16000058 4561 aa14 ;heofonfir_logo_h_tallsprite_00 4562 aa14 15 00 00 58 HEX 15000058 4563 aa18 ;heofonfir_logo_i 4564 aa18 00 05 80 00 HEX 00058000 4565 aa1c ;heofonfir_logo_i_tallsprite_00 4566 aa1c 00 05 80 00 HEX 00058000 4567 aa20 ;heofonfir_logo_n 4568 aa20 15 80 00 58 HEX 15800058 4569 aa24 ;heofonfir_logo_n_tallsprite_00 4570 aa24 15 00 04 58 HEX 15000458 4571 aa28 ;heofonfir_logo_o 4572 aa28 04 00 00 20 HEX 04000020 4573 aa2c ;heofonfir_logo_o_tallsprite_00 4574 aa2c 10 00 00 08 HEX 10000008 4575 aa30 ;heofonfir_logo_r 4576 aa30 15 40 00 20 HEX 15400020 4577 aa34 ;heofonfir_logo_r_tallsprite_00 4578 aa34 15 00 08 00 HEX 15000800 4579 aa38 ;heofonfir_push_fire_banner 4580 aa38 88 00 02 00* HEX 88000200008020000020 4581 aa42 ;heofonfir_complete_font 4582 aa42 66 18 48 46* HEX 6618484606066606664666666066606066661846666066666660666606186612 4583 aa62 56 66 18 48* HEX 5666184800402008004000611800544412101044000000110000066460186006 4584 aa82 66 66 26 66* HEX 666626666a6860666666006612481a1812 4585 aa93 4586 ab00 ORG $AB00,0 ; ************* 4587 ab00 4588 ab00 RORG $AB00 ; ************* 4589 ab00 4590 ab00 ;heofonfir_logo_e 4591 ab00 15 00 01 00 HEX 15000100 4592 ab04 ;heofonfir_logo_e_tallsprite_00 4593 ab04 15 00 00 00 HEX 15000000 4594 ab08 ;heofonfir_logo_f 4595 ab08 15 00 01 00 HEX 15000100 4596 ab0c ;heofonfir_logo_f_tallsprite_00 4597 ab0c 15 00 00 00 HEX 15000000 4598 ab10 ;heofonfir_logo_h 4599 ab10 16 00 00 58 HEX 16000058 4600 ab14 ;heofonfir_logo_h_tallsprite_00 4601 ab14 15 00 00 58 HEX 15000058 4602 ab18 ;heofonfir_logo_i 4603 ab18 00 01 80 00 HEX 00018000 4604 ab1c ;heofonfir_logo_i_tallsprite_00 4605 ab1c 00 05 80 00 HEX 00058000 4606 ab20 ;heofonfir_logo_n 4607 ab20 15 80 00 58 HEX 15800058 4608 ab24 ;heofonfir_logo_n_tallsprite_00 4609 ab24 15 00 10 58 HEX 15001058 4610 ab28 ;heofonfir_logo_o 4611 ab28 01 40 01 80 HEX 01400180 4612 ab2c ;heofonfir_logo_o_tallsprite_00 4613 ab2c 10 00 00 08 HEX 10000008 4614 ab30 ;heofonfir_logo_r 4615 ab30 15 50 01 60 HEX 15500160 4616 ab34 ;heofonfir_logo_r_tallsprite_00 4617 ab34 15 00 08 00 HEX 15000800 4618 ab38 ;heofonfir_push_fire_banner 4619 ab38 88 00 02 00* HEX 88000200008000000020 4620 ab42 ;heofonfir_complete_font 4621 ab42 66 18 18 04* HEX 66181804260464064406666460666a6866661806646066666668666404186666 4622 ab62 56 44 1a 18* HEX 56441a1800006018000000441a2a001a04400000000000000000064860186006 4623 ab82 66 46 44 66* HEX 664644665652606666662a666612561a66 4624 ab93 4625 ac00 ORG $AC00,0 ; ************* 4626 ac00 4627 ac00 RORG $AC00 ; ************* 4628 ac00 4629 ac00 ;heofonfir_logo_e 4630 ac00 55 55 55 40 HEX 55555540 4631 ac04 ;heofonfir_logo_e_tallsprite_00 4632 ac04 15 00 00 00 HEX 15000000 4633 ac08 ;heofonfir_logo_f 4634 ac08 55 55 55 40 HEX 55555540 4635 ac0c ;heofonfir_logo_f_tallsprite_00 4636 ac0c 15 00 00 00 HEX 15000000 4637 ac10 ;heofonfir_logo_h 4638 ac10 56 00 01 58 HEX 56000158 4639 ac14 ;heofonfir_logo_h_tallsprite_00 4640 ac14 15 00 00 58 HEX 15000058 4641 ac18 ;heofonfir_logo_i 4642 ac18 00 00 80 00 HEX 00008000 4643 ac1c ;heofonfir_logo_i_tallsprite_00 4644 ac1c 00 05 80 00 HEX 00058000 4645 ac20 ;heofonfir_logo_n 4646 ac20 55 80 01 58 HEX 55800158 4647 ac24 ;heofonfir_logo_n_tallsprite_00 4648 ac24 15 00 10 58 HEX 15001058 4649 ac28 ;heofonfir_logo_o 4650 ac28 01 40 01 80 HEX 01400180 4651 ac2c ;heofonfir_logo_o_tallsprite_00 4652 ac2c 10 00 00 08 HEX 10000008 4653 ac30 ;heofonfir_logo_r 4654 ac30 55 54 16 80 HEX 55541680 4655 ac34 ;heofonfir_logo_r_tallsprite_00 4656 ac34 15 00 08 00 HEX 15000800 4657 ac38 ;heofonfir_push_fire_banner 4658 ac38 cc 00 03 00* HEX cc00030000c000000030 4659 ac42 ;heofonfir_complete_font 4660 ac42 66 18 12 58* HEX 6618125856505006121656526066545064561806526056666652665210186666 4661 ac62 66 12 56 18* HEX 6612561800006012000000125454005400000000000000002800061860186006 4662 ac82 55 16 12 65* HEX 5516126566666066564454666604565666 4663 ac93 4664 ad00 ORG $AD00,0 ; ************* 4665 ad00 4666 ad00 RORG $AD00 ; ************* 4667 ad00 4668 ad00 ;heofonfir_logo_e 4669 ad00 15 aa aa a0 HEX 15aaaaa0 4670 ad04 ;heofonfir_logo_e_tallsprite_00 4671 ad04 15 00 00 00 HEX 15000000 4672 ad08 ;heofonfir_logo_f 4673 ad08 15 aa aa a0 HEX 15aaaaa0 4674 ad0c ;heofonfir_logo_f_tallsprite_00 4675 ad0c 15 00 00 00 HEX 15000000 4676 ad10 ;heofonfir_logo_h 4677 ad10 16 00 00 58 HEX 16000058 4678 ad14 ;heofonfir_logo_h_tallsprite_00 4679 ad14 15 00 00 58 HEX 15000058 4680 ad18 ;heofonfir_logo_i 4681 ad18 00 00 00 00 HEX 00000000 4682 ad1c ;heofonfir_logo_i_tallsprite_00 4683 ad1c 00 05 80 00 HEX 00058000 4684 ad20 ;heofonfir_logo_n 4685 ad20 16 00 00 58 HEX 16000058 4686 ad24 ;heofonfir_logo_n_tallsprite_00 4687 ad24 15 00 10 58 HEX 15001058 4688 ad28 ;heofonfir_logo_o 4689 ad28 01 54 16 80 HEX 01541680 4690 ad2c ;heofonfir_logo_o_tallsprite_00 4691 ad2c 10 00 00 08 HEX 10000008 4692 ad30 ;heofonfir_logo_r 4693 ad30 16 15 68 00 HEX 16156800 4694 ad34 ;heofonfir_logo_r_tallsprite_00 4695 ad34 15 00 20 00 HEX 15002000 4696 ad38 ;heofonfir_push_fire_banner 4697 ad38 88 00 02 00* HEX 88000200008000000020 4698 ad42 ;heofonfir_complete_font 4699 ad42 66 18 26 12* HEX 6618261266606006666666666066606060661806666056666666666660186666 4700 ad62 66 66 66 12* HEX 66666612000060260000006618002a1200000000000000005202041060186006 4701 ad82 66 06 26 66* HEX 6606266654666044661800666610545666 4702 ad93 4703 ae00 ORG $AE00,0 ; ************* 4704 ae00 4705 ae00 RORG $AE00 ; ************* 4706 ae00 4707 ae00 ;heofonfir_logo_e 4708 ae00 06 00 00 00 HEX 06000000 4709 ae04 ;heofonfir_logo_e_tallsprite_00 4710 ae04 15 00 00 00 HEX 15000000 4711 ae08 ;heofonfir_logo_f 4712 ae08 06 00 00 00 HEX 06000000 4713 ae0c ;heofonfir_logo_f_tallsprite_00 4714 ae0c 15 00 00 00 HEX 15000000 4715 ae10 ;heofonfir_logo_h 4716 ae10 06 00 00 18 HEX 06000018 4717 ae14 ;heofonfir_logo_h_tallsprite_00 4718 ae14 15 00 00 58 HEX 15000058 4719 ae18 ;heofonfir_logo_i 4720 ae18 0a aa aa a0 HEX 0aaaaaa0 4721 ae1c ;heofonfir_logo_i_tallsprite_00 4722 ae1c 00 05 80 00 HEX 00058000 4723 ae20 ;heofonfir_logo_n 4724 ae20 06 00 00 18 HEX 06000018 4725 ae24 ;heofonfir_logo_n_tallsprite_00 4726 ae24 15 00 40 58 HEX 15004058 4727 ae28 ;heofonfir_logo_o 4728 ae28 00 15 68 00 HEX 00156800 4729 ae2c ;heofonfir_logo_o_tallsprite_00 4730 ae2c 10 00 00 08 HEX 10000008 4731 ae30 ;heofonfir_logo_r 4732 ae30 06 0a 80 00 HEX 060a8000 4733 ae34 ;heofonfir_logo_r_tallsprite_00 4734 ae34 15 00 20 00 HEX 15002000 4735 ae38 ;heofonfir_push_fire_banner 4736 ae38 88 00 00 00* HEX 88000000008000000020 4737 ae42 ;heofonfir_complete_font 4738 ae42 44 58 44 26* HEX 44584426666a4a26444444644a646a6a4a661a0666605664666444644a1a6666 4739 ae62 66 66 66 26* HEX 6666662600004044202000441000544400000000000000000406020848106a26 4740 ae82 64 16 44 44* HEX 6416444460666a1844182a66446a185644 4741 ae93 4742 af00 ORG $AF00,0 ; ************* 4743 af00 4744 af00 RORG $AF00 ; ************* 4745 af00 4746 af00 ;heofonfir_logo_e 4747 af00 02 00 00 00 HEX 02000000 4748 af04 ;heofonfir_logo_e_tallsprite_00 4749 af04 15 00 00 00 HEX 15000000 4750 af08 ;heofonfir_logo_f 4751 af08 02 00 00 00 HEX 02000000 4752 af0c ;heofonfir_logo_f_tallsprite_00 4753 af0c 15 00 00 00 HEX 15000000 4754 af10 ;heofonfir_logo_h 4755 af10 02 00 00 08 HEX 02000008 4756 af14 ;heofonfir_logo_h_tallsprite_00 4757 af14 15 00 00 58 HEX 15000058 4758 af18 ;heofonfir_logo_i 4759 af18 00 00 00 00 HEX 00000000 4760 af1c ;heofonfir_logo_i_tallsprite_00 4761 af1c 00 05 80 00 HEX 00058000 4762 af20 ;heofonfir_logo_n 4763 af20 02 00 00 08 HEX 02000008 4764 af24 ;heofonfir_logo_n_tallsprite_00 4765 af24 15 00 40 58 HEX 15004058 4766 af28 ;heofonfir_logo_o 4767 af28 00 02 80 00 HEX 00028000 4768 af2c ;heofonfir_logo_o_tallsprite_00 4769 af2c 10 00 00 08 HEX 10000008 4770 af30 ;heofonfir_logo_r 4771 af30 02 00 00 00 HEX 02000000 4772 af34 ;heofonfir_logo_r_tallsprite_00 4773 af34 15 00 80 00 HEX 15008000 4774 af38 ;heofonfir_push_fire_banner 4775 af38 50 00 00 00* HEX 50000000005400000010 4776 af42 ;heofonfir_complete_font 4777 af42 10 10 10 54* HEX 1010105444541454101010501450545414445404444044505450105014544444 4778 af62 44 44 44 54* HEX 4444445400000010404000100000000000000000000000001004041010405454 4779 af82 11 04 10 11* HEX 1104101140545410101054541054104410 4780 af93 4781 b000 ORG $B000,0 ; ************* 4782 b000 4783 b000 RORG $B000 ; ************* 4784 b000 - if SPACEOVERFLOW > 0 4785 b000 - echo "" 4786 b000 - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 4787 b000 - echo "######## look above for areas with negative ROM space left." 4788 b000 - echo "######## Aborting assembly." 4789 b000 - ERR 4790 b000 endif 4791 b000 4792 b000 4793 b000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 4794 b000 4795 b000 - ifnconst bankswitchmode 4796 b000 - if ( * < $f000 ) 4797 b000 - ORG $F000 4798 b000 - endif 4799 b000 else 4800 b000 ifconst ROM128K 4801 b000 if ( * < $f000 ) 4802 27000 ORG $27000 4803 27000 RORG $F000 4804 27000 endif 4805 27000 endif 4806 27000 - ifconst ROM144K 4807 27000 - if ( * < $f000 ) 4808 27000 - ORG $27000 4809 27000 - RORG $F000 4810 27000 - endif 4811 27000 endif 4812 27000 - ifconst ROM256K 4813 27000 - if ( * < $f000 ) 4814 27000 - ORG $47000 4815 27000 - RORG $F000 4816 27000 - endif 4817 27000 endif 4818 27000 - ifconst ROM272K 4819 27000 - if ( * < $f000 ) 4820 27000 - ORG $47000 4821 27000 - RORG $F000 4822 27000 - endif 4823 27000 endif 4824 27000 - ifconst ROM512K 4825 27000 - if ( * < $f000 ) 4826 27000 - ORG $87000 4827 27000 - RORG $F000 4828 27000 - endif 4829 27000 endif 4830 27000 - ifconst ROM528K 4831 27000 - if ( * < $f000 ) 4832 27000 - ORG $87000 4833 27000 - RORG $F000 4834 27000 - endif 4835 27000 endif 4836 27000 endif 4837 27000 4838 27000 ; all of these "modules" have conditional clauses in them, so even though 4839 27000 ; they're always included here, they don't take up rom unless the user 4840 27000 ; explicitly enables support for the feature. 4841 27000 4842 27000 ifnconst included.rmtplayer.asm ------- FILE rmtplayer.asm LEVEL 2 PASS 3 0 27000 include rmtplayer.asm ; requires page alignment, so go first 1 27000 - ifconst RMT 2 27000 - 3 27000 -rmtmodulestart 4 27000 - 5 27000 - ;* 6 27000 - ;* Raster Music Tracker, RMT Atari routine version 1.20030223 7 27000 - ;* (c) Radek Sterba, Raster/C.P.U., 2002 - 2003 8 27000 - ;* http://raster.atari.org 9 27000 - ;* 10 27000 - ;* Some small changes to allow using this code with DASM cross assembler and 11 27000 - ;* to compile for cartridge based systems, like the Atari 5200 or Atari 7800, 12 27000 - ;* by Eckhard Stolberg ( http://home.arcor.de/estolberg/ ). 13 27000 - ;* 14 27000 - ;* Warnings: 15 27000 - ;* 16 27000 - ;* 1. RMT player routine needs 19 itself reserved bytes in zero page (no accessed 17 27000 - ;* from any other routines) as well as cca 1KB of memory before the "PLAYER" 18 27000 - ;* address for frequency tables and functionary variables. It's: 19 27000 - ;* a) from PLAYER-$400 to PLAYER for stereo RMTplayer 20 27000 - ;* b) from PLAYER-$380 to PLAYER for mono RMTplayer 21 27000 - ;* 22 27000 - ;* note: This has been changed for 5200 & 7800 compatibility. Now PLAYER points 23 27000 - ;* to the start of the frequency tables. The player routines follows after 24 27000 - ;* that. The variables are now independent and can be located with 25 27000 - ;* PLAYER_VAR_RAM and PLAYER_ZP_RAM (see below): 26 27000 - ;* 27 27000 - ;* 2. RMT player routine MUST (!!!) be compiled from the begin of the memory page. 28 27000 - ;* i.e. "PLAYER" address can be $..00 only! 29 27000 - ;* 30 27000 - ;* 3. Because of RMTplayer provides a lot of effects, it spent a lot of CPU time. 31 27000 - ;* 32 27000 - ;* 33 27000 - ;* Define the following equates here or in your main code file. 34 27000 - ;* Set the values according to the system you compile for. 35 27000 - ;* 36 27000 - 37 27000 -POKEY_BASE equ pokeyaddress 38 27000 -PLAYER_ZP_RAM equ songchannel1layer1lo ; player routine needs 19 bytes of zero page RAM 39 27000 -PLAYER_VAR_RAM equ RMTRAM ;variables in main RAM - 173 bytes mono - 337 stereo 40 27000 -ROM_BASED equ 1 ;using a ROM based system - no self modifying code 41 27000 -STEREO8T equ 0 ;0 => compile RMTplayer for mono 4 tracks 42 27000 - ; ;1 => compile RMTplayer for stereo 8 tracks 43 27000 - 44 27000 -rmt_ispeed equ PLAYER_ZP_RAM+19 45 27000 -rmt_intcount equ PLAYER_ZP_RAM+20 46 27000 - 47 27000 - ;* 48 27000 - 49 27000 - IF STEREO8T 50 27000 -TRACKS equ 8 51 27000 - ELSE 52 27000 -TRACKS equ 4 53 27000 - EIF 54 27000 - 55 27000 - ;* 56 27000 - ;* RMT FEATures definitions 57 27000 - ;* For optimizations of RMT player routine to concrete RMT modul only! 58 27000 - ;* --------BEGIN-------- 59 27000 -FEAT_COMMAND1 equ 1 ;* cca 8 bytes 60 27000 -FEAT_COMMAND2 equ 1 ;* cca 20 bytes (+save 1 address in zero page) and quicker whole RMT routine 61 27000 -FEAT_COMMAND3 equ 1 ;* cca 12 bytes 62 27000 -FEAT_COMMAND4 equ 1 ;* cca 15 bytes 63 27000 -FEAT_COMMAND5 equ 1 ;* cca 67 bytes 64 27000 -FEAT_COMMAND6 equ 1 ;* cca 15 bytes 65 27000 - ;* COMMAND7 SETNOTE (i.e. command 7 with parameter != $80) 66 27000 -FEAT_COMMAND7SETNOTE equ 1 ;* cca 12 bytes 67 27000 - ;* COMMAND7 VOLUMEONLY (i.e. command 7 with parameter == $80) 68 27000 -FEAT_COMMAND7VOLUMEONLY equ 1 ;* cca 74 bytes 69 27000 - ;* PORTAMENTO 70 27000 -FEAT_PORTAMENTO equ 1 ;* cca 138 bytes and quicker whole RMT routine 71 27000 - ;* FILTER 72 27000 -FEAT_FILTER equ 1 ;* cca 179 bytes and quicker whole RMT routine 73 27000 -FEAT_FILTERG0L equ 1 ;* (cca 38 bytes for each) 74 27000 -FEAT_FILTERG1L equ 1 75 27000 -FEAT_FILTERG0R equ 1 76 27000 -FEAT_FILTERG1R equ 1 77 27000 - ;* BASS16B (i.e. distortion value 6) 78 27000 -FEAT_BASS16 equ 1 ;* cca 194 bytes +128bytes freq table and quicker whole RMT routine 79 27000 -FEAT_BASS16G1L equ 1 ;* (cca 47 bytes for each) 80 27000 -FEAT_BASS16G3L equ 1 81 27000 -FEAT_BASS16G1R equ 1 82 27000 -FEAT_BASS16G3R equ 1 83 27000 - ;* VOLUME ONLY for particular generators 84 27000 -FEAT_VOLUMEONLYG0L equ 1 ;* (cca 7 bytes for each) 85 27000 -FEAT_VOLUMEONLYG2L equ 1 86 27000 -FEAT_VOLUMEONLYG3L equ 1 87 27000 -FEAT_VOLUMEONLYG0R equ 1 88 27000 -FEAT_VOLUMEONLYG2R equ 1 89 27000 -FEAT_VOLUMEONLYG3R equ 1 90 27000 - ;* TABLE TYPE (i.e. TABLETYPE=1) 91 27000 -FEAT_TABLETYPE equ 1 ;* cca 53 bytes and quicker whole RMT routine 92 27000 - ;* TABLE MODE (i.e. TABLEMODE=1) 93 27000 -FEAT_TABLEMODE equ 1 ;* cca 16 bytes and quicker whole RMT routine 94 27000 - ;* AUDCTLMANUALSET (i.e. any MANUAL AUDCTL setting to nonzero value) 95 27000 -FEAT_AUDCTLMANUALSET equ 1 ;* cca 27 bytes and quicker whole RMT routine 96 27000 - ;* --------END-------- 97 27000 - ;* 98 27000 - ;* 99 27000 - ;* RMT ZeroPage addresses 100 27000 - 101 27000 -MEMLOC SET PLAYER_ZP_RAM 102 27000 -p_tis = MEMLOC 103 27000 -p_instrstable = MEMLOC 104 27000 -MEMLOC SET (MEMLOC+2) 105 27000 -p_trackslbstable = MEMLOC 106 27000 -MEMLOC SET (MEMLOC+2) 107 27000 -p_trackshbstable = MEMLOC 108 27000 -MEMLOC SET (MEMLOC+2) 109 27000 -p_song = MEMLOC 110 27000 -MEMLOC SET (MEMLOC+2) 111 27000 - 112 27000 -_ns = MEMLOC 113 27000 -MEMLOC SET (MEMLOC+2) 114 27000 -_nr = MEMLOC 115 27000 -MEMLOC SET (MEMLOC+2) 116 27000 -_nt = MEMLOC 117 27000 -MEMLOC SET (MEMLOC+2) 118 27000 - 119 27000 -rmtreg1 = MEMLOC 120 27000 -MEMLOC SET (MEMLOC+1) 121 27000 -rmtreg2 = MEMLOC 122 27000 -MEMLOC SET (MEMLOC+1) 123 27000 -rmtreg3 = MEMLOC 124 27000 -MEMLOC SET (MEMLOC+1) 125 27000 -_tmp = MEMLOC 126 27000 -MEMLOC SET (MEMLOC+1) 127 27000 - IF FEAT_COMMAND2 128 27000 -frqaddcmd2 = MEMLOC 129 27000 -MEMLOC SET (MEMLOC+1) 130 27000 - EIF 131 27000 - 132 27000 - ;* 133 27000 - ;* Variables in main RAM used by player routine. 134 27000 - ;* 337 bytes for stereo - 173 bytes for mono 135 27000 - ;* 136 27000 - 137 27000 -MEMLOC SET PLAYER_VAR_RAM 138 27000 -track_variables = MEMLOC 139 27000 - 140 27000 -trackn_db = MEMLOC 141 27000 -MEMLOC SET (MEMLOC+TRACKS) 142 27000 -trackn_hb = MEMLOC 143 27000 -MEMLOC SET (MEMLOC+TRACKS) 144 27000 -trackn_idx = MEMLOC 145 27000 -MEMLOC SET (MEMLOC+TRACKS) 146 27000 -trackn_pause = MEMLOC 147 27000 -MEMLOC SET (MEMLOC+TRACKS) 148 27000 -trackn_note = MEMLOC 149 27000 -MEMLOC SET (MEMLOC+TRACKS) 150 27000 -trackn_volume = MEMLOC 151 27000 -MEMLOC SET (MEMLOC+TRACKS) 152 27000 -trackn_distor = MEMLOC 153 27000 -MEMLOC SET (MEMLOC+TRACKS) 154 27000 -trackn_shiftfrq = MEMLOC 155 27000 -MEMLOC SET (MEMLOC+TRACKS) 156 27000 - 157 27000 - IF FEAT_PORTAMENTO 158 27000 -trackn_portafrqc = MEMLOC 159 27000 -MEMLOC SET (MEMLOC+TRACKS) 160 27000 -trackn_portafrqa = MEMLOC 161 27000 -MEMLOC SET (MEMLOC+TRACKS) 162 27000 -trackn_portaspeed = MEMLOC 163 27000 -MEMLOC SET (MEMLOC+TRACKS) 164 27000 -trackn_portaspeeda = MEMLOC 165 27000 -MEMLOC SET (MEMLOC+TRACKS) 166 27000 -trackn_portadepth = MEMLOC 167 27000 -MEMLOC SET (MEMLOC+TRACKS) 168 27000 - EIF 169 27000 - 170 27000 -trackn_instrx2 = MEMLOC 171 27000 -MEMLOC SET (MEMLOC+TRACKS) 172 27000 -trackn_instrdb = MEMLOC 173 27000 -MEMLOC SET (MEMLOC+TRACKS) 174 27000 -trackn_instrhb = MEMLOC 175 27000 -MEMLOC SET (MEMLOC+TRACKS) 176 27000 -trackn_instridx = MEMLOC 177 27000 -MEMLOC SET (MEMLOC+TRACKS) 178 27000 -trackn_instrlen = MEMLOC 179 27000 -MEMLOC SET (MEMLOC+TRACKS) 180 27000 -trackn_instrlop = MEMLOC 181 27000 -MEMLOC SET (MEMLOC+TRACKS) 182 27000 -trackn_instrreachend = MEMLOC 183 27000 -MEMLOC SET (MEMLOC+TRACKS) 184 27000 -trackn_volumeslidedepth = MEMLOC 185 27000 -MEMLOC SET (MEMLOC+TRACKS) 186 27000 -trackn_volumeslidevalue = MEMLOC 187 27000 -MEMLOC SET (MEMLOC+TRACKS) 188 27000 -trackn_volumemin = MEMLOC 189 27000 -MEMLOC SET (MEMLOC+TRACKS) 190 27000 -trackn_effdelay = MEMLOC 191 27000 -MEMLOC SET (MEMLOC+TRACKS) 192 27000 -trackn_effvibratoa = MEMLOC 193 27000 -MEMLOC SET (MEMLOC+TRACKS) 194 27000 -trackn_effvibratobeg = MEMLOC 195 27000 -MEMLOC SET (MEMLOC+TRACKS) 196 27000 -trackn_effvibratoend = MEMLOC 197 27000 -MEMLOC SET (MEMLOC+TRACKS) 198 27000 -trackn_effshift = MEMLOC 199 27000 -MEMLOC SET (MEMLOC+TRACKS) 200 27000 -trackn_tabletypespeed = MEMLOC 201 27000 -MEMLOC SET (MEMLOC+TRACKS) 202 27000 - 203 27000 - IF FEAT_TABLEMODE 204 27000 -trackn_tablemode = MEMLOC 205 27000 -MEMLOC SET (MEMLOC+TRACKS) 206 27000 - EIF 207 27000 - 208 27000 -trackn_tablenote = MEMLOC 209 27000 -MEMLOC SET (MEMLOC+TRACKS) 210 27000 - 211 27000 -trackn_tablea = MEMLOC 212 27000 -MEMLOC SET (MEMLOC+TRACKS) 213 27000 -trackn_tableend = MEMLOC 214 27000 -MEMLOC SET (MEMLOC+TRACKS) 215 27000 -trackn_tablelop = MEMLOC 216 27000 -MEMLOC SET (MEMLOC+TRACKS) 217 27000 -trackn_tablespeeda = MEMLOC 218 27000 -MEMLOC SET (MEMLOC+TRACKS) 219 27000 -trackn_command = MEMLOC 220 27000 -MEMLOC SET (MEMLOC+TRACKS) 221 27000 - 222 27000 - IF FEAT_BASS16 223 27000 -trackn_outnote = MEMLOC 224 27000 -MEMLOC SET (MEMLOC+TRACKS) 225 27000 - EIF 226 27000 - IF FEAT_FILTER 227 27000 -trackn_filter = MEMLOC 228 27000 -MEMLOC SET (MEMLOC+TRACKS) 229 27000 - EIF 230 27000 - 231 27000 -trackn_audf = MEMLOC 232 27000 -MEMLOC SET (MEMLOC+TRACKS) 233 27000 -trackn_audc = MEMLOC 234 27000 -MEMLOC SET (MEMLOC+TRACKS) 235 27000 - 236 27000 - IF FEAT_AUDCTLMANUALSET 237 27000 -trackn_audctl = MEMLOC 238 27000 -MEMLOC SET (MEMLOC+TRACKS) 239 27000 - EIF 240 27000 - 241 27000 -v_audctl = MEMLOC 242 27000 -MEMLOC SET (MEMLOC+1) 243 27000 -v_audctl2 = MEMLOC 244 27000 -MEMLOC SET (MEMLOC+1) 245 27000 -v_speed = MEMLOC 246 27000 -MEMLOC SET (MEMLOC+1) 247 27000 -v_aspeed = MEMLOC 248 27000 -MEMLOC SET (MEMLOC+1) 249 27000 -v_bspeed = MEMLOC 250 27000 -MEMLOC SET (MEMLOC+1) 251 27000 -v_instrspeed = MEMLOC 252 27000 -MEMLOC SET (MEMLOC+1) 253 27000 -v_ainstrspeed = MEMLOC 254 27000 -MEMLOC SET (MEMLOC+1) 255 27000 -v_maxtracklen = MEMLOC 256 27000 -MEMLOC SET (MEMLOC+1) 257 27000 -v_abeat = MEMLOC 258 27000 -MEMLOC SET (MEMLOC+1) 259 27000 - 260 27000 -track_endvariables = MEMLOC 261 27000 - 262 27000 - ;* 263 27000 - ;* Data tables used by player routine. 264 27000 - ;* 265 27000 - ALIGN 256 266 27000 -PLAYER = . 267 27000 - 268 27000 -volumetab 269 27000 - dc.b $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 270 27000 - dc.b $00,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01 271 27000 - dc.b $00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$02,$02,$02,$02 272 27000 - dc.b $00,$00,$00,$01,$01,$01,$01,$01,$02,$02,$02,$02,$02,$03,$03,$03 273 27000 - dc.b $00,$00,$01,$01,$01,$01,$02,$02,$02,$02,$03,$03,$03,$03,$04,$04 274 27000 - dc.b $00,$00,$01,$01,$01,$02,$02,$02,$03,$03,$03,$04,$04,$04,$05,$05 275 27000 - dc.b $00,$00,$01,$01,$02,$02,$02,$03,$03,$04,$04,$04,$05,$05,$06,$06 276 27000 - dc.b $00,$00,$01,$01,$02,$02,$03,$03,$04,$04,$05,$05,$06,$06,$07,$07 277 27000 - dc.b $00,$01,$01,$02,$02,$03,$03,$04,$04,$05,$05,$06,$06,$07,$07,$08 278 27000 - dc.b $00,$01,$01,$02,$02,$03,$04,$04,$05,$05,$06,$07,$07,$08,$08,$09 279 27000 - dc.b $00,$01,$01,$02,$03,$03,$04,$05,$05,$06,$07,$07,$08,$09,$09,$0A 280 27000 - dc.b $00,$01,$01,$02,$03,$04,$04,$05,$06,$07,$07,$08,$09,$0A,$0A,$0B 281 27000 - dc.b $00,$01,$02,$02,$03,$04,$05,$06,$06,$07,$08,$09,$0A,$0A,$0B,$0C 282 27000 - dc.b $00,$01,$02,$03,$03,$04,$05,$06,$07,$08,$09,$0A,$0A,$0B,$0C,$0D 283 27000 - dc.b $00,$01,$02,$03,$04,$05,$06,$07,$07,$08,$09,$0A,$0B,$0C,$0D,$0E 284 27000 - dc.b $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0A,$0B,$0C,$0D,$0E,$0F 285 27000 - 286 27000 -frqtab 287 27000 - ; ERT [255 355 27000 - ldy #0 356 27000 - tya 357 27000 -rmtri0 sta track_variables,y 358 27000 - sta track_endvariables-$100,y 359 27000 - iny 360 27000 - bne rmtri0 361 27000 - ELSE 362 27000 - ldy #track_endvariables-track_variables 363 27000 - lda #0 364 27000 -rmtri0 sta track_variables-1,y 365 27000 - dey 366 27000 - bne rmtri0 367 27000 - EIF 368 27000 - ldy #4 369 27000 - lda (_ns),y 370 27000 - sta v_maxtracklen 371 27000 - iny 372 27000 - lda (_ns),y 373 27000 - sta v_speed 374 27000 - iny 375 27000 - lda (_ns),y 376 27000 - sta v_instrspeed 377 27000 - sta v_ainstrspeed 378 27000 - ldy #8 379 27000 -rmtri1 lda (_ns),y 380 27000 - sta p_tis-8,y 381 27000 - iny 382 27000 - cpy #8+8 383 27000 - bne rmtri1 384 27000 - pla 385 27000 - pha 386 27000 - IF STEREO8T 387 27000 - asl 388 27000 - asl 389 27000 - asl 390 27000 - clc 391 27000 - adc p_song 392 27000 - sta p_song 393 27000 - pla 394 27000 - and #$e0 395 27000 - asl 396 27000 - rol 397 27000 - rol 398 27000 - rol 399 27000 - ELSE 400 27000 - asl 401 27000 - asl 402 27000 - clc 403 27000 - adc p_song 404 27000 - sta p_song 405 27000 - pla 406 27000 - and #$c0 407 27000 - asl 408 27000 - rol 409 27000 - rol 410 27000 - EIF 411 27000 - adc p_song+1 412 27000 - sta p_song+1 413 27000 - jsr GetSongLine 414 27000 - jsr GetTrackLine 415 27000 - jsr InitOfNewSetInstrumentsOnly 416 27000 - jsr rmt_silence 417 27000 - lda v_instrspeed 418 27000 - rts 419 27000 -rmt_silence 420 27000 - IF STEREO8T 421 27000 - lda #0 422 27000 - sta POKEY_BASE+$08 423 27000 - sta POKEY_BASE_S+$08 424 27000 - ldy #3 425 27000 - sty POKEY_BASE+$0f 426 27000 - sty POKEY_BASE_S+$0f 427 27000 - ldy #8 428 27000 -rmtsi1 sta POKEY_BASE+$00,y 429 27000 - sta POKEY_BASE_S+$00,y 430 27000 - dey 431 27000 - bpl rmtsi1 432 27000 - ELSE 433 27000 - lda #0 434 27000 - sta POKEY_BASE+$08 435 27000 - ldy #3 436 27000 - sty POKEY_BASE+$0f 437 27000 - ldy #8 438 27000 -rmtsi1 sta POKEY_BASE+$00,y 439 27000 - dey 440 27000 - bpl rmtsi1 441 27000 - EIF 442 27000 - rts 443 27000 -GetSongLine 444 27000 - ldx #0 445 27000 - stx v_abeat 446 27000 -rmtnn0 447 27000 - ldx #0 448 27000 -rmtnn1 txa 449 27000 - tay 450 27000 - lda (p_song),y 451 27000 - cmp #$fe 452 27000 - bcs rmtnn2 453 27000 - tay 454 27000 - lda (p_trackslbstable),y 455 27000 - sta trackn_db,x 456 27000 - lda (p_trackshbstable),y 457 27000 -rmtnn1a sta trackn_hb,x 458 27000 - lda #0 459 27000 - sta trackn_idx,x 460 27000 - lda #1 461 27000 - sta trackn_pause,x 462 27000 - lda #$80 463 27000 - sta trackn_instrx2,x 464 27000 - inx 465 27000 - cpx #TRACKS 466 27000 - bne rmtnn1 467 27000 - lda p_song 468 27000 - clc 469 27000 - adc #TRACKS 470 27000 - sta p_song 471 27000 - bcc rmtnn1b 472 27000 - inc p_song+1 473 27000 -rmtnn1b 474 27000 - rts 475 27000 -rmtnn2 476 27000 - beq rmtnn3 477 27000 -rmtnn2a lda #emptytrack 480 27000 - jmp rmtnn1a 481 27000 -rmtnn3 482 27000 - ldy #2 483 27000 - lda (p_song),y 484 27000 - tax 485 27000 - iny 486 27000 - lda (p_song),y 487 27000 - sta p_song+1 488 27000 - stx p_song 489 27000 - jmp rmtnn0 490 27000 -GetTrackLine 491 27000 -rmtoo0 492 27000 -rmtoo0a 493 27000 - lda v_speed 494 27000 - sta v_bspeed 495 27000 - ldx #0 496 27000 -rmtoo1 497 27000 - lda trackn_pause,x 498 27000 - beq rmtoo1x 499 27000 - dec trackn_pause,x 500 27000 - bne rmtoo1x 501 27000 - inc trackn_pause,x 502 27000 -rmtoo1b 503 27000 - lda trackn_db,x 504 27000 - sta _ns 505 27000 - lda trackn_hb,x 506 27000 - sta _ns+1 507 27000 -rmtoo1i 508 27000 - ldy trackn_idx,x 509 27000 - lda (_ns),y 510 27000 - sta rmtreg1 511 27000 - iny 512 27000 - lda (_ns),y 513 27000 - sta rmtreg2 514 27000 - iny 515 27000 - tya 516 27000 - sta trackn_idx,x 517 27000 - lda rmtreg1 518 27000 - and #$3f 519 27000 - cmp #61 520 27000 - beq rmtoo1a 521 27000 - bcs rmtoo2 522 27000 - sta trackn_note,x 523 27000 - IF FEAT_BASS16 524 27000 - sta trackn_outnote,x 525 27000 - EIF 526 27000 - lda rmtreg2 527 27000 - lsr 528 27000 - and #$3f*2 529 27000 - sta trackn_instrx2,x 530 27000 -rmtoo1a lda rmtreg2 531 27000 - lsr 532 27000 - ror rmtreg1 533 27000 - lsr 534 27000 - ror rmtreg1 535 27000 - lda rmtreg1 536 27000 - and #$f0 537 27000 - sta trackn_volume,x 538 27000 -rmtoo1x 539 27000 - inx 540 27000 - cpx #TRACKS 541 27000 - bne rmtoo1 542 27000 - lda v_bspeed 543 27000 - sta v_speed 544 27000 - sta v_aspeed 545 27000 - rts 546 27000 -rmtoo2 547 27000 - cmp #63 548 27000 - beq rmtoo63 549 27000 - lda rmtreg1 550 27000 - and #$c0 551 27000 - beq rmtoo62_b 552 27000 - asl 553 27000 - rol 554 27000 - rol 555 27000 - sta trackn_pause,x 556 27000 - dec trackn_idx,x 557 27000 - jmp rmtoo1x 558 27000 -rmtoo62_b 559 27000 - lda rmtreg2 560 27000 - sta trackn_pause,x 561 27000 - jmp rmtoo1x 562 27000 -rmtoo63 563 27000 - lda rmtreg1 564 27000 - bmi rmtoo63_1X 565 27000 - lda rmtreg2 566 27000 - sta v_bspeed 567 27000 - jmp rmtoo1i 568 27000 -rmtoo63_1X 569 27000 - cmp #255 570 27000 - beq rmtoo63_11 571 27000 - lda rmtreg2 572 27000 - sta trackn_idx,x 573 27000 - jmp rmtoo1i 574 27000 -rmtoo63_11 575 27000 - jsr GetSongLine 576 27000 - jmp rmtoo0 577 27000 -InitOfNewSetInstrumentsOnly 578 27000 - ldx #0 579 27000 -p2x1 ldy trackn_instrx2,x 580 27000 - bmi p2x2 581 27000 - jsr SetUpInstrumentY2 582 27000 - lda #$80 583 27000 - sta trackn_instrx2,x 584 27000 -p2x2 585 27000 - inx 586 27000 - cpx #TRACKS 587 27000 - bne p2x1 588 27000 - rts 589 27000 -rmt_play 590 27000 -rmt_p0 591 27000 - jsr SetPokey 592 27000 -rmt_p1 593 27000 - dec v_ainstrspeed 594 27000 - beq rmtp1a 595 27000 - jmp rmt_p3 596 27000 -rmtp1a 597 27000 - lda v_instrspeed 598 27000 - sta v_ainstrspeed 599 27000 -rmt_p2 600 27000 - dec v_aspeed 601 27000 - bne rmt_p3 602 27000 - inc v_abeat 603 27000 - lda v_abeat 604 27000 - cmp v_maxtracklen 605 27000 - bne rmtp2o2 606 27000 - jsr GetSongLine 607 27000 -rmtp2o2 608 27000 - jsr GetTrackLine 609 27000 - jmp rmt_p2X 610 27000 -go_ppnext jmp ppnext 611 27000 -rmt_p2X 612 27000 - jsr InitOfNewSetInstrumentsOnly 613 27000 -rmt_p3 614 27000 - lda #>frqtab 615 27000 - sta _nr+1 616 27000 - ldx #0 617 27000 -rmtpp1 618 27000 - lda trackn_instrhb,x 619 27000 - beq go_ppnext 620 27000 - sta _ns+1 621 27000 - lda trackn_instrdb,x 622 27000 - sta _ns 623 27000 - ldy trackn_instridx,x 624 27000 - lda (_ns),y 625 27000 - sta rmtreg1 626 27000 - iny 627 27000 - lda (_ns),y 628 27000 - sta rmtreg2 629 27000 - iny 630 27000 - lda (_ns),y 631 27000 - sta rmtreg3 632 27000 - iny 633 27000 - tya 634 27000 - cmp trackn_instrlen,x 635 27000 - bcc rmtpp2 636 27000 - beq rmtpp2 637 27000 - lda #$80 638 27000 - sta trackn_instrreachend,x 639 27000 -rmtpp1b 640 27000 - lda trackn_instrlop,x 641 27000 -rmtpp2 sta trackn_instridx,x 642 27000 - lda rmtreg1 643 27000 - IF STEREO8T 644 27000 - cpx #4 645 27000 - bcc rmtpp2s 646 27000 - lsr 647 27000 - lsr 648 27000 - lsr 649 27000 - lsr 650 27000 -rmtpp2s 651 27000 - EIF 652 27000 - and #$0f 653 27000 - ora trackn_volume,x 654 27000 - tay 655 27000 - lda volumetab,y 656 27000 - pha 657 27000 - lda rmtreg2 658 27000 - and #$0e 659 27000 - tay 660 27000 - lda tabbeganddistor,y 661 27000 - sta _nr 662 27000 - pla 663 27000 - ora tabbeganddistor+1,y 664 27000 - sta trackn_audc,x 665 27000 - jmp InstrumentsEffects 666 27000 -returnfromInstrumentsEffects 667 27000 - IF FEAT_COMMAND2 668 27000 - lda #0 669 27000 - sta frqaddcmd2 670 27000 - EIF 671 27000 - lda rmtreg2 672 27000 - sta trackn_command,x 673 27000 - and #$70 674 27000 - lsr 675 27000 - lsr 676 27000 - IF ROM_BASED 677 27000 - lsr 678 27000 - tay 679 27000 - lda rts_tab+1,y 680 27000 - pha 681 27000 - lda rts_tab,y 682 27000 - pha 683 27000 - rts 684 27000 - ELSE 685 27000 - sta jmx+1 686 27000 -jmx bcc * 687 27000 - jmp cmd0 688 27000 - nop 689 27000 - jmp cmd1 690 27000 - nop 691 27000 - jmp cmd2 692 27000 - nop 693 27000 - jmp cmd3 694 27000 - nop 695 27000 - jmp cmd4 696 27000 - nop 697 27000 - jmp cmd5 698 27000 - nop 699 27000 - jmp cmd6 700 27000 - nop 701 27000 - jmp cmd7 702 27000 - EIF 703 27000 -cmd0 704 27000 - lda trackn_note,x 705 27000 - clc 706 27000 - adc rmtreg3 707 27000 -cmd0a 708 27000 - IF FEAT_TABLETYPE 709 27000 - ldy trackn_tabletypespeed,x 710 27000 - bmi cmd0b 711 27000 - EIF 712 27000 - clc 713 27000 - adc trackn_tablenote,x 714 27000 - cmp #61 715 27000 - bcc cmd0a1 716 27000 - lda #0 717 27000 - sta trackn_audc,x 718 27000 - lda #63 719 27000 -cmd0a1 720 27000 - IF FEAT_BASS16 721 27000 - sta trackn_outnote,x 722 27000 - EIF 723 27000 - tay 724 27000 - lda (_nr),y 725 27000 - clc 726 27000 - adc trackn_shiftfrq,x 727 27000 - IF FEAT_COMMAND2 728 27000 - clc 729 27000 - adc frqaddcmd2 730 27000 - EIF 731 27000 - sta trackn_audf,x 732 27000 - jmp rmtpp9 733 27000 - IF FEAT_TABLETYPE 734 27000 -cmd0b 735 27000 - cmp #61 736 27000 - bcc cmd0b1 737 27000 - lda #0 738 27000 - sta trackn_audc,x 739 27000 - lda #63 740 27000 -cmd0b1 741 27000 - tay 742 27000 - lda trackn_shiftfrq,x 743 27000 - clc 744 27000 - adc trackn_tablenote,x 745 27000 - clc 746 27000 - adc (_nr),y 747 27000 - IF FEAT_COMMAND2 748 27000 - clc 749 27000 - adc frqaddcmd2 750 27000 - EIF 751 27000 - sta trackn_audf,x 752 27000 - jmp rmtpp9 753 27000 - EIF 754 27000 -cmd1 755 27000 - IF FEAT_COMMAND1 756 27000 - lda rmtreg3 757 27000 - sta trackn_audf,x 758 27000 - jmp rmtpp9 759 27000 - EIF 760 27000 -cmd2 761 27000 - IF FEAT_COMMAND2 762 27000 - lda rmtreg3 763 27000 - sta frqaddcmd2 764 27000 - lda trackn_note,x 765 27000 - jmp cmd0a 766 27000 - EIF 767 27000 -cmd3 768 27000 - IF FEAT_COMMAND3 769 27000 - lda trackn_note,x 770 27000 - clc 771 27000 - adc rmtreg3 772 27000 - sta trackn_note,x 773 27000 - jmp cmd0a 774 27000 - EIF 775 27000 -cmd4 776 27000 - IF FEAT_COMMAND4 777 27000 - lda trackn_shiftfrq,x 778 27000 - clc 779 27000 - adc rmtreg3 780 27000 - sta trackn_shiftfrq,x 781 27000 - lda trackn_note,x 782 27000 - jmp cmd0a 783 27000 - EIF 784 27000 -cmd5 785 27000 - IF FEAT_COMMAND5&&FEAT_PORTAMENTO 786 27000 - IF FEAT_TABLETYPE 787 27000 - lda trackn_tabletypespeed,x 788 27000 - bpl cmd5a1 789 27000 - ldy trackn_note,x 790 27000 - lda (_nr),y 791 27000 - clc 792 27000 - adc trackn_tablenote,x 793 27000 - jmp cmd5ax 794 27000 - EIF 795 27000 -cmd5a1 796 27000 - lda trackn_note,x 797 27000 - clc 798 27000 - adc trackn_tablenote,x 799 27000 - cmp #61 800 27000 - bcc cmd5a2 801 27000 - lda #63 802 27000 -cmd5a2 803 27000 - tay 804 27000 - lda (_nr),y 805 27000 -cmd5ax 806 27000 - sta trackn_portafrqc,x 807 27000 - ldy rmtreg3 808 27000 - bne cmd5a 809 27000 - sta trackn_portafrqa,x 810 27000 -cmd5a 811 27000 - tya 812 27000 - lsr 813 27000 - lsr 814 27000 - lsr 815 27000 - lsr 816 27000 - sta trackn_portaspeed,x 817 27000 - sta trackn_portaspeeda,x 818 27000 - lda rmtreg3 819 27000 - and #$0f 820 27000 - sta trackn_portadepth,x 821 27000 - lda trackn_note,x 822 27000 - jmp cmd0a 823 27000 - ELSE 824 27000 - IF FEAT_COMMAND5 825 27000 - jmp rmtpp9 826 27000 - EIF 827 27000 - EIF 828 27000 -cmd6 829 27000 - IF FEAT_COMMAND6&&FEAT_FILTER 830 27000 - lda rmtreg3 831 27000 - clc 832 27000 - adc trackn_filter,x 833 27000 - sta trackn_filter,x 834 27000 - lda trackn_note,x 835 27000 - jmp cmd0a 836 27000 - ELSE 837 27000 - IF FEAT_COMMAND6 838 27000 - jmp rmtpp9 839 27000 - EIF 840 27000 - EIF 841 27000 -cmd7 842 27000 - IF FEAT_COMMAND7SETNOTE||FEAT_COMMAND7VOLUMEONLY 843 27000 - IF FEAT_COMMAND7SETNOTE 844 27000 - lda rmtreg3 845 27000 - IF FEAT_COMMAND7VOLUMEONLY 846 27000 - cmp #$80 847 27000 - beq cmd7a 848 27000 - EIF 849 27000 - sta trackn_note,x 850 27000 - jmp cmd0a 851 27000 - EIF 852 27000 - IF FEAT_COMMAND7VOLUMEONLY 853 27000 -cmd7a 854 27000 - lda trackn_audc,x 855 27000 - ora #$f0 856 27000 - sta trackn_audc,x 857 27000 - lda trackn_note,x 858 27000 - jmp cmd0a 859 27000 - EIF 860 27000 - EIF 861 27000 -rmtpp9 862 27000 - IF FEAT_PORTAMENTO 863 27000 - lda trackn_portaspeeda,x 864 27000 - beq rmtpp10 865 27000 - sec 866 27000 - sbc #1 867 27000 - sta trackn_portaspeeda,x 868 27000 - bne rmtpp10 869 27000 - lda trackn_portaspeed,x 870 27000 - sta trackn_portaspeeda,x 871 27000 - lda trackn_portafrqa,x 872 27000 - cmp trackn_portafrqc,x 873 27000 - beq rmtpp10 874 27000 - bcs pps1 875 27000 - adc trackn_portadepth,x 876 27000 - bcs pps8 877 27000 - cmp trackn_portafrqc,x 878 27000 - bcs pps8 879 27000 - jmp pps9 880 27000 -pps1 881 27000 - sbc trackn_portadepth,x 882 27000 - bcc pps8 883 27000 - cmp trackn_portafrqc,x 884 27000 - bcs pps9 885 27000 -pps8 886 27000 - lda trackn_portafrqc,x 887 27000 -pps9 888 27000 - sta trackn_portafrqa,x 889 27000 -rmtpp10 890 27000 - lda rmtreg2 891 27000 - and #$01 892 27000 - beq rmtpp11 893 27000 - lda trackn_portafrqa,x 894 27000 - clc 895 27000 - adc trackn_shiftfrq,x 896 27000 - sta trackn_audf,x 897 27000 -rmtpp11 898 27000 - EIF 899 27000 -ppnext 900 27000 - inx 901 27000 - cpx #TRACKS 902 27000 - beq rmt_p4 903 27000 - jmp rmtpp1 904 27000 -rmt_p4 905 27000 - IF FEAT_AUDCTLMANUALSET 906 27000 - ldx #3 907 27000 - lda #0 908 27000 -qq0 ora trackn_audctl,x 909 27000 - dex 910 27000 - bpl qq0 911 27000 - sta v_audctl 912 27000 -qq1 913 27000 - ldx v_audctl 914 27000 - ELSE 915 27000 - ldx #0 916 27000 - stx v_audctl 917 27000 - EIF 918 27000 - IF FEAT_FILTER 919 27000 - IF FEAT_FILTERG0L 920 27000 - lda trackn_command+0 921 27000 - bpl qq2 922 27000 - lda trackn_audc+0 923 27000 - and #$0f 924 27000 - beq qq2 925 27000 - lda trackn_audf+0 926 27000 - clc 927 27000 - adc trackn_filter+0 928 27000 - sta trackn_audf+2 929 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG2L 930 27000 - lda trackn_audc+2 931 27000 - and #$10 932 27000 - bne qq1a 933 27000 - EIF 934 27000 - lda #0 935 27000 - sta trackn_audc+2 936 27000 -qq1a 937 27000 - txa 938 27000 - ora #4 939 27000 - tax 940 27000 - EIF 941 27000 -qq2 942 27000 - IF FEAT_FILTERG1L 943 27000 - lda trackn_command+1 944 27000 - bpl qq3 945 27000 - lda trackn_audc+1 946 27000 - and #$0f 947 27000 - beq qq3 948 27000 - lda trackn_audf+1 949 27000 - clc 950 27000 - adc trackn_filter+1 951 27000 - sta trackn_audf+3 952 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG3L 953 27000 - lda trackn_audc+3 954 27000 - and #$10 955 27000 - bne qq2a 956 27000 - EIF 957 27000 - lda #0 958 27000 - sta trackn_audc+3 959 27000 -qq2a 960 27000 - txa 961 27000 - ora #2 962 27000 - tax 963 27000 - EIF 964 27000 -qq3 965 27000 - IF FEAT_FILTERG0L||FEAT_FILTERG1L 966 27000 - cpx v_audctl 967 27000 - bne qq5 968 27000 - EIF 969 27000 - EIF 970 27000 - IF FEAT_BASS16 971 27000 - IF FEAT_BASS16G1L 972 27000 - lda trackn_command+1 973 27000 - and #$0e 974 27000 - cmp #6 975 27000 - bne qq4 976 27000 - lda trackn_audc+1 977 27000 - and #$0f 978 27000 - beq qq4 979 27000 - ldy trackn_outnote+1 980 27000 - lda frqtabbasslo,y 981 27000 - sta trackn_audf+0 982 27000 - lda frqtabbasshi,y 983 27000 - sta trackn_audf+1 984 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG0L 985 27000 - lda trackn_audc+0 986 27000 - and #$10 987 27000 - bne qq3a 988 27000 - EIF 989 27000 - lda #0 990 27000 - sta trackn_audc+0 991 27000 -qq3a 992 27000 - txa 993 27000 - ora #$50 994 27000 - tax 995 27000 - EIF 996 27000 -qq4 997 27000 - IF FEAT_BASS16G3L 998 27000 - lda trackn_command+3 999 27000 - and #$0e 1000 27000 - cmp #6 1001 27000 - bne qq5 1002 27000 - lda trackn_audc+3 1003 27000 - and #$0f 1004 27000 - beq qq5 1005 27000 - ldy trackn_outnote+3 1006 27000 - lda frqtabbasslo,y 1007 27000 - sta trackn_audf+2 1008 27000 - lda frqtabbasshi,y 1009 27000 - sta trackn_audf+3 1010 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG2L 1011 27000 - lda trackn_audc+2 1012 27000 - and #$10 1013 27000 - bne qq4a 1014 27000 - EIF 1015 27000 - lda #0 1016 27000 - sta trackn_audc+2 1017 27000 -qq4a 1018 27000 - txa 1019 27000 - ora #$28 1020 27000 - tax 1021 27000 - EIF 1022 27000 - EIF 1023 27000 -qq5 1024 27000 - stx v_audctl 1025 27000 - IF STEREO8T 1026 27000 - IF FEAT_AUDCTLMANUALSET 1027 27000 - ldx #3 1028 27000 - lda #0 1029 27000 -qs0 ora trackn_audctl+4,x 1030 27000 - dex 1031 27000 - bpl qs0 1032 27000 - sta v_audctl2 1033 27000 -qs1 1034 27000 - ldx v_audctl2 1035 27000 - ELSE 1036 27000 - ldx #0 1037 27000 - stx v_audctl2 1038 27000 - EIF 1039 27000 - IF FEAT_FILTER 1040 27000 - IF FEAT_FILTERG0R 1041 27000 - lda trackn_command+0+4 1042 27000 - bpl qs2 1043 27000 - lda trackn_audc+0+4 1044 27000 - and #$0f 1045 27000 - beq qs2 1046 27000 - lda trackn_audf+0+4 1047 27000 - clc 1048 27000 - adc trackn_filter+0+4 1049 27000 - sta trackn_audf+2+4 1050 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG2R 1051 27000 - lda trackn_audc+2+4 1052 27000 - and #$10 1053 27000 - bne qs1a 1054 27000 - EIF 1055 27000 - lda #0 1056 27000 - sta trackn_audc+2+4 1057 27000 -qs1a 1058 27000 - txa 1059 27000 - ora #4 1060 27000 - tax 1061 27000 - EIF 1062 27000 -qs2 1063 27000 - IF FEAT_FILTERG1R 1064 27000 - lda trackn_command+1+4 1065 27000 - bpl qs3 1066 27000 - lda trackn_audc+1+4 1067 27000 - and #$0f 1068 27000 - beq qs3 1069 27000 - lda trackn_audf+1+4 1070 27000 - clc 1071 27000 - adc trackn_filter+1+4 1072 27000 - sta trackn_audf+3+4 1073 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG3R 1074 27000 - lda trackn_audc+3+4 1075 27000 - and #$10 1076 27000 - bne qs2a 1077 27000 - EIF 1078 27000 - lda #0 1079 27000 - sta trackn_audc+3+4 1080 27000 -qs2a 1081 27000 - txa 1082 27000 - ora #2 1083 27000 - tax 1084 27000 - EIF 1085 27000 -qs3 1086 27000 - IF FEAT_FILTERG0R||FEAT_FILTERG1R 1087 27000 - cpx v_audctl2 1088 27000 - bne qs5 1089 27000 - EIF 1090 27000 - EIF 1091 27000 - IF FEAT_BASS16 1092 27000 - IF FEAT_BASS16G1R 1093 27000 - lda trackn_command+1+4 1094 27000 - and #$0e 1095 27000 - cmp #6 1096 27000 - bne qs4 1097 27000 - lda trackn_audc+1+4 1098 27000 - and #$0f 1099 27000 - beq qs4 1100 27000 - ldy trackn_outnote+1+4 1101 27000 - lda frqtabbasslo,y 1102 27000 - sta trackn_audf+0+4 1103 27000 - lda frqtabbasshi,y 1104 27000 - sta trackn_audf+1+4 1105 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG0R 1106 27000 - lda trackn_audc+0+4 1107 27000 - and #$10 1108 27000 - bne qs3a 1109 27000 - EIF 1110 27000 - lda #0 1111 27000 - sta trackn_audc+0+4 1112 27000 -qs3a 1113 27000 - txa 1114 27000 - ora #$50 1115 27000 - tax 1116 27000 - EIF 1117 27000 -qs4 1118 27000 - IF FEAT_BASS16G3R 1119 27000 - lda trackn_command+3+4 1120 27000 - and #$0e 1121 27000 - cmp #6 1122 27000 - bne qs5 1123 27000 - lda trackn_audc+3+4 1124 27000 - and #$0f 1125 27000 - beq qs5 1126 27000 - ldy trackn_outnote+3+4 1127 27000 - lda frqtabbasslo,y 1128 27000 - sta trackn_audf+2+4 1129 27000 - lda frqtabbasshi,y 1130 27000 - sta trackn_audf+3+4 1131 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG2R 1132 27000 - lda trackn_audc+2+4 1133 27000 - and #$10 1134 27000 - bne qs4a 1135 27000 - EIF 1136 27000 - lda #0 1137 27000 - sta trackn_audc+2+4 1138 27000 -qs4a 1139 27000 - txa 1140 27000 - ora #$28 1141 27000 - tax 1142 27000 - EIF 1143 27000 - EIF 1144 27000 -qs5 1145 27000 - stx v_audctl2 1146 27000 - EIF 1147 27000 -rmt_p5 1148 27000 - lda v_ainstrspeed 1149 27000 - rts 1150 27000 -SetPokey 1151 27000 - IF STEREO8T 1152 27000 - ldy v_audctl2 1153 27000 - lda trackn_audf+0+4 1154 27000 - ldx trackn_audf+0 1155 27000 - sta POKEY_BASE_S+$00 1156 27000 - stx POKEY_BASE+$00 1157 27000 - lda trackn_audc+0+4 1158 27000 - ldx trackn_audc+0 1159 27000 - sta POKEY_BASE_S+$01 1160 27000 - stx POKEY_BASE+$01 1161 27000 - lda trackn_audf+1+4 1162 27000 - ldx trackn_audf+1 1163 27000 - sta POKEY_BASE_S+$02 1164 27000 - stx POKEY_BASE+$02 1165 27000 - lda trackn_audc+1+4 1166 27000 - ldx trackn_audc+1 1167 27000 - sta POKEY_BASE_S+$03 1168 27000 - stx POKEY_BASE+$03 1169 27000 - lda trackn_audf+2+4 1170 27000 - ldx trackn_audf+2 1171 27000 - sta POKEY_BASE_S+$04 1172 27000 - stx POKEY_BASE+$04 1173 27000 - lda trackn_audc+2+4 1174 27000 - ldx trackn_audc+2 1175 27000 - sta POKEY_BASE_S+$05 1176 27000 - stx POKEY_BASE+$05 1177 27000 - lda trackn_audf+3+4 1178 27000 - ldx trackn_audf+3 1179 27000 - sta POKEY_BASE_S+$06 1180 27000 - stx POKEY_BASE+$06 1181 27000 - lda trackn_audc+3+4 1182 27000 - ldx trackn_audc+3 1183 27000 - sta POKEY_BASE_S+$07 1184 27000 - stx POKEY_BASE+$07 1185 27000 - lda v_audctl 1186 27000 - sty POKEY_BASE_S+$08 1187 27000 - sta POKEY_BASE+$08 1188 27000 - ELSE 1189 27000 - 1190 27000 - ifconst RMTVOLUME 1191 27000 - lda rmtvolume 1192 27000 - sta fourbitfadevalueint 1193 27000 - endif 1194 27000 - ldy v_audctl 1195 27000 - ldx trackn_audf+0 1196 27000 - lda trackn_audc+0 1197 27000 - ifconst RMTVOLUME 1198 27000 - jsr fourbitfadeint 1199 27000 - endif 1200 27000 - stx POKEY_BASE+$00+0 1201 27000 - stx POKEY_BASE+$00+0 1202 27000 - sta POKEY_BASE+$01+0 1203 27000 - sta POKEY_BASE+$01+0 1204 27000 - 1205 27000 - ldx trackn_audf+1 1206 27000 - lda trackn_audc+1 1207 27000 - ifconst RMTVOLUME 1208 27000 - jsr fourbitfadeint 1209 27000 - endif 1210 27000 - stx POKEY_BASE+$00+2 1211 27000 - stx POKEY_BASE+$00+2 1212 27000 - sta POKEY_BASE+$01+2 1213 27000 - sta POKEY_BASE+$01+2 1214 27000 - 1215 27000 - ldx trackn_audf+2 1216 27000 - lda trackn_audc+2 1217 27000 - ifconst RMTVOLUME 1218 27000 - jsr fourbitfadeint 1219 27000 - endif 1220 27000 - stx POKEY_BASE+$00+4 1221 27000 - stx POKEY_BASE+$00+4 1222 27000 - sta POKEY_BASE+$01+4 1223 27000 - sta POKEY_BASE+$01+4 1224 27000 - 1225 27000 - ldx trackn_audf+3 1226 27000 - lda trackn_audc+3 1227 27000 - ifconst RMTVOLUME 1228 27000 - jsr fourbitfadeint 1229 27000 - endif 1230 27000 - stx POKEY_BASE+$00+6 1231 27000 - stx POKEY_BASE+$00+6 1232 27000 - sta POKEY_BASE+$01+6 1233 27000 - sta POKEY_BASE+$01+6 1234 27000 - 1235 27000 - sty POKEY_BASE+$08 1236 27000 - sty POKEY_BASE+$08 1237 27000 - 1238 27000 - EIF 1239 27000 - rts 1240 27000 -SetUpInstrumentY2 1241 27000 - lda (p_instrstable),y 1242 27000 - sta trackn_instrdb,x 1243 27000 - sta _nt 1244 27000 - iny 1245 27000 - lda (p_instrstable),y 1246 27000 - sta trackn_instrhb,x 1247 27000 - sta _nt+1 1248 27000 - ldy #0 1249 27000 - lda (_nt),y 1250 27000 - sta trackn_tableend,x 1251 27000 - clc 1252 27000 - adc #1 1253 27000 - sta trackn_instridx,x 1254 27000 - iny 1255 27000 - lda (_nt),y 1256 27000 - sta trackn_tablelop,x 1257 27000 - iny 1258 27000 - lda (_nt),y 1259 27000 - sta trackn_instrlen,x 1260 27000 - iny 1261 27000 - lda (_nt),y 1262 27000 - sta trackn_instrlop,x 1263 27000 - iny 1264 27000 - lda (_nt),y 1265 27000 - sta trackn_tabletypespeed,x 1266 27000 - IF FEAT_TABLETYPE||FEAT_TABLEMODE 1267 27000 - and #$3f 1268 27000 - EIF 1269 27000 - sta trackn_tablespeeda,x 1270 27000 - IF FEAT_TABLEMODE 1271 27000 - lda (_nt),y 1272 27000 - and #$40 1273 27000 - sta trackn_tablemode,x 1274 27000 - EIF 1275 27000 - iny 1276 27000 - IF FEAT_AUDCTLMANUALSET 1277 27000 - lda (_nt),y 1278 27000 - sta trackn_audctl,x 1279 27000 - EIF 1280 27000 - iny 1281 27000 - lda (_nt),y 1282 27000 - sta trackn_volumeslidedepth,x 1283 27000 - iny 1284 27000 - lda (_nt),y 1285 27000 - sta trackn_volumemin,x 1286 27000 - iny 1287 27000 - lda (_nt),y 1288 27000 - sta trackn_effdelay,x 1289 27000 - iny 1290 27000 - lda (_nt),y 1291 27000 - tay 1292 27000 - lda vibtabbeg,y 1293 27000 - sta trackn_effvibratoa,x 1294 27000 - sta trackn_effvibratobeg,x 1295 27000 - lda vibtabbeg+1,y 1296 27000 - sta trackn_effvibratoend,x 1297 27000 - ldy #10 1298 27000 - lda (_nt),y 1299 27000 - sta trackn_effshift,x 1300 27000 - lda #128 1301 27000 - sta trackn_volumeslidevalue,x 1302 27000 - lda #0 1303 27000 - sta trackn_instrreachend,x 1304 27000 - sta trackn_shiftfrq,x 1305 27000 - lda #INSTRPAR 1306 27000 - sta trackn_tablea,x 1307 27000 - tay 1308 27000 - lda (_nt),y 1309 27000 - sta trackn_tablenote,x 1310 27000 - IF FEAT_FILTER 1311 27000 - lda #1 1312 27000 - sta trackn_filter,x 1313 27000 - EIF 1314 27000 - rts 1315 27000 -InstrumentsEffects 1316 27000 - lda trackn_effdelay,x 1317 27000 - beq ei2 1318 27000 - tay 1319 27000 - dey 1320 27000 - bne ei1 1321 27000 - lda trackn_shiftfrq,x 1322 27000 - clc 1323 27000 - adc trackn_effshift,x 1324 27000 - clc 1325 27000 - ldy trackn_effvibratoa,x 1326 27000 - adc vib0,y 1327 27000 - sta trackn_shiftfrq,x 1328 27000 - iny 1329 27000 - tya 1330 27000 - cmp trackn_effvibratoend,x 1331 27000 - bne ei1a 1332 27000 - lda trackn_effvibratobeg,x 1333 27000 -ei1a 1334 27000 - sta trackn_effvibratoa,x 1335 27000 - jmp ei2 1336 27000 -ei1 1337 27000 - tya 1338 27000 - sta trackn_effdelay,x 1339 27000 -ei2 1340 27000 - lda trackn_tableend,x 1341 27000 - cmp #INSTRPAR 1342 27000 - beq ei3 1343 27000 - lda trackn_tablespeeda,x 1344 27000 - bpl ei2f 1345 27000 -ei2c 1346 27000 - lda trackn_tablea,x 1347 27000 - clc 1348 27000 - adc #1 1349 27000 - cmp trackn_tableend,x 1350 27000 - bcc ei2a 1351 27000 - beq ei2a 1352 27000 - lda trackn_tablelop,x 1353 27000 -ei2a 1354 27000 - sta trackn_tablea,x 1355 27000 - lda trackn_instrdb,x 1356 27000 - sta _nt 1357 27000 - lda trackn_instrhb,x 1358 27000 - sta _nt+1 1359 27000 - ldy trackn_tablea,x 1360 27000 - lda (_nt),y 1361 27000 - IF FEAT_TABLEMODE 1362 27000 - ldy trackn_tablemode,x 1363 27000 - beq ei2e 1364 27000 - clc 1365 27000 - adc trackn_tablenote,x 1366 27000 -ei2e 1367 27000 - EIF 1368 27000 - sta trackn_tablenote,x 1369 27000 - lda trackn_tabletypespeed,x 1370 27000 - IF FEAT_TABLETYPE||FEAT_TABLEMODE 1371 27000 - and #$3f 1372 27000 - EIF 1373 27000 -ei2f 1374 27000 - sec 1375 27000 - sbc #1 1376 27000 - sta trackn_tablespeeda,x 1377 27000 -ei3 1378 27000 - lda trackn_instrreachend,x 1379 27000 - bpl ei4 1380 27000 - lda trackn_volume,x 1381 27000 - beq ei4 1382 27000 - cmp trackn_volumemin,x 1383 27000 - beq ei4 1384 27000 - bcc ei4 1385 27000 - tay 1386 27000 - lda trackn_volumeslidevalue,x 1387 27000 - clc 1388 27000 - adc trackn_volumeslidedepth,x 1389 27000 - sta trackn_volumeslidevalue,x 1390 27000 - bcc ei4 1391 27000 - tya 1392 27000 - sbc #16 1393 27000 - sta trackn_volume,x 1394 27000 -ei4 1395 27000 - jmp returnfromInstrumentsEffects 1396 27000 - 1397 27000 -rmtmoduleend 1398 27000 - echo " (rmtplayer module is using ",[(rmtmoduleend-rmtmodulestart)]d," bytes of rom)" 1399 27000 - echo " (rmtplayer module is using ",[(MEMLOC-RMTRAM-1)]d," bytes of ram)" 1400 27000 - 1401 27000 endif ; RMT ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Menu_Demo_v2.78b.asm 4844 27000 endif 4845 27000 ifnconst included.7800vox.asm ------- FILE 7800vox.asm LEVEL 2 PASS 3 0 27000 include 7800vox.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 ; AtariVox 7800basic wrapper 4 27000 5 27000 ; to be called with 6 27000 ; A=# of bytes 7 27000 ; 8 27000 9 27000 - ifconst HSSUPPORT 10 27000 - 11 27000 -_7800voxstart 12 27000 - 13 27000 -AVoxReadBytes 14 27000 - sta temp8 15 27000 - jsr i2c_startwrite 16 27000 - bcs eeprom_error 17 27000 - 18 27000 - lda HSVoxHi 19 27000 - jsr i2c_txbyte 20 27000 - lda HSVoxLo 21 27000 - jsr i2c_txbyte 22 27000 - jsr i2c_stopwrite 23 27000 - 24 27000 - jsr i2c_startread 25 27000 - 26 27000 - ldx #0 27 27000 -AVoxReadBytesLoop 28 27000 - jsr i2c_rxbyte 29 27000 - sta eeprombuffer,x 30 27000 - inx 31 27000 - cpx temp8 32 27000 - bne AVoxReadBytesLoop 33 27000 - jsr i2c_stopread 34 27000 - lda #0 35 27000 - rts 36 27000 - 37 27000 - ; to be called with 38 27000 - ; A=# of bytes 39 27000 - ; 40 27000 - 41 27000 -AVoxWriteBytes 42 27000 - sta temp8 43 27000 - jsr i2c_startwrite 44 27000 - bcs eeprom_error 45 27000 - 46 27000 - lda HSVoxHi 47 27000 - jsr i2c_txbyte 48 27000 - lda HSVoxLo 49 27000 - jsr i2c_txbyte 50 27000 - 51 27000 - ldx #$00 52 27000 -AVoxWriteBytesLoop 53 27000 - lda eeprombuffer,x 54 27000 - jsr i2c_txbyte 55 27000 - inx 56 27000 - cpx temp8 57 27000 - bne AVoxWriteBytesLoop 58 27000 - jsr i2c_stopwrite 59 27000 - 60 27000 - lda #0 61 27000 - rts 62 27000 - 63 27000 -eeprom_error 64 27000 - lda #$ff 65 27000 - rts 66 27000 - 67 27000 -AVoxDetect 68 27000 - 69 27000 - jsr i2c_startwrite 70 27000 - bcs eeprom_error 71 27000 - lda #$30 72 27000 - jsr i2c_txbyte 73 27000 - lda #$00 74 27000 - jsr i2c_txbyte 75 27000 - jsr i2c_stopwrite 76 27000 - rts 77 27000 - 78 27000 - include "i2c7800.inc" 79 27000 - I2C_SUBS temp9 80 27000 - 81 27000 -_7800voxend 82 27000 - 83 27000 - echo " (7800vox module is using ",[(_7800voxend-_7800voxstart)]d," bytes)" 84 27000 - 85 27000 endif 86 27000 ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Menu_Demo_v2.78b.asm 4847 27000 endif 4848 27000 ifnconst included.pokeysound.asm ------- FILE pokeysound.asm LEVEL 2 PASS 3 0 27000 include pokeysound.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 4 27000 - ifconst pokeysupport 5 27000 - 6 27000 -pokeysoundmodulestart 7 27000 - 8 27000 -mutepokey 9 27000 - lda #0 10 27000 - ldy #7 11 27000 -mutepokeyloop 12 27000 - sta pokey1pointlo,y 13 27000 - sta (pokeybaselo),y 14 27000 - dey 15 27000 - bpl mutepokeyloop 16 27000 - rts 17 27000 - 18 27000 -checkpokeyplaying 19 27000 - ldx #6 20 27000 -checkpokeyplayingloop 21 27000 - lda pokey1pointlo,x 22 27000 - ora pokey1pointhi,x 23 27000 - beq pokeychannelinactive 24 27000 - jsr playpokeysfxA ; x=channel*2 25 27000 -pokeychannelinactive 26 27000 - dex 27 27000 - dex 28 27000 - bpl checkpokeyplayingloop 29 27000 - rts 30 27000 - 31 27000 -playpokeysfxA 32 27000 - txa 33 27000 - tay 34 27000 - lda pokey1tick,x 35 27000 - beq playpokeysfxAcont 36 27000 - sec 37 27000 - sbc #1 38 27000 - sta pokey1tick,x ; sound resolution is >1 frame, and we're mid-tock... 39 27000 - rts 40 27000 - 41 27000 -playpokeysfxAcont 42 27000 - lda pokey1frames,x ; set the frame countdown for this sound chunk 43 27000 - sta pokey1tick,x 44 27000 - 45 27000 - lda pokey1priority,x ; decrease the sound's priority if its non-zero 46 27000 - beq playpokeysfxAcont2 47 27000 - sec 48 27000 - sbc #1 49 27000 - sta pokey1priority,x 50 27000 -playpokeysfxAcont2 51 27000 - 52 27000 - ; *** FREQUENCY 53 27000 - lda (pokey1pointlo,x) 54 27000 - sta inttemp1 55 27000 - clc 56 27000 - adc pokey1offset,x ; take into account any pitch modification 57 27000 - sta (pokeybaselo),y ; PAUDF0,0 58 27000 - 59 27000 - ;advance the data pointer +1 60 27000 - inc pokey1pointlo,x 61 27000 - bne skippokeyhiinc1 62 27000 - inc pokey1pointhi,x 63 27000 -skippokeyhiinc1 64 27000 - 65 27000 - ; *** WAVE 66 27000 - lda (pokey1pointlo,x) 67 27000 - asl 68 27000 - asl 69 27000 - asl 70 27000 - asl ; x16 71 27000 - 72 27000 - ;advance the data pointer +1 73 27000 - inc pokey1pointlo,x 74 27000 - bne skippokeyhiinc2 75 27000 - inc pokey1pointhi,x 76 27000 -skippokeyhiinc2 77 27000 - 78 27000 - ora (pokey1pointlo,x) 79 27000 - iny 80 27000 - sta (pokeybaselo),y 81 27000 - 82 27000 - ora inttemp1 ; check if F|C|V=0 83 27000 - beq zeropokeypoint ; if so, we're at the end of the sound. 84 27000 - 85 27000 - ; advance the pointer +1, on to the next sound chunk 86 27000 - inc pokey1pointlo,x 87 27000 - bne skippokeyhiinc3 88 27000 - inc pokey1pointhi,x 89 27000 -skippokeyhiinc3 90 27000 - rts 91 27000 - 92 27000 -zeropokeypoint 93 27000 - sta pokey1pointlo,x 94 27000 - sta pokey1pointhi,x 95 27000 - sta pokey1priority,x 96 27000 - rts 97 27000 - 98 27000 -schedulepokeysfx 99 27000 - ldx #6 100 27000 -schedulepokeysfxloop 101 27000 - lda pokey1pointlo,x 102 27000 - ora pokey1pointhi,x 103 27000 - bne schedulespokeysearch 104 27000 - jmp schedulepokeyX ; we found an unused channel, so use it... 105 27000 -schedulespokeysearch 106 27000 - dex 107 27000 - dex 108 27000 - bpl schedulepokeysfxloop 109 27000 - 110 27000 - ; if we're here, all 4 channels are presently playing a sound... 111 27000 - ldy #1 112 27000 - lda (sfxinstrumentlo),y ; peek at the priority of this sfx... 113 27000 - bne schedulepokeysfxcont1 114 27000 - rts ; ...and skip it if it's 0 priority 115 27000 -schedulepokeysfxcont1 116 27000 - 117 27000 - ; figure out which current sound has the lowest priority... 118 27000 - lda #0 119 27000 - sta temp8 120 27000 - lda pokey1priority 121 27000 - sta temp9 122 27000 - ldx #6 123 27000 -findlowprioritypokeyloop 124 27000 - lda pokey1priority,x 125 27000 - cmp temp9 126 27000 - bcs findlowprioritypokeyloopcontinue 127 27000 - sta temp9 128 27000 - stx temp8 129 27000 -findlowprioritypokeyloopcontinue 130 27000 - dex 131 27000 - dex 132 27000 - bne findlowprioritypokeyloop 133 27000 - ldx temp8 ; the low priority channel we'll interrupt 134 27000 - 135 27000 -schedulepokeyX 136 27000 - ;called with X=2*pokey channel to play on... 137 27000 - ldy #1 ; get priority and sound-resolution (in frames) 138 27000 - lda (sfxinstrumentlo),y 139 27000 - sta pokey1priority,x 140 27000 - iny 141 27000 - lda (sfxinstrumentlo),y 142 27000 - sta pokey1frames,x 143 27000 - 144 27000 - lda sfxinstrumentlo 145 27000 - clc 146 27000 - adc #3 147 27000 - sta pokey1pointlo,x 148 27000 - lda sfxinstrumenthi 149 27000 - adc #0 150 27000 - sta pokey1pointhi,x 151 27000 - lda sfxpitchoffset 152 27000 - sta pokey1offset,x 153 27000 - lda #0 154 27000 - sta pokey1tick,x 155 27000 - rts 156 27000 - 157 27000 - ; pokey detection routine. we check for pokey in the XBOARD/XM location, 158 27000 - ; and the standard $4000 location. 159 27000 - ; if pokey the pokey is present, this routine will reset it. 160 27000 - ifconst pokeyaddress 161 27000 -detectpokeylocation 162 27000 - lda #pokeyaddress 165 27000 - sta pokeybasehi 166 27000 - lda #$ff 167 27000 - sta pokeydetected 168 27000 - 169 27000 - if pokeyaddress = $450 170 27000 - lda XCTRL1s 171 27000 - ora #%00010100 172 27000 - sta XCTRL1s 173 27000 - sta XCTRL1 174 27000 - endif 175 27000 - 176 27000 - 177 27000 - lda #0 178 27000 - ldy #15 179 27000 -clearpokeyloop 180 27000 - sta (pokeybase),y 181 27000 - dey 182 27000 - bpl clearpokeyloop 183 27000 - ; take pokey out of reset... 184 27000 - ldy #PSKCTL 185 27000 - lda #3 186 27000 - sta (pokeybase),y 187 27000 - ldy #PAUDCTL 188 27000 - lda #0 189 27000 - sta (pokeybase),y 190 27000 - rts 191 27000 - else ; !pokeyaddress 192 27000 -detectpokeylocation 193 27000 - ;XBoard/XM... 194 27000 - ldx #2 195 27000 -detectpokeyloop 196 27000 - lda XCTRL1s 197 27000 - ora #%00010100 198 27000 - and POKEYXMMASK,x 199 27000 - sta XCTRL1s 200 27000 - sta XCTRL1 201 27000 - 202 27000 - lda POKEYCHECKLO,x 203 27000 - sta pokeybaselo 204 27000 - lda POKEYCHECKHI,x 205 27000 - sta pokeybasehi 206 27000 - jsr checkforpokey 207 27000 - lda pokeydetected 208 27000 - beq foundpokeychip 209 27000 - dex 210 27000 - bpl detectpokeyloop 211 27000 -foundpokeychip 212 27000 - eor #$ff ; invert state for 7800basic if...then test 213 27000 - sta pokeydetected 214 27000 - rts 215 27000 - 216 27000 -POKEYXMMASK 217 27000 - ; XM POKEY on XM POKEY off XM POKEY off 218 27000 - .byte %11111111, %11101111, %11101111 219 27000 - 220 27000 -POKEYCHECKLO 221 27000 - .byte <$0450, <$0450, <$4000 222 27000 -POKEYCHECKHI 223 27000 - .byte >$0450, >$0450, >$4000 224 27000 - 225 27000 -checkforpokey 226 27000 - ldy #$0f 227 27000 - lda #$00 228 27000 - sta pokeydetected ; start off by assuming pokey will be detected 229 27000 -resetpokeyregistersloop 230 27000 - sta (pokeybase),y 231 27000 - dey 232 27000 - bpl resetpokeyregistersloop 233 27000 - 234 27000 - ldy #PAUDCTL 235 27000 - sta (pokeybase),y 236 27000 - ldy #PSKCTL 237 27000 - sta (pokeybase),y 238 27000 - 239 27000 - ; let the dust settle... 240 27000 - nop 241 27000 - nop 242 27000 - nop 243 27000 - 244 27000 - lda #4 245 27000 - sta temp9 246 27000 -pokeycheckloop1 247 27000 - ; we're in reset, so the RANDOM register should read $ff... 248 27000 - ldy #PRANDOM 249 27000 - lda (pokeybase),y 250 27000 - cmp #$ff 251 27000 - bne nopokeydetected 252 27000 - dec temp9 253 27000 - bne pokeycheckloop1 254 27000 - 255 27000 - ; take pokey out of reset... 256 27000 - ldy #PSKCTL 257 27000 - lda #3 258 27000 - sta (pokeybase),y 259 27000 - ldy #PAUDCTL 260 27000 - lda #0 261 27000 - sta (pokeybase),y 262 27000 - 263 27000 - ; let the dust settle again... 264 27000 - nop 265 27000 - nop 266 27000 - nop 267 27000 - 268 27000 - lda #4 269 27000 - sta temp9 270 27000 -pokeycheckloop2 271 27000 - ; we're out of reset, so RANDOM should read non-$ff... 272 27000 - ldy #PRANDOM 273 27000 - lda (pokeybase),y 274 27000 - cmp #$ff 275 27000 - beq skippokeycheckreturn 276 27000 - rts 277 27000 -skippokeycheckreturn 278 27000 - dec temp9 279 27000 - bne pokeycheckloop2 280 27000 -nopokeydetected 281 27000 - dec pokeydetected ; pokeydetected=#$ff 282 27000 - rts 283 27000 - 284 27000 - endif ; !pokeyaddress 285 27000 - 286 27000 -pokeysoundmoduleend 287 27000 - 288 27000 - echo " (pokeysound module is using ",[(pokeysoundmoduleend-pokeysoundmodulestart)]d," bytes)" 289 27000 - 290 27000 endif ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Menu_Demo_v2.78b.asm 4850 27000 endif 4851 27000 ifnconst included.tracker.asm ------- FILE tracker.asm LEVEL 2 PASS 3 0 27000 include tracker.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 4 27000 - ifconst MUSICTRACKER 5 27000 - 6 27000 -trackerstart 7 27000 - 8 27000 - ; ** songtempo lists how many 256ths of a frame a 16th note lasts 9 27000 - ; ** the player operates on a 16th note grid. 10 27000 - 11 27000 -servicesongover 12 27000 - rts 13 27000 -servicesong 14 27000 - lda songtempo 15 27000 - beq servicesongover ; ** if song is off/paused then return 16 27000 -servicesongcontinue 17 27000 - lda sfxschedulelock 18 27000 - sta sfxschedulemissed 19 27000 - bne servicesongover 20 27000 - lda songtempo 21 27000 - clc 22 27000 - adc songtick ; add songtempo to songtick until it rolls over 23 27000 - sta songtick ; this is how we break away from 50/60Hz timing. 24 27000 - bcc servicesongover 25 27000 - ; ** if we're here a new 16th note has passed 26 27000 - ; ** check if a new note is due on any of the 4 channels 27 27000 -servicesongredo 28 27000 - ldx #3 29 27000 -checkchannelloop 30 27000 - dec songchannel1busywait,x 31 27000 - bpl carryoncheckingchannel 32 27000 - txa 33 27000 - pha ; save X for the loop 34 27000 - jsr processsongdata 35 27000 - pla ; restore X for the loop 36 27000 - tax 37 27000 -carryoncheckingchannel 38 27000 - dex 39 27000 - bpl checkchannelloop 40 27000 - lda inactivechannelcount 41 27000 - cmp #15 42 27000 - bne skipstopsong 43 27000 - lda songloops 44 27000 - bne doasongloop 45 27000 - ;lda #0 46 27000 - sta songtempo ; all channels are done. stop the song 47 27000 - rts 48 27000 -doasongloop 49 27000 - bmi skipsongloopadjust 50 27000 - dec songloops 51 27000 -skipsongloopadjust 52 27000 - jsr setsongchannels 53 27000 - jmp servicesongredo 54 27000 -skipstopsong 55 27000 - rts 56 27000 - 57 27000 -processsongdata 58 27000 - ; channel needs processing 59 27000 - ; X=channel # 60 27000 - 61 27000 - txa 62 27000 - clc 63 27000 - adc songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 64 27000 - tay 65 27000 - 66 27000 - 67 27000 - ; ** indirect x is cumbersome with mult-byte commands. 68 27000 - ; ** setup a pointer to the song data for indirect y addressing. 69 27000 - lda songchannel1layer1lo,y 70 27000 - sta songdatalo 71 27000 - lda songchannel1layer1hi,y 72 27000 - sta songdatahi 73 27000 - ora songdatalo 74 27000 - bne channelhasdata 75 27000 - ;channel data is pointing at $0000 76 27000 - lda #$7F 77 27000 - sta songchannel1busywait,x ; skip a bunch of notes 78 27000 -setchannelcountbits 79 27000 - lda channel2bits,x 80 27000 - ora inactivechannelcount 81 27000 - sta inactivechannelcount 82 27000 - rts 83 27000 -channelhasdata 84 27000 - 85 27000 - sty songstackindex 86 27000 - ldy #0 87 27000 - lda (songdatalo),y ; ** load in the next byte of song data, so we can decode it 88 27000 - cmp #$ff 89 27000 - bne carryoncheckingdatatype ; ** $ff=pattern end marker 90 27000 - jmp handlechannelEOD 91 27000 - 92 27000 -carryoncheckingdatatype 93 27000 - and #$F0 94 27000 - cmp #$C0 95 27000 - beq handlechannelrest ; 0000XXXX=rest 96 27000 - cmp #$F0 97 27000 - beq handlemultibytecommand 98 27000 - cmp #$D0 99 27000 - beq handlesemiup 100 27000 - cmp #$E0 101 27000 - beq handlesemidown 102 27000 -handlenotedata 103 27000 - ; ** TODO: note playing is a terrible choice for fall-through 104 27000 - 105 27000 - ; ** its simple note data, prepare arguments for schedulesfx 106 27000 - 107 27000 - ; ** set the note length 108 27000 - lda (songdatalo),y 109 27000 - and #$0F 110 27000 - sta songchannel1busywait,x 111 27000 - 112 27000 - ; ** load the instrument 113 27000 - lda songchannel1instrumentlo,x 114 27000 - sta sfxinstrumentlo 115 27000 - lda songchannel1instrumenthi,x 116 27000 - sta sfxinstrumenthi 117 27000 - 118 27000 - ; ** get the note, and transpose 119 27000 - lda (songdatalo),y 120 27000 - lsr 121 27000 - lsr 122 27000 - lsr 123 27000 - lsr 124 27000 - clc 125 27000 - adc songchannel1transpose,x ; ** add it to the transpose index 126 27000 - ; ** its up the respective SFX scheduler to handle and save the note data 127 27000 - sta sfxnoteindex 128 27000 - 129 27000 - lda #0 130 27000 - sta sfxpitchoffset 131 27000 - 132 27000 - jsr schedulesfx 133 27000 - 134 27000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 135 27000 - 136 27000 -handlechannelrest 137 27000 - ; ** set the note length 138 27000 - lda (songdatalo),y 139 27000 - and #$0F 140 27000 - sta songchannel1busywait,x 141 27000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 142 27000 - 143 27000 -handlesemiup 144 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 145 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 146 27000 - clc 147 27000 -handlesemidownentry 148 27000 - adc songchannel1transpose,x ; ** add it to the transpose index 149 27000 - sta songchannel1transpose,x 150 27000 - jsr advancethesongpointer1byte 151 27000 - jmp processsongdata ; semi doesn't have note length, so process the next data byte... 152 27000 - 153 27000 -handlesemidown 154 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 155 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 156 27000 - eor #$ff ; ** its easier if we negate it, and then add it instead. 157 27000 - sec 158 27000 - jmp handlesemidownentry 159 27000 - 160 27000 -handlemultibytecommand 161 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 162 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 163 27000 - cmp #$08 ; ** load new instrument? 164 27000 - bne nothandleinstrumentchange 165 27000 -handleinstrumentchange 166 27000 - iny 167 27000 - lda (songdatalo),y 168 27000 - sta songchannel1instrumentlo,x 169 27000 - iny 170 27000 - lda (songdatalo),y 171 27000 - sta songchannel1instrumenthi,x 172 27000 - lda #3 173 27000 - jsr advancethesongpointerNbytes ; advance 3 bytes 174 27000 - jmp processsongdata 175 27000 - 176 27000 -nothandleinstrumentchange 177 27000 - cmp #$09 ; ** absolute tempo change? 178 27000 - bne nothandletempochange 179 27000 - lda #0 180 27000 - sta songtempo 181 27000 -handlerelativetempochange 182 27000 - iny 183 27000 - lda (songdatalo),y 184 27000 - clc 185 27000 - adc songtempo 186 27000 - sta songtempo 187 27000 - lda #2 188 27000 - jsr advancethesongpointerNbytes ; advance 2 bytes 189 27000 - jmp processsongdata 190 27000 - 191 27000 -nothandletempochange 192 27000 - cmp #$0A ; ** relative tempo change?: 193 27000 - beq handlerelativetempochange 194 27000 - cmp #$0B ; ** octave/semi change? 195 27000 - beq handleoctavesemichange 196 27000 -handlepatterndata 197 27000 - ; ** if we're here its a pattern/loop "subroutine" 198 27000 - ; ** move the channel's "stack" pointer and populate the new stack level 199 27000 - 200 27000 - lda #4 201 27000 - clc 202 27000 - adc songchannel1stackdepth,x 203 27000 - sta songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 204 27000 - 205 27000 - stx inttemp6 ; about to invalidate x. save it. 206 27000 - lda songstackindex 207 27000 - adc #4 208 27000 - tax 209 27000 - 210 27000 - lda (songdatalo),y 211 27000 - and #$7 212 27000 - sta songchannel1layer1loops,x 213 27000 - iny 214 27000 - lda (songdatalo),y 215 27000 - sta songchannel1layer1lo,x 216 27000 - iny 217 27000 - lda (songdatalo),y 218 27000 - sta songchannel1layer1hi,x 219 27000 - 220 27000 - ldx inttemp6 ; restore x with the channel # 221 27000 - 222 27000 - ; ** advance will operate on the old stack level, since we didn't store the updated songstackindex... 223 27000 - lda #3 224 27000 - jsr advancethesongpointerNbytes ; advance 3 bytes 225 27000 - 226 27000 - ; ** ...but the new stack level will be correctly picked up when we process the next byte. 227 27000 - jmp processsongdata 228 27000 - 229 27000 -handlechannelEOD 230 27000 - ; ** check if there are loops remaining on the pattern 231 27000 - stx inttemp6 232 27000 - ldx songstackindex 233 27000 - dec songchannel1layer1loops,x 234 27000 - bmi handlechannelEODnoloop 235 27000 - ; ** loops are remaining. set the pattern pointer to the pattern start, which is contained after the EOD 236 27000 - iny 237 27000 - lda (songdatalo),y 238 27000 - sta songchannel1layer1lo,x 239 27000 - iny 240 27000 - lda (songdatalo),y 241 27000 - sta songchannel1layer1hi,x 242 27000 - ldx inttemp6 243 27000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 244 27000 - 245 27000 -handlechannelEODnoloop 246 27000 - ; this pattern/loop is done playing. "pop" the stack 247 27000 - ldx inttemp6 248 27000 - lda songchannel1stackdepth,x 249 27000 - beq handlerootchannelEOD 250 27000 - sec 251 27000 - sbc #4 252 27000 - sta songchannel1stackdepth,x 253 27000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 254 27000 - 255 27000 -handlerootchannelEOD 256 27000 - ; this channel is done. point it to $ff data so we no longer process this channel. 257 27000 - lda #0 258 27000 - sta songchannel1layer1lo,x 259 27000 - sta songchannel1layer1hi,x 260 27000 - sta songchannel1busywait,x 261 27000 - jmp setchannelcountbits 262 27000 - rts 263 27000 - 264 27000 -nothandlepatternchange 265 27000 -handleoctavesemichange 266 27000 - iny 267 27000 - lda (songdatalo),y 268 27000 - sta songchannel1transpose,x 269 27000 - lda #2 270 27000 - jsr advancethesongpointerNbytes ; advance 2 bytes 271 27000 - jmp processsongdata 272 27000 - 273 27000 -advancethesongpointer1byte 274 27000 - txa 275 27000 - ldx songstackindex 276 27000 - inc songchannel1layer1lo,x 277 27000 - bne skiphiadvancethesongpointer1byte 278 27000 - inc songchannel1layer1hi,x 279 27000 -skiphiadvancethesongpointer1byte 280 27000 - tax 281 27000 - rts 282 27000 - 283 27000 -advancethesongpointerNbytes 284 27000 - ; entered with A=# of byte to advance 285 27000 - stx inttemp6 286 27000 - ldx songstackindex 287 27000 - clc 288 27000 - adc songchannel1layer1lo,x 289 27000 - sta songchannel1layer1lo,x 290 27000 - lda #0 291 27000 - adc songchannel1layer1hi,x 292 27000 - sta songchannel1layer1hi,x 293 27000 - ldx inttemp6 294 27000 - rts 295 27000 - 296 27000 -clearsongmemory 297 27000 - lda #0 298 27000 - ldx #(songchannel4instrumenthi-songchannel1layer1lo) 299 27000 -clearsongmemoryloop1 300 27000 - sta songchannel1layer1lo,x 301 27000 - dex 302 27000 - bpl clearsongmemoryloop1 303 27000 - 304 27000 - ldx #(songchannel4stackdepth-songchannel1layer1loops) 305 27000 -clearsongmemoryloop2 306 27000 - sta songchannel1layer1loops,x 307 27000 - dex 308 27000 - bpl clearsongmemoryloop2 309 27000 - 310 27000 - lda #$ff 311 27000 - ldx #3 312 27000 -clearsongmemoryloop3 313 27000 - sta songchannel1busywait,x 314 27000 - dex 315 27000 - bpl clearsongmemoryloop3 316 27000 - rts 317 27000 - 318 27000 -setsongchannels 319 27000 - jsr clearsongmemory 320 27000 - ldy #7 321 27000 - ldx #3 322 27000 -setsongchannelsloop 323 27000 - lda (songpointerlo),y 324 27000 - sta songchannel1layer1hi,x 325 27000 - dey 326 27000 - lda (songpointerlo),y 327 27000 - sta songchannel1layer1lo,x 328 27000 - dex 329 27000 - dey 330 27000 - bpl setsongchannelsloop 331 27000 - rts 332 27000 - 333 27000 -channel2bits 334 27000 - .byte 1,2,4,8 335 27000 - 336 27000 -tiatrackeroctavenotes 337 27000 - ifconst BUZZBASS 338 27000 -LOWC = 15 339 27000 - else 340 27000 -LOWC = 14 341 27000 - endif 342 27000 - ; ****** ELECTRONIC (0 to 11) 343 27000 - .byte LOWC,20 ; c0 16.1Hz 344 27000 - .byte LOWC,18 ; c#0 345 27000 - .byte LOWC,17 ; d0 346 27000 - .byte LOWC,16 ; d#0 347 27000 - .byte LOWC,15 ; e0 348 27000 - .byte LOWC,14 ; f0 (very off) 349 27000 - .byte LOWC,14 ; f#0 350 27000 - .byte LOWC,13 ; g0 351 27000 - .byte LOWC,12 ; g#0 352 27000 - .byte LOWC,11 ; a0 353 27000 - .byte LOWC,11 ; a#0 (very off) 354 27000 - .byte LOWC,10 ; b0 30.7Hz 355 27000 - 356 27000 - ; ****** SLIGHTLY BUZZY (12 to 23) 357 27000 - .byte 6,30 ; c1 32.7Hz 358 27000 - .byte 6,28 ; c#1 359 27000 - .byte 6,27 ; d1 360 27000 - .byte 6,25 ; d#1 361 27000 - .byte 6,24 ; e1 362 27000 - .byte 6,22 ; f1 363 27000 - .byte 6,21 ; f#1 364 27000 - .byte 6,20 ; g1 365 27000 - .byte 6,18 ; g#1 366 27000 - .byte 6,17 ; a1 367 27000 - .byte 6,16 ; a#1 368 27000 - .byte 6,15 ; b1 63.4Hz 369 27000 - 370 27000 - ; ****** BUZZY (24 to 39) 371 27000 - .byte 1,31 ; c2 65.5 372 27000 - .byte 1,30 ; c#2 67.6 373 27000 - .byte 1,27 ; d2 72.3 374 27000 - .byte 1,26 ; d#2 77.6 375 27000 - .byte 1,24 ; e2 376 27000 - .byte 1,23 ; f2 377 27000 - .byte 1,22 ; f#2 378 27000 - .byte 1,20 ; g2 379 27000 - .byte 1,19 ; g#2 380 27000 - .byte 1,18 ; a2 381 27000 - .byte 1,17 ; a#2 382 27000 - .byte 1,16 ; b2 383 27000 - .byte 1,15 ; c3 126.8Hz 384 27000 - .byte 1,14 ; c#3 385 27000 - .byte 1,13 ; d3 149.7Hz 386 27000 - .byte 1,12 ; d#3 161.2Hz (very off) 387 27000 - ; ****** PURE (40 to 71) - best key is A3 Major 388 27000 - .byte 12,31 ; e3 163.8Hz 389 27000 - .byte 12,29 ; f3 390 27000 - .byte 12,28 ; f#3 391 27000 - .byte 12,26 ; g3 392 27000 - .byte 12,24 ; g#3 393 27000 - .byte 12,23 ; a3 songs in key of A benefit from Perceptual Tuning 394 27000 - .byte 12,22 ; a#3 395 27000 - .byte 12,20 ; b3 396 27000 - .byte 12,19 ; c4 (middle C) 397 27000 - .byte 12,18 ; c#4 398 27000 - .byte 12,17 ; d4 399 27000 - .byte 12,16 ; d#4 400 27000 - .byte 12,15 ; e4 401 27000 - .byte 12,14 ; f4 402 27000 - .byte 12,13 ; f#4 403 27000 - .byte 12,12 ; g4 (very off) 404 27000 - .byte 12,12 ; g#4 405 27000 - .byte 12,11 ; a4 406 27000 - .byte 12,10 ; a#4 407 27000 - .byte 4,31 ; b4 408 27000 - .byte 4,29 ; c5 409 27000 - .byte 4,28 ; c#5 410 27000 - .byte 4,26 ; d5 411 27000 - .byte 4,24 ; d#5 412 27000 - .byte 4,23 ; e5 413 27000 - .byte 4,22 ; f5 414 27000 - .byte 4,20 ; f#5 415 27000 - .byte 4,19 ; g5 416 27000 - .byte 4,18 ; g#5 417 27000 - .byte 4,17 ; a5 418 27000 - .byte 4,16 ; a#5 419 27000 - .byte 4,15 ; b5 420 27000 - 421 27000 - ; ****** TUNED WIND (72 to 83) 422 27000 - .byte 8,30 ; c 423 27000 - .byte 8,28 ; c# 424 27000 - .byte 8,27 ; d 425 27000 - .byte 8,25 ; d# 426 27000 - .byte 8,24 ; e 427 27000 - .byte 8,22 ; f 428 27000 - .byte 8,21 ; f# 429 27000 - .byte 8,20 ; g 430 27000 - .byte 8,18 ; g# 431 27000 - .byte 8,17 ; a 432 27000 - .byte 8,16 ; a# 433 27000 - .byte 8,15 ; b 434 27000 - 435 27000 - include "tiadrumkit.asm" 436 27000 - 437 27000 -trackerend 438 27000 - 439 27000 - echo " (tracker module is using ",[(trackerend-trackerstart)]d," bytes)" 440 27000 - 441 27000 endif ;MUSICTRACKER ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Menu_Demo_v2.78b.asm 4853 27000 endif 4854 27000 ifnconst included.hiscore.asm ------- FILE hiscore.asm LEVEL 2 PASS 3 0 27000 include hiscore.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 - ifconst HSSUPPORT 4 27000 - 5 27000 - ifconst BANKSETROM 6 27000 - ifconst isBANKSETBANK 7 27000 -HSCHARSHERE = 1 8 27000 - endif 9 27000 - else ; !BANKSETROM so embed the character strings 10 27000 -HSCHARSHERE = 1 11 27000 - endif 12 27000 - 13 27000 - ifnconst isBANKSETBANK 14 27000 -hiscorestart 15 27000 - 16 27000 -detectatarivoxeeprom 17 27000 -hiscoremodulestart 18 27000 - ; do a test to see if atarivox eeprom can be accessed, and save results 19 27000 - jsr AVoxDetect 20 27000 - eor #$ff ; invert for easy 7800basic if...then logic 21 27000 - sta avoxdetected 22 27000 - lda #$0 23 27000 - sta SWACNT 24 27000 - lda avoxdetected 25 27000 - rts 26 27000 - 27 27000 -detecthsc 28 27000 - ; check for the HSC ROM signature... 29 27000 - lda XCTRL1s 30 27000 - ora #%00001100 31 27000 - sta XCTRL1s 32 27000 - sta XCTRL1 33 27000 - lda $3900 34 27000 - eor #$C6 35 27000 - bne detecthscfail 36 27000 - lda $3904 37 27000 - eor #$FE 38 27000 - bne detecthscfail 39 27000 - ; check if it's initialized... 40 27000 - ldy #0 41 27000 - lda #$ff 42 27000 -checkhscinit 43 27000 - and $1000,y 44 27000 - dey 45 27000 - bpl checkhscinit 46 27000 - cmp #$ff 47 27000 - bne hscisalreadyinit 48 27000 - ; if we're here, we need to do a minimal HSC init... 49 27000 - ldy #$28 50 27000 -hscinitloop1 51 27000 - lda hscheader,y 52 27000 - sta $1000,y 53 27000 - dey 54 27000 - bpl hscinitloop1 55 27000 - ldy #$89 56 27000 - lda #$7F 57 27000 -hscinitloop2 58 27000 - sta $10B3,y 59 27000 - dey 60 27000 - cpy #$ff 61 27000 - bne hscinitloop2 62 27000 -hscisalreadyinit 63 27000 - lda #$ff 64 27000 - rts 65 27000 -hscheader 66 27000 - .byte $00,$00,$68,$83,$AA,$55,$9C,$FF,$07,$12,$02,$1F,$00,$00,$00,$00 67 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 68 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$03 69 27000 -detecthscfail 70 27000 - lda XCTRL1s 71 27000 - and #%11110111 72 27000 - sta XCTRL1s 73 27000 - lda #0 74 27000 - rts 75 27000 - endif ; isBANKSETBANK 76 27000 - 77 27000 - ifnconst hiscorefont 78 27000 - echo "" 79 27000 - echo "WARNING: High score support is enabled, but the hiscorefont.png was" 80 27000 - echo " NOT imported with incgraphic. The high score display code" 81 27000 - echo " has been omitted from this build." 82 27000 - echo "" 83 27000 - else ; hiscorefont 84 27000 - ifnconst isBANKSETBANK 85 27000 -hscdrawscreen 86 27000 - 87 27000 - ; we use 20 lines on a 24 line display 88 27000 - ; HSSCOREY to dynamically centers based on 89 27000 - ;HSSCOREY = 0 90 27000 -HSSCOREY = ((WZONECOUNT*WZONEHEIGHT/8)-22)/2 91 27000 -HSCURSORY = ((HSSCOREY/(WZONEHEIGHT/8))*WZONEHEIGHT) 92 27000 - 93 27000 - ifconst HSSCORESIZE 94 27000 -SCORESIZE = HSSCORESIZE 95 27000 - else 96 27000 -SCORESIZE = 6 97 27000 - endif 98 27000 - 99 27000 - ;save shadow registers for later return... 100 27000 - lda sCTRL 101 27000 - sta ssCTRL 102 27000 - lda sCHARBASE 103 27000 - sta ssCHARBASE 104 27000 - lda #$60 105 27000 - sta charactermode 106 27000 - jsr drawwait 107 27000 - jsr blacken320colors 108 27000 - jsr clearscreen 109 27000 - 110 27000 - ;set the character base to the HSC font 111 27000 - lda #>hiscorefont 112 27000 - sta CHARBASE 113 27000 - sta sCHARBASE 114 27000 - lda #%01000011 ;Enable DMA, mode=320A 115 27000 - sta CTRL 116 27000 - sta sCTRL 117 27000 - 118 27000 - lda #60 119 27000 - sta hsjoydebounce 120 27000 - 121 27000 - lda #0 122 27000 - sta hscursorx 123 27000 - sta framecounter 124 27000 - ifnconst HSCOLORCHASESTART 125 27000 - lda #$8D ; default is blue. why not? 126 27000 - else 127 27000 - lda #HSCOLORCHASESTART 128 27000 - endif 129 27000 - sta hscolorchaseindex 130 27000 - 131 27000 - lda #$0F 132 27000 - sta P0C2 ; base text is white 133 27000 - 134 27000 - jsr hschasecolors 135 27000 - ; ** plot all of the initials 136 27000 - lda #HSRAMInitials 139 27000 - sta temp2 ; charmaphi 140 27000 - lda #32+29 ; palette=0-29 | 32-(width=3) 141 27000 - sta temp3 ; palette/width 142 27000 - lda #104 143 27000 - sta temp4 ; X 144 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 145 27000 - sta temp5 ; Y 146 27000 -plothsinitialsloop 147 27000 - jsr plotcharacters 148 27000 - clc 149 27000 - lda temp3 150 27000 - adc #32 151 27000 - sta temp3 152 27000 - inc temp5 153 27000 - if WZONEHEIGHT = 8 154 27000 - inc temp5 155 27000 - endif 156 27000 - clc 157 27000 - lda #3 158 27000 - adc temp1 159 27000 - sta temp1 160 27000 - cmp #(<(HSRAMInitials+15)) 161 27000 - bcc plothsinitialsloop 162 27000 - 163 27000 - ifconst HSGAMENAMELEN 164 27000 - ;plot the game name... 165 27000 - lda #HSGAMENAMEtable 168 27000 - sta temp2 ; charmaphi 169 27000 - lda #(32-HSGAMENAMELEN) ; palette=0*29 | 32-(width=3) 170 27000 - sta temp3 ; palette/width 171 27000 - lda #(80-(HSGAMENAMELEN*2)) 172 27000 - sta temp4 ; X 173 27000 - lda #((HSSCOREY+0)/(WZONEHEIGHT/8)) 174 27000 - sta temp5 ; Y 175 27000 - jsr plotcharacters 176 27000 - endif ; HSGAMENAMELEN 177 27000 - 178 27000 - ;plot "difficulty"... 179 27000 - ldy gamedifficulty 180 27000 - ifnconst HSNOLEVELNAMES 181 27000 - lda highscoredifficultytextlo,y 182 27000 - sta temp1 183 27000 - lda highscoredifficultytexthi,y 184 27000 - sta temp2 185 27000 - sec 186 27000 - lda #32 187 27000 - sbc highscoredifficultytextlen,y 188 27000 - sta temp3 ; palette/width 189 27000 - sec 190 27000 - lda #40 191 27000 - sbc highscoredifficultytextlen,y 192 27000 - asl 193 27000 - sta temp4 ; X 194 27000 - else 195 27000 - lda #HSHIGHSCOREStext 198 27000 - sta temp2 ; charmaphi 199 27000 - lda #(32-11) ; palette=0*29 | 32-(width=3) 200 27000 - sta temp3 ; palette/width 201 27000 - lda #(80-(11*2)) 202 27000 - sta temp4 ; X 203 27000 - endif ; HSNOLEVELNAMES 204 27000 - 205 27000 - lda #((HSSCOREY+2)/(WZONEHEIGHT/8)) 206 27000 - sta temp5 ; Y 207 27000 - jsr plotcharacters 208 27000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 209 27000 - bne carronwithscoreevaluation 210 27000 - jmp donoscoreevaluation 211 27000 -carronwithscoreevaluation 212 27000 - dey 213 27000 - lda highscorelabeltextlo,y 214 27000 - sta temp1 215 27000 - lda highscorelabeltexthi,y 216 27000 - sta temp2 217 27000 - sec 218 27000 - lda #(32-15) ; palette=0*29 | 32-(width=3) 219 27000 - sta temp3 ; palette/width 220 27000 - lda highscorelabeladjust1,y 221 27000 - sta temp4 ; X 222 27000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 223 27000 - sta temp5 ; Y 224 27000 - jsr plotcharacters 225 27000 - 226 27000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 227 27000 - dey 228 27000 - ;plot the current player score... 229 27000 - lda #(32-SCORESIZE) ; palette=0*32 230 27000 - sta temp3 ; palette/width 231 27000 - lda highscorelabeladjust2,y 232 27000 - sta temp4 ; X 233 27000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 234 27000 - sta temp5 ; Y 235 27000 - 236 27000 - lda scorevarlo,y 237 27000 - sta temp7 ; score variable lo 238 27000 - lda scorevarhi,y 239 27000 - sta temp8 ; score variable hi 240 27000 - 241 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 242 27000 - sta temp9 243 27000 - 244 27000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 245 27000 - sta temp1 ; charmaplo 246 27000 - lda #>(hiscorefont+33) 247 27000 - sta temp2 ; charmaphi 248 27000 - lda #SCORESIZE 249 27000 - sta temp6 250 27000 - ifnconst DOUBLEWIDE 251 27000 - jsr plotvalue 252 27000 - else 253 27000 - jsr plotvaluedw 254 27000 - endif 255 27000 - 256 27000 -USED_PLOTVALUE = 1 ; ensure that plotvalue gets compiled in 257 27000 - 258 27000 - ifconst HSGAMERANKS 259 27000 - 260 27000 - ldx #$ff ; start at 0 after the inx... 261 27000 -comparescore2rankloop 262 27000 - inx 263 27000 - ldy #0 264 27000 - lda rankvalue_0,x 265 27000 - cmp (temp7),y 266 27000 - bcc score2rankloopdone 267 27000 - bne comparescore2rankloop 268 27000 - iny 269 27000 - lda rankvalue_1,x 270 27000 - cmp (temp7),y 271 27000 - bcc score2rankloopdone 272 27000 - bne comparescore2rankloop 273 27000 - iny 274 27000 - lda (temp7),y 275 27000 - cmp rankvalue_2,x 276 27000 - bcs score2rankloopdone 277 27000 - jmp comparescore2rankloop 278 27000 -score2rankloopdone 279 27000 - stx hsnewscorerank 280 27000 - 281 27000 - lda ranklabello,x 282 27000 - sta temp1 283 27000 - lda ranklabelhi,x 284 27000 - sta temp2 285 27000 - sec 286 27000 - lda #32 ; palette=0*29 | 32-(width=3) 287 27000 - sbc ranklabellengths,x 288 27000 - sta temp3 ; palette/width 289 27000 - sec 290 27000 - lda #(40+6) 291 27000 - sbc ranklabellengths,x 292 27000 - asl 293 27000 - sta temp4 ; X 294 27000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 295 27000 - sta temp5 ; Y 296 27000 - jsr plotcharacters 297 27000 - 298 27000 - ldx hsnewscorerank 299 27000 - 300 27000 - lda #highscoreranklabel 303 27000 - sta temp2 304 27000 - 305 27000 - lda #(32-5) ; palette=0*29 | 32-(width=3) 306 27000 - sta temp3 ; palette/width 307 27000 - lda #(40-6) 308 27000 - sec 309 27000 - sbc ranklabellengths,x 310 27000 - asl 311 27000 - sta temp4 ; X 312 27000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 313 27000 - sta temp5 ; Y 314 27000 - jsr plotcharacters 315 27000 - endif ; HSGAMERANKS 316 27000 - 317 27000 - 318 27000 - ; ** which line did this player beat? 319 27000 - lda #$ff 320 27000 - sta hsnewscoreline 321 27000 - ldx #$fd 322 27000 -comparescoreadd2x 323 27000 - inx 324 27000 -comparescoreadd1x 325 27000 - inx 326 27000 -comparescore2lineloop 327 27000 - inc hsnewscoreline 328 27000 - inx ; initialrun, x=0 329 27000 - cpx #15 330 27000 - beq nohighscoreforyou 331 27000 - ldy #0 332 27000 - lda HSRAMScores,x 333 27000 - cmp (temp7),y ; first score digit 334 27000 - bcc score2lineloopdonedel1x 335 27000 - bne comparescoreadd2x 336 27000 - iny 337 27000 - inx 338 27000 - lda HSRAMScores,x 339 27000 - cmp (temp7),y 340 27000 - bcc score2lineloopdonedel2x 341 27000 - bne comparescoreadd1x 342 27000 - iny 343 27000 - inx 344 27000 - lda (temp7),y 345 27000 - cmp HSRAMScores,x 346 27000 - bcs score2lineloopdonedel3x 347 27000 - jmp comparescore2lineloop 348 27000 -nohighscoreforyou 349 27000 - lda #$ff 350 27000 - sta hsnewscoreline 351 27000 - sta countdownseconds 352 27000 - jmp donoscoreevaluation 353 27000 -score2lineloopdonedel3x 354 27000 - dex 355 27000 -score2lineloopdonedel2x 356 27000 - dex 357 27000 -score2lineloopdonedel1x 358 27000 - dex 359 27000 - 360 27000 - ; 0 1 2 361 27000 - ; 3 4 5 362 27000 - ; 6 7 8 363 27000 - ; 9 0 1 364 27000 - ; 2 3 4 365 27000 - 366 27000 - stx temp9 367 27000 - cpx #11 368 27000 - beq postsortscoresuploop 369 27000 - ldx #11 370 27000 -sortscoresuploop 371 27000 - lda HSRAMScores,x 372 27000 - sta HSRAMScores+3,x 373 27000 - lda HSRAMInitials,x 374 27000 - sta HSRAMInitials+3,x 375 27000 - dex 376 27000 - cpx temp9 377 27000 - bne sortscoresuploop 378 27000 -postsortscoresuploop 379 27000 - 380 27000 - ;stick the score and cleared initials in the slot... 381 27000 - inx 382 27000 - ldy #0 383 27000 - sty hsinitialhold 384 27000 - lda (temp7),y 385 27000 - sta HSRAMScores,x 386 27000 - iny 387 27000 - lda (temp7),y 388 27000 - sta HSRAMScores+1,x 389 27000 - iny 390 27000 - lda (temp7),y 391 27000 - sta HSRAMScores+2,x 392 27000 - lda #0 393 27000 - sta HSRAMInitials,x 394 27000 - lda #29 395 27000 - sta HSRAMInitials+1,x 396 27000 - sta HSRAMInitials+2,x 397 27000 - 398 27000 - stx hsinitialpos 399 27000 - 400 27000 - ifconst vox_highscore 401 27000 - lda <#vox_highscore 402 27000 - sta speech_addr 403 27000 - lda >#vox_highscore 404 27000 - sta speech_addr+1 405 27000 - endif ; vox_highscore 406 27000 - ifconst sfx_highscore 407 27000 - lda <#sfx_highscore 408 27000 - sta temp1 409 27000 - lda >#sfx_highscore 410 27000 - sta temp2 411 27000 - lda #0 412 27000 - sta temp3 413 27000 - jsr schedulesfx 414 27000 - endif ; sfx_highscore 415 27000 - ifconst songdatastart_song_highscore 416 27000 - lda #songchanneltable_song_highscore 419 27000 - sta songpointerhi 420 27000 - lda #73 421 27000 - sta songtempo 422 27000 - jsr setsongchannels 423 27000 - endif ; songdatastart_song_highscore 424 27000 - 425 27000 - 426 27000 -donoscoreevaluation 427 27000 - 428 27000 - lda #(32+(32-SCORESIZE)) ; palette=0*32 | 32-(width=6) 429 27000 - sta temp3 ; palette/width 430 27000 - lda #(72+(4*(6-SCORESIZE))) 431 27000 - sta temp4 ; X 432 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 433 27000 - sta temp5 ; Y 434 27000 - lda #HSRAMScores 437 27000 - sta temp8 ; score variable hi 438 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 439 27000 - sta temp9 440 27000 -plothsscoresloop 441 27000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 442 27000 - sta temp1 ; charmaplo 443 27000 - lda #>(hiscorefont+33) 444 27000 - sta temp2 ; charmaphi 445 27000 - lda #6 446 27000 - sta temp6 447 27000 - ifnconst DOUBLEWIDE 448 27000 - jsr plotvalue 449 27000 - else 450 27000 - jsr plotvaluedw 451 27000 - endif 452 27000 - clc 453 27000 - lda temp3 454 27000 - adc #32 455 27000 - sta temp3 456 27000 - inc temp5 457 27000 - if WZONEHEIGHT = 8 458 27000 - inc temp5 459 27000 - endif 460 27000 - clc 461 27000 - lda #3 462 27000 - adc temp7 463 27000 - sta temp7 464 27000 - cmp #(<(HSRAMScores+15)) 465 27000 - bcc plothsscoresloop 466 27000 -plothsindex 467 27000 - lda #32+31 ; palette=0*32 | 32-(width=1) 468 27000 - sta temp3 ; palette/width 469 27000 - lda #44 470 27000 - sta temp4 ; X 471 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 472 27000 - sta temp5 ; Y 473 27000 - lda #hsgameslotnumbers 476 27000 - sta temp8 ; score variable hi 477 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 478 27000 - sta temp9 479 27000 -plothsindexloop 480 27000 - lda #<(hiscorefont+33) 481 27000 - sta temp1 ; charmaplo 482 27000 - lda #>(hiscorefont+33) 483 27000 - sta temp2 ; charmaphi 484 27000 - lda #1 485 27000 - sta temp6 ; number of characters 486 27000 - ifnconst DOUBLEWIDE 487 27000 - jsr plotvalue 488 27000 - else 489 27000 - jsr plotvaluedw 490 27000 - endif 491 27000 - clc 492 27000 - lda temp3 493 27000 - adc #32 494 27000 - sta temp3 495 27000 - inc temp5 496 27000 - if WZONEHEIGHT = 8 497 27000 - inc temp5 498 27000 - endif 499 27000 - inc temp7 500 27000 - lda temp7 501 27000 - cmp #(<(hsgameslotnumbers+5)) 502 27000 - bcc plothsindexloop 503 27000 - 504 27000 - jsr savescreen 505 27000 - ifnconst HSSECONDS 506 27000 - lda #6 507 27000 - else 508 27000 - lda #HSSECONDS 509 27000 - endif 510 27000 - 511 27000 - sta countdownseconds 512 27000 - 513 27000 -keepdisplayinghs 514 27000 - jsr restorescreen 515 27000 - 516 27000 - jsr setuphsinpt1 517 27000 - 518 27000 - lda hsnewscoreline 519 27000 - bpl carryonkeepdisplayinghs 520 27000 - jmp skipenterscorecontrol 521 27000 -carryonkeepdisplayinghs 522 27000 - 523 27000 - 524 27000 - ifnconst HSSECONDS 525 27000 - lda #6 526 27000 - else 527 27000 - lda #HSSECONDS 528 27000 - endif 529 27000 - 530 27000 - sta countdownseconds 531 27000 - 532 27000 - ;plot the "cursor" initial sprite... 533 27000 - lda hsinitialhold 534 27000 - 535 27000 - sta temp1 536 27000 - lda #>(hiscorefont+32) 537 27000 - sta temp2 538 27000 - lda #31 ; palette=0*32 | 32-(width=1) 539 27000 - sta temp3 ; palette/width 540 27000 - lda hscursorx 541 27000 - asl 542 27000 - asl 543 27000 - clc 544 27000 - adc #104 545 27000 - sta temp4 ; X 546 27000 - lda hsnewscoreline 547 27000 - asl 548 27000 - asl 549 27000 - asl 550 27000 - asl 551 27000 - adc #((3*16)+HSCURSORY) 552 27000 - sta temp5 ; Y 553 27000 - lda #%01000000 554 27000 - sta temp6 555 27000 - jsr plotsprite 556 27000 - 557 27000 - ldx hscursorx 558 27000 - ldy hsdisplaymode 559 27000 - ifnconst .HSup 560 27000 - lda SWCHA 561 27000 - cpy #3 562 27000 - bne hsskipadjustjoystick1 563 27000 - asl 564 27000 - asl 565 27000 - asl 566 27000 - asl 567 27000 -hsskipadjustjoystick1 568 27000 - sta hsswcha 569 27000 - else ; there are user-defined routines! 570 27000 - jsr .HSdown 571 27000 - lda hsreturn ; b0 572 27000 - asl 573 27000 - pha 574 27000 - jsr .HSup 575 27000 - pla 576 27000 - ora hsreturn 577 27000 - asl 578 27000 - asl 579 27000 - asl 580 27000 - asl 581 27000 - eor #$FF 582 27000 - sta hsswcha 583 27000 - endif 584 27000 - lda SWCHB 585 27000 - and #%00000010 586 27000 - bne hsskipselectswitch 587 27000 - lda #%00010000 588 27000 - sta hsswcha 589 27000 - bne hsdodebouncecheck 590 27000 -hsskipselectswitch 591 27000 - lda hsswcha 592 27000 - and #%00110000 593 27000 - cmp #%00110000 594 27000 - beq hsjoystickskipped 595 27000 -hsdodebouncecheck 596 27000 - lda hsjoydebounce 597 27000 - beq hsdontdebounce 598 27000 - jmp hspostjoystick 599 27000 -hsdontdebounce 600 27000 - ldx #1 ; small tick sound 601 27000 - jsr playhssfx 602 27000 - lda hsswcha 603 27000 - and #%00110000 604 27000 - ldx hscursorx 605 27000 - cmp #%00100000 ; check down 606 27000 - bne hsjoycheckup 607 27000 - ldy hsinitialhold 608 27000 - cpx #0 609 27000 - bne skipavoid31_1 610 27000 - cpy #0 ; if we're about to change to the <- char (#31) then double-decrement to skip over it 611 27000 - bne skipavoid31_1 612 27000 - dey 613 27000 -skipavoid31_1 614 27000 - dey 615 27000 - jmp hssetdebounce 616 27000 -hsjoycheckup 617 27000 - cmp #%00010000 ; check up 618 27000 - bne hsjoystickskipped 619 27000 - ldy hsinitialhold 620 27000 - cpx #0 621 27000 - bne skipavoid31_2 622 27000 - cpy #30 ; if we're about to change to the <- char (#31) then double-increment to skip over it 623 27000 - bne skipavoid31_2 624 27000 - iny 625 27000 -skipavoid31_2 626 27000 - iny 627 27000 -hssetdebounce 628 27000 - tya 629 27000 - and #31 630 27000 - sta hsinitialhold 631 27000 - lda #15 632 27000 - sta hsjoydebounce 633 27000 - bne hspostjoystick 634 27000 -hsjoystickskipped 635 27000 - ; check the fire button only when the stick isn't engaged 636 27000 - lda hsinpt1 637 27000 - bpl hsbuttonskipped 638 27000 - lda hsjoydebounce 639 27000 - bne hspostjoystick 640 27000 -hsfiredontdebounce 641 27000 - lda hsinitialhold 642 27000 - cmp #31 643 27000 - beq hsmovecursorback 644 27000 - inc hscursorx 645 27000 - inc hsinitialpos 646 27000 - lda hscursorx 647 27000 - cmp #3 648 27000 - bne skiphsentryisdone 649 27000 - lda #0 650 27000 - sta framecounter 651 27000 - lda #$ff 652 27000 - sta hsnewscoreline 653 27000 - dec hsinitialpos 654 27000 - bne skiphsentryisdone 655 27000 -hsmovecursorback 656 27000 - lda hscursorx 657 27000 - beq skiphsmovecursorback 658 27000 - lda #29 659 27000 - ldx hsinitialpos 660 27000 - sta HSRAMInitials,x 661 27000 - dec hsinitialpos 662 27000 - dec hscursorx 663 27000 - dex 664 27000 - lda HSRAMInitials,x 665 27000 - sta hsinitialhold 666 27000 -skiphsmovecursorback 667 27000 -skiphsentryisdone 668 27000 - ldx #0 669 27000 - jsr playhssfx 670 27000 - lda #20 671 27000 - sta hsjoydebounce 672 27000 - bne hspostjoystick 673 27000 - 674 27000 -hsbuttonskipped 675 27000 - lda #0 676 27000 - sta hsjoydebounce 677 27000 -hspostjoystick 678 27000 - 679 27000 - ldx hsinitialpos 680 27000 - lda hsinitialhold 681 27000 - sta HSRAMInitials,x 682 27000 - 683 27000 - jmp skiphschasecolors 684 27000 - 685 27000 -skipenterscorecontrol 686 27000 - jsr hschasecolors 687 27000 - jsr setuphsinpt1 688 27000 - lda hsjoydebounce 689 27000 - bne skiphschasecolors 690 27000 - lda hsinpt1 691 27000 - bmi returnfromhs 692 27000 -skiphschasecolors 693 27000 - 694 27000 - jsr drawscreen 695 27000 - 696 27000 - lda countdownseconds 697 27000 - beq returnfromhs 698 27000 - jmp keepdisplayinghs 699 27000 -returnfromhs 700 27000 - 701 27000 - ifconst songdatastart_song_highscore 702 27000 - lda hsdisplaymode 703 27000 - beq skipclearHSCsong 704 27000 - lda #0 705 27000 - sta songtempo 706 27000 -skipclearHSCsong 707 27000 - endif 708 27000 - jsr drawwait 709 27000 - jsr clearscreen 710 27000 - lda #0 711 27000 - ldy #7 712 27000 - jsr blacken320colors 713 27000 - lda ssCTRL 714 27000 - sta sCTRL 715 27000 - lda ssCHARBASE 716 27000 - sta sCHARBASE 717 27000 - rts 718 27000 - 719 27000 -setuphsinpt1 720 27000 - lda #$ff 721 27000 - sta hsinpt1 722 27000 - lda hsjoydebounce 723 27000 - beq skipdebounceadjust 724 27000 - dec hsjoydebounce 725 27000 - bne skipstorefirebuttonstatus 726 27000 -skipdebounceadjust 727 27000 - lda SWCHB 728 27000 - and #%00000001 729 27000 - bne hscheckresetover 730 27000 - lda #$ff 731 27000 - sta hsinpt1 732 27000 - rts 733 27000 -hscheckresetover 734 27000 - ifnconst .HSup 735 27000 - ldx hsdisplaymode 736 27000 - cpx #3 737 27000 - bne hsskipadjustjoyfire1 738 27000 - lda sINPT3 739 27000 - jmp hsskipadjustjoyfire1done 740 27000 -hsskipadjustjoyfire1 741 27000 - lda sINPT1 742 27000 -hsskipadjustjoyfire1done 743 27000 - sta hsinpt1 744 27000 - else ; there are user-defined routines! 745 27000 - jsr .HSselect 746 27000 - lda hsreturn 747 27000 - ror ; carry 748 27000 - ror ; b7 749 27000 - sta hsinpt1 750 27000 - endif .HSup 751 27000 -skipstorefirebuttonstatus 752 27000 - rts 753 27000 - 754 27000 -blacken320colors 755 27000 - ldy #7 756 27000 -blacken320colorsloop 757 27000 - sta P0C2,y 758 27000 - dey 759 27000 - bpl blacken320colorsloop 760 27000 - rts 761 27000 - 762 27000 -hschasecolors 763 27000 - lda framecounter 764 27000 - and #3 765 27000 - bne hschasecolorsreturn 766 27000 - inc hscolorchaseindex 767 27000 - lda hscolorchaseindex 768 27000 - 769 27000 - sta P5C2 770 27000 - sbc #$02 771 27000 - sta P4C2 772 27000 - sbc #$02 773 27000 - sta P3C2 774 27000 - sbc #$02 775 27000 - sta P2C2 776 27000 - sbc #$02 777 27000 - sta P1C2 778 27000 -hschasecolorsreturn 779 27000 - rts 780 27000 - 781 27000 -playhssfx 782 27000 - lda hssfx_lo,x 783 27000 - sta temp1 784 27000 - lda hssfx_hi,x 785 27000 - sta temp2 786 27000 - lda #0 787 27000 - sta temp3 788 27000 - jmp schedulesfx 789 27000 - 790 27000 -hssfx_lo 791 27000 - .byte sfx_hsletterpositionchange, >sfx_hslettertick 794 27000 - 795 27000 -sfx_hsletterpositionchange 796 27000 - .byte $10,$18,$00 797 27000 - .byte $02,$06,$08 798 27000 - .byte $02,$06,$04 799 27000 - .byte $00,$00,$00 800 27000 -sfx_hslettertick 801 27000 - .byte $10,$18,$00 802 27000 - .byte $00,$00,$0a 803 27000 - .byte $00,$00,$00 804 27000 - 805 27000 -highscorelabeladjust1 806 27000 - .byte (80-(14*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)) 807 27000 -highscorelabeladjust2 808 27000 - .byte (80+(14*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)) 809 27000 - 810 27000 -scorevarlo 811 27000 - .byte <(score0+((6-SCORESIZE)/2)),<(score0+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)) 812 27000 -scorevarhi 813 27000 - .byte >(score0+((6-SCORESIZE)/2)),>(score0+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)) 814 27000 - 815 27000 - endif ; !isBANKSETBANK 816 27000 - 817 27000 - ifnconst HSNOLEVELNAMES 818 27000 - ifnconst isBANKSETBANK 819 27000 -highscoredifficultytextlo 820 27000 - .byte easylevelname, >mediumlevelname, >hardlevelname, >expertlevelname 823 27000 - endif ; !isBANKSETBANK 824 27000 - 825 27000 - ifnconst HSCUSTOMLEVELNAMES 826 27000 - ifnconst isBANKSETBANK 827 27000 -highscoredifficultytextlen 828 27000 - .byte 22, 30, 26, 24 829 27000 - endif ; !isBANKSETBANK 830 27000 - 831 27000 - ifconst HSCHARSHERE 832 27000 - 833 27000 -easylevelname 834 27000 - .byte $04,$00,$12,$18,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 835 27000 -mediumlevelname 836 27000 - .byte $08,$0d,$13,$04,$11,$0c,$04,$03,$08,$00,$13,$04,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 837 27000 -hardlevelname 838 27000 - .byte $00,$03,$15,$00,$0d,$02,$04,$03,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 839 27000 -expertlevelname 840 27000 - .byte $04,$17,$0f,$04,$11,$13,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 841 27000 - endif ; HSCHARSHERE 842 27000 - else ; HSCUSTOMLEVELNAMES 843 27000 - include "7800hsgamediffnames.asm" 844 27000 - endif ; HSCUSTOMLEVELNAMES 845 27000 - else ; HSNOLEVELNAMES 846 27000 - ifconst HSCHARSHERE 847 27000 -HSHIGHSCOREStext 848 27000 - .byte $07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 849 27000 - endif ; HSCHARSHERE 850 27000 - endif ; HSNOLEVELNAMES 851 27000 - 852 27000 - ifnconst isBANKSETBANK 853 27000 -highscorelabeltextlo 854 27000 - .byte player0label, >player1label, >player2label, >player2label 857 27000 - endif ; !isBANKSETBANK 858 27000 - 859 27000 - ifconst HSCHARSHERE 860 27000 -player0label 861 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$12,$02,$0e,$11,$04,$1a,$1d,$1d 862 27000 - 863 27000 -player1label 864 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$22,$1d,$12,$02,$0e,$11,$04,$1a 865 27000 - 866 27000 -player2label 867 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$23,$1d,$12,$02,$0e,$11,$04,$1a 868 27000 - endif ; HSCHARSHERE 869 27000 - 870 27000 - 871 27000 - ifconst HSGAMENAMELEN 872 27000 - ifconst HSCHARSHERE 873 27000 -HSGAMENAMEtable 874 27000 - include "7800hsgamename.asm" 875 27000 - endif ; HSCHARSHERE 876 27000 - endif ; HSGAMENAMELEN 877 27000 - ifconst HSGAMERANKS 878 27000 - include "7800hsgameranks.asm" 879 27000 - ifconst HSCHARSHERE 880 27000 -highscoreranklabel 881 27000 - .byte $11,$00,$0d,$0a,$1a 882 27000 - endif ; HSCHARSHERE 883 27000 - endif ; HSGAMERANKS 884 27000 - 885 27000 - ;ensure our table doesn't wrap a page... 886 27000 - if ((<*)>251) 887 27000 - align 256 888 27000 - endif 889 27000 -hsgameslotnumbers 890 27000 - .byte 33,34,35,36,37 891 27000 - endif ; hiscorefont 892 27000 - 893 27000 - 894 27000 - ifnconst isBANKSETBANK 895 27000 -loaddifficultytable 896 27000 - lda gamedifficulty 897 27000 - and #$03 ; ensure the user hasn't selected an invalid difficulty 898 27000 - sta gamedifficulty 899 27000 - cmp hsdifficulty ; check game difficulty is the same as RAM table 900 27000 - bne loaddifficultytablecontinue1 901 27000 - rts ; this high score difficulty table is already loaded 902 27000 -loaddifficultytablecontinue1 903 27000 - lda gamedifficulty 904 27000 - sta hsdifficulty 905 27000 - ;we need to check the device for the table 906 27000 - lda hsdevice 907 27000 - bne loaddifficultytablecontinue2 908 27000 - ; there's no save device. clear out this table. 909 27000 - jmp cleardifficultytablemem 910 27000 -loaddifficultytablecontinue2 911 27000 - lda hsdevice 912 27000 - and #1 913 27000 - beq memdeviceisntHSC 914 27000 - jmp loaddifficultytableHSC 915 27000 -memdeviceisntHSC 916 27000 - jmp loaddifficultytableAVOX 917 27000 - 918 27000 -savedifficultytable 919 27000 - ;*** we need to check which device we should use... 920 27000 - lda hsdevice 921 27000 - bne savedifficultytablerealdevice 922 27000 - rts ; its a ram device 923 27000 -savedifficultytablerealdevice 924 27000 - and #1 925 27000 - beq savememdeviceisntHSC 926 27000 - jmp savedifficultytableHSC 927 27000 -savememdeviceisntHSC 928 27000 - jmp savedifficultytableAVOX 929 27000 - 930 27000 -savedifficultytableAVOX 931 27000 - ; the load call already setup the memory structure and atarivox memory location 932 27000 - jsr savealoadedHSCtablecontinue 933 27000 -savedifficultytableAVOXskipconvert 934 27000 - lda #HSIDHI 935 27000 - sta eeprombuffer 936 27000 - lda #HSIDLO 937 27000 - sta eeprombuffer+1 938 27000 - lda hsdifficulty 939 27000 - sta eeprombuffer+2 940 27000 - lda #32 941 27000 - jsr AVoxWriteBytes 942 27000 - rts 943 27000 - 944 27000 -savedifficultytableHSC 945 27000 - ;we always load a table before reaching here, so the 946 27000 - ;memory structures from the load should be intact... 947 27000 - ldy hsgameslot 948 27000 - bpl savealoadedHSCtable 949 27000 - rts 950 27000 -savealoadedHSCtable 951 27000 - lda HSCGameDifficulty,y 952 27000 - cmp #$7F 953 27000 - bne savealoadedHSCtablecontinue 954 27000 - jsr initializeHSCtableentry 955 27000 -savealoadedHSCtablecontinue 956 27000 - ;convert our RAM table to HSC format and write it out... 957 27000 - ldy #0 958 27000 - ldx #0 959 27000 -savedifficultytableScores 960 27000 - 961 27000 - lda HSRAMInitials,x 962 27000 - sta temp3 963 27000 - lda HSRAMInitials+1,x 964 27000 - sta temp4 965 27000 - lda HSRAMInitials+2,x 966 27000 - sta temp5 967 27000 - jsr encodeHSCInitials ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 968 27000 - 969 27000 - lda temp1 970 27000 - sta (HSGameTableLo),y 971 27000 - iny 972 27000 - lda temp2 973 27000 - sta (HSGameTableLo),y 974 27000 - iny 975 27000 - 976 27000 - lda HSRAMScores,x 977 27000 - sta (HSGameTableLo),y 978 27000 - iny 979 27000 - lda HSRAMScores+1,x 980 27000 - sta (HSGameTableLo),y 981 27000 - iny 982 27000 - lda HSRAMScores+2,x 983 27000 - sta (HSGameTableLo),y 984 27000 - iny 985 27000 - inx 986 27000 - inx 987 27000 - inx ; +3 988 27000 - cpx #15 989 27000 - bne savedifficultytableScores 990 27000 - rts 991 27000 - 992 27000 -loaddifficultytableHSC 993 27000 - ; routine responsible for loading the difficulty table from HSC 994 27000 - jsr findindexHSC 995 27000 - ldy hsgameslot 996 27000 - lda HSCGameDifficulty,y 997 27000 - cmp #$7F 998 27000 - bne loaddifficultytableHSCcontinue 999 27000 - ;there was an error. use a new RAM table instead... 1000 27000 - jsr initializeHSCtableentry 1001 27000 - jmp cleardifficultytablemem 1002 27000 -loaddifficultytableHSCcontinue 1003 27000 - ; parse the data into the HS memory... 1004 27000 - ldy #0 1005 27000 - ldx #0 1006 27000 -loaddifficultytableScores 1007 27000 - lda (HSGameTableLo),y 1008 27000 - sta temp1 1009 27000 - iny 1010 27000 - lda (HSGameTableLo),y 1011 27000 - sta temp2 1012 27000 - jsr decodeHSCInitials ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 1013 27000 - iny 1014 27000 - lda (HSGameTableLo),y 1015 27000 - sta HSRAMScores,x 1016 27000 - lda temp3 1017 27000 - sta HSRAMInitials,x 1018 27000 - inx 1019 27000 - iny 1020 27000 - lda (HSGameTableLo),y 1021 27000 - sta HSRAMScores,x 1022 27000 - lda temp4 1023 27000 - sta HSRAMInitials,x 1024 27000 - inx 1025 27000 - iny 1026 27000 - lda (HSGameTableLo),y 1027 27000 - sta HSRAMScores,x 1028 27000 - lda temp5 1029 27000 - sta HSRAMInitials,x 1030 27000 - inx 1031 27000 - iny 1032 27000 - cpx #15 1033 27000 - bne loaddifficultytableScores 1034 27000 - rts 1035 27000 - 1036 27000 -decodeHSCInitials 1037 27000 - ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 1038 27000 - ; 2 bytes are packed in the form: 22211111 22_33333 1039 27000 - lda #0 1040 27000 - sta temp4 1041 27000 - lda temp1 1042 27000 - and #%00011111 1043 27000 - sta temp3 1044 27000 - 1045 27000 - lda temp2 1046 27000 - and #%00011111 1047 27000 - sta temp5 1048 27000 - 1049 27000 - lda temp1 1050 27000 - asl 1051 27000 - rol temp4 1052 27000 - asl 1053 27000 - rol temp4 1054 27000 - asl 1055 27000 - rol temp4 1056 27000 - lda temp2 1057 27000 - asl 1058 27000 - rol temp4 1059 27000 - asl 1060 27000 - rol temp4 1061 27000 - rts 1062 27000 -encodeHSCInitials 1063 27000 - ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 1064 27000 - ; 2 bytes are packed in the form: 22211111 22_33333 1065 27000 - ; start with packing temp1... 1066 27000 - lda temp4 1067 27000 - and #%00011100 1068 27000 - sta temp1 1069 27000 - asl temp1 1070 27000 - asl temp1 1071 27000 - asl temp1 1072 27000 - lda temp3 1073 27000 - and #%00011111 1074 27000 - ora temp1 1075 27000 - sta temp1 1076 27000 - ; ...temp1 is now packed, on to temp2... 1077 27000 - lda temp5 1078 27000 - asl 1079 27000 - asl 1080 27000 - ror temp4 1081 27000 - ror 1082 27000 - ror temp4 1083 27000 - ror 1084 27000 - sta temp2 1085 27000 - rts 1086 27000 - 1087 27000 -findindexHSCerror 1088 27000 - ;the HSC is stuffed. return the bad slot flag 1089 27000 - ldy #$ff 1090 27000 - sty hsgameslot 1091 27000 - rts 1092 27000 - 1093 27000 -findindexHSC 1094 27000 -HSCGameID1 = $1029 1095 27000 -HSCGameID2 = $106E 1096 27000 -HSCGameDifficulty = $10B3 1097 27000 -HSCGameIndex = $10F8 1098 27000 - ; routine responsible for finding the game index from HSC 1099 27000 - ; call with x=0 to create a new table if none exist, call with x=$ff to avoid creating new tables 1100 27000 - ; the HS loading routine will use x=$ff, the HS saving routine will use x=0 1101 27000 - ldy #69 ; start +1 to account for the dey 1102 27000 -findindexHSCloop 1103 27000 - dey 1104 27000 - bmi findindexHSCerror 1105 27000 - lda HSCGameDifficulty,y 1106 27000 - cmp #$7F 1107 27000 - beq findourindexHSC 1108 27000 - cmp gamedifficulty 1109 27000 - bne findindexHSCloop 1110 27000 - lda HSCGameID1,y 1111 27000 - cmp #HSIDHI 1112 27000 - bne findindexHSCloop 1113 27000 - lda HSCGameID2,y 1114 27000 - cmp #HSIDLO 1115 27000 - bne findindexHSCloop 1116 27000 -findourindexHSC 1117 27000 - ; if we're here we found our index in the table 1118 27000 - ; or we found the first empty one 1119 27000 - sty hsgameslot 1120 27000 - jsr setupHSCGamepointer ; setup the pointer to the HS Table for this game... 1121 27000 - rts 1122 27000 - 1123 27000 - 1124 27000 -initializeHSCtableentry 1125 27000 - ldy hsgameslot 1126 27000 - ; we need to make a new entry... 1127 27000 - lda #HSIDHI 1128 27000 - sta HSCGameID1,y 1129 27000 - lda #HSIDLO 1130 27000 - sta HSCGameID2,y 1131 27000 - lda gamedifficulty 1132 27000 - sta HSCGameDifficulty,y 1133 27000 - ldx #0 1134 27000 -fixHSDGameDifficultylistLoop 1135 27000 - inx 1136 27000 - txa 1137 27000 - sta HSCGameIndex,y 1138 27000 - iny 1139 27000 - cpy #69 1140 27000 - bne fixHSDGameDifficultylistLoop 1141 27000 - rts 1142 27000 - 1143 27000 -setupHSCGamepointer 1144 27000 - ; this routines sets (HSGameTableLo) pointing to the game's HS table 1145 27000 - lda #$17 1146 27000 - sta HSGameTableHi 1147 27000 - lda #$FA 1148 27000 - sta HSGameTableLo 1149 27000 -setupHSCGamepointerLoop 1150 27000 - lda HSGameTableLo 1151 27000 - sec 1152 27000 - sbc #25 1153 27000 - sta HSGameTableLo 1154 27000 - lda HSGameTableHi 1155 27000 - sbc #0 1156 27000 - sta HSGameTableHi 1157 27000 - iny 1158 27000 - cpy #69 1159 27000 - bne setupHSCGamepointerLoop 1160 27000 - rts 1161 27000 - 1162 27000 -loaddifficultytableAVOX 1163 27000 - ; routine responsible for loading the difficulty table from Avox 1164 27000 - ; we reuse HSC routines to format data to/from our Avox RAM buffer... 1165 27000 - lda #>(eeprombuffer+3) 1166 27000 - sta HSGameTableHi 1167 27000 - lda #<(eeprombuffer+3) 1168 27000 - sta HSGameTableLo 1169 27000 - 1170 27000 - ; the start location in EEPROM, subtract 32... 1171 27000 - lda #$5F 1172 27000 - sta HSVoxHi 1173 27000 - lda #$E0 1174 27000 - sta HSVoxLo 1175 27000 - lda #0 1176 27000 - sta temp1 1177 27000 -loaddifficultytableAVOXloop 1178 27000 - inc temp1 1179 27000 - beq loaddifficultytableAVOXfull 1180 27000 - clc 1181 27000 - lda HSVoxLo 1182 27000 - adc #32 1183 27000 - sta HSVoxLo 1184 27000 - lda HSVoxHi 1185 27000 - adc #0 1186 27000 - sta HSVoxHi 1187 27000 - lda #3 1188 27000 - jsr AVoxReadBytes ; read in 3 bytes, ID1,ID2,Difficulty 1189 27000 - lda eeprombuffer 1190 27000 - cmp #$FF 1191 27000 - beq loaddifficultytableAVOXempty 1192 27000 - cmp #HSIDHI 1193 27000 - bne loaddifficultytableAVOXloop 1194 27000 - lda eeprombuffer+1 1195 27000 - cmp #HSIDLO 1196 27000 - bne loaddifficultytableAVOXloop 1197 27000 - lda eeprombuffer+2 1198 27000 - cmp gamedifficulty 1199 27000 - bne loaddifficultytableAVOXloop 1200 27000 -loaddifficultytableAVOXdone 1201 27000 - lda #32 1202 27000 - jsr AVoxReadBytes 1203 27000 - jsr loaddifficultytableHSCcontinue 1204 27000 - rts 1205 27000 -loaddifficultytableAVOXfull 1206 27000 - lda #0 1207 27000 - sta hsdevice ; looks like all 255 entries are taken... disable it. 1208 27000 -loaddifficultytableAVOXempty 1209 27000 - jmp cleardifficultytablemem 1210 27000 - rts 1211 27000 - 1212 27000 -cleardifficultytablemem 1213 27000 - ldy #29 1214 27000 - lda #0 1215 27000 -cleardifficultytablememloop 1216 27000 - sta HSRAMTable,y 1217 27000 - dey 1218 27000 - bpl cleardifficultytablememloop 1219 27000 - rts 1220 27000 -hiscoremoduleend 1221 27000 - 1222 27000 - ifconst DOUBLEWIDE 1223 27000 -plotvaluedw 1224 27000 -plotdigitcount = temp6 1225 27000 - lda #0 1226 27000 - tay 1227 27000 - ldx valbufend 1228 27000 - 1229 27000 - lda plotdigitcount 1230 27000 - and #1 1231 27000 - beq pvnibble2chardw 1232 27000 - lda #0 1233 27000 - sta VALBUFFER,x ; just in case we skip this digit 1234 27000 - beq pvnibble2char_skipnibbledw 1235 27000 - 1236 27000 -pvnibble2chardw 1237 27000 - ; high nibble... 1238 27000 - lda (temp7),y 1239 27000 - and #$f0 1240 27000 - lsr 1241 27000 - lsr 1242 27000 - lsr 1243 27000 - lsr 1244 27000 - 1245 27000 - clc 1246 27000 - adc temp1 ; add the offset to character graphics to our value 1247 27000 - sta VALBUFFER,x 1248 27000 - inx 1249 27000 - dec plotdigitcount 1250 27000 -pvnibble2char_skipnibbledw 1251 27000 - ; low nibble... 1252 27000 - lda (temp7),y 1253 27000 - and #$0f 1254 27000 - clc 1255 27000 - adc temp1 ; add the offset to character graphics to our value 1256 27000 - sta VALBUFFER,x 1257 27000 - inx 1258 27000 - iny 1259 27000 - 1260 27000 - dec plotdigitcount 1261 27000 - bne pvnibble2chardw 1262 27000 - ;point to the start of our valuebuffer 1263 27000 - clc 1264 27000 - lda #VALBUFFER 1268 27000 - adc #0 1269 27000 - sta temp2 1270 27000 - 1271 27000 - ;advance valbufend to the end of our value buffer 1272 27000 - stx valbufend 1273 27000 - 1274 27000 - ifnconst plotvalueonscreen 1275 27000 - jmp plotcharacters 1276 27000 - else 1277 27000 - jmp plotcharacterslive 1278 27000 - endif 1279 27000 - endif ; DOUBLEWIDE 1280 27000 - 1281 27000 -hiscoreend 1282 27000 - echo " (hiscore module is using ",[(hiscoreend-hiscorestart)]d," bytes)" 1283 27000 - endif ; !isBANKSETBANK 1284 27000 endif ; HSSUPPORT 1285 27000 ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Menu_Demo_v2.78b.asm 4856 27000 endif 4857 27000 ifnconst included.fourbitfade.asm ------- FILE fourbitfade.asm LEVEL 2 PASS 3 0 27000 include fourbitfade.asm 1 27000 ; ** fourbit fade, which is useful for audio levels and brightness fades 2 27000 ; ** input: A=value to fade, fourbitfadevalue=global fade value 3 27000 ; ** N.B. the global fade value is in the upper nibble. i.e. $Fx-0x 4 27000 ; ** output: A=faded value in lo nibble. orig top nibble is preserved, 5 27000 ; ** other registers are preserved 6 27000 7 27000 - ifconst FOURBITFADE 8 27000 - 9 27000 - ; non-interrupt routine 10 27000 - 11 27000 -fourbitfade 12 27000 - sty fourbittemp1 13 27000 - pha 14 27000 - and #$0F 15 27000 - ora fourbitfadevalue 16 27000 - tay 17 27000 - pla 18 27000 - and #$F0 19 27000 - ora fourbitfadelut,y 20 27000 - ldy fourbittemp1 ; restore Y 21 27000 - rts 22 27000 - 23 27000 - ; interrupt routine 24 27000 - 25 27000 -fourbitfadeint 26 27000 - sty fourbittemp1int 27 27000 - pha 28 27000 - and #$0F 29 27000 - ora fourbitfadevalueint 30 27000 - tay 31 27000 - pla 32 27000 - and #$F0 33 27000 - ora fourbitfadelut,y 34 27000 - ldy fourbittemp1int ; restore Y 35 27000 - rts 36 27000 - 37 27000 -fourbitfadelut 38 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 39 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01 40 27000 - .byte $00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$02,$02,$02,$02,$02 41 27000 - .byte $00,$00,$00,$00,$01,$01,$01,$01,$02,$02,$02,$02,$03,$03,$03,$03 42 27000 - .byte $00,$00,$00,$00,$01,$01,$01,$02,$02,$02,$03,$03,$03,$04,$04,$04 43 27000 - .byte $00,$00,$00,$01,$01,$01,$02,$02,$03,$03,$03,$04,$04,$04,$05,$05 44 27000 - .byte $00,$00,$00,$01,$01,$02,$02,$03,$03,$03,$04,$04,$05,$05,$06,$06 45 27000 - .byte $00,$00,$01,$01,$02,$02,$03,$03,$04,$04,$05,$05,$06,$06,$07,$07 46 27000 - .byte $00,$00,$01,$01,$02,$02,$03,$03,$04,$05,$05,$06,$06,$07,$07,$08 47 27000 - .byte $00,$00,$01,$01,$02,$03,$03,$04,$05,$05,$06,$06,$07,$08,$08,$09 48 27000 - .byte $00,$00,$01,$02,$02,$03,$04,$04,$05,$06,$06,$07,$08,$08,$09,$0a 49 27000 - .byte $00,$00,$01,$02,$03,$03,$04,$05,$06,$06,$07,$08,$09,$09,$0a,$0b 50 27000 - .byte $00,$00,$01,$02,$03,$04,$04,$05,$06,$07,$08,$08,$09,$0a,$0b,$0c 51 27000 - .byte $00,$00,$01,$02,$03,$04,$05,$06,$07,$07,$08,$09,$0a,$0b,$0c,$0d 52 27000 - .byte $00,$00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d,$0e 53 27000 - .byte $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d,$0e,$0f 54 27000 - 55 27000 -fourbitfadeend 56 27000 - 57 27000 - echo " (fourbitfade module is using ",[(fourbitfadeend-fourbitfade)]d," bytes)" 58 27000 - 59 27000 endif ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Menu_Demo_v2.78b.asm 4859 27000 endif 4860 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 4861 27000 4862 27000 ;standard routimes needed for pretty much all games 4863 27000 4864 27000 ; some definitions used with "set debug color" 4865 27000 00 91 DEBUGCALC = $91 4866 27000 00 41 DEBUGWASTE = $41 4867 27000 00 c1 DEBUGDRAW = $C1 4868 27000 4869 27000 ;NMI and IRQ handlers 4870 27000 NMI 4871 27000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 4872 27000 48 pha ; save A 4873 27001 d8 cld 4874 27002 a5 4d lda visibleover 4875 27004 49 ff eor #255 4876 27006 85 4d sta visibleover 4877 27008 - ifconst DEBUGINTERRUPT 4878 27008 - and #$93 4879 27008 - sta BACKGRND 4880 27008 endif 4881 27008 8a txa ; save X 4882 27009 48 pha 4883 2700a 98 tya ; save Y 4884 2700b 48 pha 4885 2700c ce b2 01 dec interruptindex 4886 2700f d0 03 bne skipreallyoffvisible 4887 27011 4c 6b f0 jmp reallyoffvisible 4888 27014 skipreallyoffvisible 4889 27014 a5 4d lda visibleover 4890 27016 d0 03 bne carryontopscreenroutine 4891 27018 - ifconst .bottomscreenroutine 4892 27018 - lda interrupthold 4893 27018 - beq skipbottomroutine 4894 27018 - jsr .bottomscreenroutine 4895 27018 -skipbottomroutine 4896 27018 endif 4897 27018 4c 79 f0 jmp NMIexit 4898 2701b carryontopscreenroutine 4899 2701b - ifconst .topscreenroutine 4900 2701b - lda interrupthold 4901 2701b - beq skiptoproutine 4902 2701b - jsr .topscreenroutine 4903 2701b -skiptoproutine 4904 2701b endif 4905 2701b ifnconst CANARYOFF 4906 2701b ad c1 01 lda canary 4907 2701e f0 07 beq skipcanarytriggered 4908 27020 a9 45 lda #$45 4909 27022 85 20 sta BACKGRND 4910 27024 4c 63 f0 jmp skipbrkolorset ; common crash dump routine, if available 4911 27027 skipcanarytriggered 4912 27027 endif 4913 27027 4914 27027 ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 4915 2702a 4916 2702a ; ** Other important routines that need to regularly run, and can run onscreen. 4917 2702a ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 4918 2702a 4919 2702a - ifconst LONGCONTROLLERREAD 4920 2702a -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 4921 2702a - ldy port1control 4922 2702a - lda longreadtype,y 4923 2702a - beq LLRET1 4924 2702a - tay 4925 2702a - lda longreadroutinehiP1,y 4926 2702a - sta inttemp4 4927 2702a - lda longreadroutineloP1,y 4928 2702a - sta inttemp3 4929 2702a - jmp (inttemp3) 4930 2702a -LLRET1 4931 2702a - ldy port0control 4932 2702a - lda longreadtype,y 4933 2702a - beq LLRET0 4934 2702a - tay 4935 2702a - lda longreadroutinehiP0,y 4936 2702a - sta inttemp4 4937 2702a - lda longreadroutineloP0,y 4938 2702a - sta inttemp3 4939 2702a - jmp (inttemp3) 4940 2702a -LLRET0 4941 2702a - 4942 2702a - 4943 2702a - ifconst PADDLERANGE 4944 2702a -TIMEVAL = PADDLERANGE 4945 2702a - else 4946 2702a -TIMEVAL = 160 4947 2702a - endif 4948 2702a -TIMEOFFSET = 10 4949 2702a - 4950 2702a endif ; LONGCONTROLLERREAD 4951 2702a 4952 2702a 4953 2702a 20 e7 f1 jsr servicesfxchannels 4954 2702d - ifconst MUSICTRACKER 4955 2702d - jsr servicesong 4956 2702d endif ; MUSICTRACKER 4957 2702d - ifconst RMT 4958 2702d - lda rasterpause 4959 2702d - beq skiprasterupdate 4960 2702d - jsr RASTERMUSICTRACKER+3 4961 2702d -skiprasterupdate 4962 2702d -RMT_Iend 4963 2702d endif 4964 2702d 4965 2702d ee a4 01 inc framecounter 4966 27030 ad a4 01 lda framecounter 4967 27033 29 3f and #63 4968 27035 d0 08 bne skipcountdownseconds 4969 27037 ad a5 01 lda countdownseconds 4970 2703a f0 03 beq skipcountdownseconds 4971 2703c ce a5 01 dec countdownseconds 4972 2703f skipcountdownseconds 4973 2703f 4974 2703f a2 01 ldx #1 4975 27041 buttonreadloop 4976 27041 8a txa 4977 27042 48 pha 4978 27043 bc b7 01 ldy port0control,x 4979 27046 b9 c4 f1 lda buttonhandlerlo,y 4980 27049 85 da sta inttemp3 4981 2704b b9 b8 f1 lda buttonhandlerhi,y 4982 2704e 85 db sta inttemp4 4983 27050 05 da ora inttemp3 4984 27052 f0 03 beq buttonreadloopreturn 4985 27054 6c da 00 jmp (inttemp3) 4986 27057 buttonreadloopreturn 4987 27057 68 pla 4988 27058 aa tax 4989 27059 ca dex 4990 2705a 10 e5 bpl buttonreadloop 4991 2705c 4992 2705c ;ifconst KEYPADSUPPORT 4993 2705c ; jsr keypadrowselect 4994 2705c ;endif ; KEYPADSUPPORT 4995 2705c 4996 2705c 4997 2705c - ifconst DOUBLEBUFFER 4998 2705c - lda doublebufferminimumframeindex 4999 2705c - beq skipdoublebufferminimumframeindexadjust 5000 2705c - dec doublebufferminimumframeindex 5001 2705c -skipdoublebufferminimumframeindexadjust 5002 2705c endif 5003 2705c 5004 2705c 4c 79 f0 jmp NMIexit 5005 2705f 5006 2705f IRQ ; the only source of non-nmi interrupt should be the BRK opcode. 5007 2705f ifnconst BREAKPROTECTOFF 5008 2705f a9 1a lda #$1A 5009 27061 85 20 sta BACKGRND 5010 27063 skipbrkolorset 5011 27063 skipbrkdetected 5012 27063 a9 60 lda #$60 5013 27065 8d 07 21 sta sCTRL 5014 27068 85 3c sta CTRL 5015 2706a ifnconst hiscorefont 5016 2706a 02 .byte.b $02 ; KIL/JAM 5017 2706b - else ; hiscorefont is present 5018 2706b - ifconst CRASHDUMP 5019 2706b - bit MSTAT 5020 2706b - bpl skipbrkdetected ; wait for vblank to ensure we're clear of NMI 5021 2706b - 5022 2706b - ifconst dumpbankswitch 5023 2706b - lda dumpbankswitch 5024 2706b - pha 5025 2706b - endif 5026 2706b - 5027 2706b - ; bankswitch if needed, to get to the hiscore font 5028 2706b - ifconst bankswitchmode 5029 2706b - ifconst included.hiscore.asm.bank 5030 2706b - ifconst MCPDEVCART 5031 2706b - lda #($18 | included.hiscore.asm.bank) 5032 2706b - sta $3000 5033 2706b - else 5034 2706b - lda #(included.hiscore.asm.bank) 5035 2706b - sta $8000 5036 2706b - endif 5037 2706b - endif ; included.hiscore.asm.bank 5038 2706b - endif ; bankswitchmode 5039 2706b - 5040 2706b - ifconst DOUBLEBUFFER 5041 2706b - ;turn off double-buffering, if on... 5042 2706b - lda #>DLLMEM 5043 2706b - sta DPPH 5044 2706b - lda #hiscorefont 5088 2706b - sta CHARBASE 5089 2706b - sta sCHARBASE 5090 2706b - lda #%01000011 ;Enable DMA, mode=320A 5091 2706b - sta CTRL 5092 2706b - sta sCTRL 5093 2706b - .byte $02 ; KIL/JAM 5094 2706b -hiscorehexlut 5095 2706b - ; 0 1 2 3 4 5 6 7 8 9 A B C D E F 5096 2706b - .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 5097 2706b -show2700 5098 2706b - ; lo mode hi width=29 x EODL 5099 2706b - .byte $00, %01100000, $27, 3, 20, 0,0,0 5100 2706b - else ; CRASHDUMP 5101 2706b - .byte $02 ; KIL/JAM 5102 2706b - endif ; crashdump 5103 2706b endif ; hiscorefont 5104 2706b - else 5105 2706b - RTI 5106 2706b endif 5107 2706b 5108 2706b - ifconst LONGCONTROLLERREAD 5109 2706b - 5110 2706b -longreadtype 5111 2706b - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 5112 2706b - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 5113 2706b - .byte 3, 3, 0, 0 ; STMOUSE AMOUSE ATARIVOX SNES 5114 2706b - 5115 2706b -longreadroutineloP0 5116 2706b - .byte LLRET0 ; 0 = no routine 5123 2706b - .byte >paddleport0update ; 1 = paddle 5124 2706b - .byte >trakball0update ; 2 = trackball 5125 2706b - .byte >mouse0update ; 3 = mouse 5126 2706b - 5127 2706b -longreadroutineloP1 5128 2706b - .byte LLRET1 ; 0 = no routine 5135 2706b - .byte >paddleport1update ; 1 = paddle 5136 2706b - .byte >trakball1update ; 2 = trackball 5137 2706b - .byte >mouse1update ; 3 = mouse 5138 2706b - 5139 2706b - 5140 2706b -SETTIM64T 5141 2706b - bne skipdefaulttime 5142 2706b - ifnconst PADDLESMOOTHINGOFF 5143 2706b - lda #(TIMEVAL+TIMEOFFSET+1) 5144 2706b - else 5145 2706b - lda #(TIMEVAL+TIMEOFFSET) 5146 2706b - endif 5147 2706b -skipdefaulttime 5148 2706b - tay 5149 2706b - dey 5150 2706b -.setTIM64Tloop 5151 2706b - sta TIM64T 5152 2706b - cpy INTIM 5153 2706b - bne .setTIM64Tloop 5154 2706b - rts 5155 2706b endif ; LONGCONTROLLERREAD 5156 2706b 5157 2706b reallyoffvisible 5158 2706b 85 24 sta WSYNC 5159 2706d 5160 2706d a9 00 lda #0 5161 2706f 85 4d sta visibleover 5162 27071 - ifconst DEBUGINTERRUPT 5163 27071 - sta BACKGRND 5164 27071 endif 5165 27071 5166 27071 a9 03 lda #3 5167 27073 8d b2 01 sta interruptindex 5168 27076 5169 27076 20 59 f1 jsr uninterruptableroutines 5170 27079 5171 27079 - ifconst .userinterrupt 5172 27079 - lda interrupthold 5173 27079 - beq skipuserintroutine 5174 27079 - jsr .userinterrupt 5175 27079 -skipuserintroutine 5176 27079 endif 5177 27079 5178 27079 - ifconst KEYPADSUPPORT 5179 27079 - jsr keypadcolumnread 5180 27079 - jsr keypadrowselect 5181 27079 endif 5182 27079 5183 27079 NMIexit 5184 27079 68 pla 5185 2707a a8 tay 5186 2707b 68 pla 5187 2707c aa tax 5188 2707d 68 pla 5189 2707e 40 RTI 5190 2707f 5191 2707f clearscreen 5192 2707f a2 0b ldx #(WZONECOUNT-1) 5193 27081 a9 00 lda #0 5194 27083 clearscreenloop 5195 27083 95 65 sta dlend,x 5196 27085 ca dex 5197 27086 10 fb bpl clearscreenloop 5198 27088 a9 00 lda #0 5199 2708a 8d ad 01 sta valbufend ; clear the bcd value buffer 5200 2708d 8d ae 01 sta valbufendsave 5201 27090 60 rts 5202 27091 5203 27091 restorescreen 5204 27091 a2 0b ldx #(WZONECOUNT-1) 5205 27093 a9 00 lda #0 5206 27095 restorescreenloop 5207 27095 b5 82 lda dlendsave,x 5208 27097 95 65 sta dlend,x 5209 27099 ca dex 5210 2709a 10 f9 bpl restorescreenloop 5211 2709c ad ae 01 lda valbufendsave 5212 2709f 8d ad 01 sta valbufend 5213 270a2 60 rts 5214 270a3 5215 270a3 savescreen 5216 270a3 a2 0b ldx #(WZONECOUNT-1) 5217 270a5 savescreenloop 5218 270a5 b5 65 lda dlend,x 5219 270a7 95 82 sta dlendsave,x 5220 270a9 ca dex 5221 270aa 10 f9 bpl savescreenloop 5222 270ac ad ad 01 lda valbufend 5223 270af 8d ae 01 sta valbufendsave 5224 270b2 - ifconst DOUBLEBUFFER 5225 270b2 - lda doublebufferstate 5226 270b2 - beq savescreenrts 5227 270b2 - lda #1 5228 270b2 - sta doublebufferbufferdirty 5229 270b2 -savescreenrts 5230 270b2 endif ; DOUBLEBUFFER 5231 270b2 60 rts 5232 270b3 5233 270b3 drawscreen 5234 270b3 5235 270b3 - ifconst interrupthold 5236 270b3 - lda #$FF 5237 270b3 - sta interrupthold ; if the user called drawscreen, we're ready for interrupts 5238 270b3 endif 5239 270b3 5240 270b3 a9 00 lda #0 5241 270b5 85 42 sta temp1 ; not B&W if we're here... 5242 270b7 5243 270b7 drawscreenwait 5244 270b7 a5 4d lda visibleover 5245 270b9 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 5246 270bb 5247 270bb ;restore some registers in case the game changed them mid-screen... 5248 270bb ad 07 21 lda sCTRL 5249 270be 05 42 ora temp1 5250 270c0 85 3c sta CTRL 5251 270c2 ad 0b 21 lda sCHARBASE 5252 270c5 85 34 sta CHARBASE 5253 270c7 5254 270c7 ;ensure all of the display list is terminated... 5255 270c7 20 3f f1 jsr terminatedisplaylist 5256 270ca 5257 270ca ifnconst pauseroutineoff 5258 270ca 20 d5 f0 jsr pauseroutine 5259 270cd endif ; pauseroutineoff 5260 270cd 5261 270cd ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 5262 270cd ; delaying a full frame, but still allowing time for basic calculations. 5263 270cd visiblescreenstartedwait 5264 270cd a5 4d lda visibleover 5265 270cf f0 fc beq visiblescreenstartedwait 5266 270d1 visiblescreenstartedwaitdone 5267 270d1 ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 5268 270d4 60 rts 5269 270d5 5270 270d5 ifnconst pauseroutineoff 5271 270d5 ; check to see if pause was pressed and released 5272 270d5 pauseroutine 5273 270d5 ad b3 01 lda pausedisable 5274 270d8 d0 55 bne leavepauseroutine 5275 270da a9 08 lda #8 5276 270dc 2c 82 02 bit SWCHB 5277 270df f0 30 beq pausepressed 5278 270e1 5279 270e1 ifnconst SOFTPAUSEOFF 5280 270e1 ifnconst SOFTRESETASPAUSEOFF 5281 270e1 ifnconst MOUSESUPPORT 5282 270e1 ifnconst TRAKBALLSUPPORT 5283 270e1 ad b7 01 lda port0control 5284 270e4 c9 0b cmp #11 5285 270e6 d0 07 bne skipsoftpause 5286 270e8 ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 5287 270eb 29 70 and #%01110000 ; _LDU 5288 270ed f0 22 beq pausepressed 5289 270ef skipsoftpause 5290 270ef endif 5291 270ef endif 5292 270ef endif 5293 270ef endif 5294 270ef - ifconst SNES0PAUSE 5295 270ef - lda port0control 5296 270ef - cmp #11 5297 270ef - bne skipsnes0pause 5298 270ef - lda snesdetected0 5299 270ef - beq skipsnes0pause 5300 270ef - lda snes2atari0hi 5301 270ef - and #%00010000 5302 270ef - beq pausepressed 5303 270ef -skipsnes0pause 5304 270ef endif 5305 270ef - ifconst SNES1PAUSE 5306 270ef - 5307 270ef - lda port1control 5308 270ef - cmp #11 5309 270ef - bne skipsnes1pause 5310 270ef - lda snesdetected1 5311 270ef - beq skipsnes1pause 5312 270ef - lda snes2atari1hi 5313 270ef - and #%00010000 5314 270ef - beq pausepressed 5315 270ef -skipsnes1pause 5316 270ef endif 5317 270ef - ifconst SNESNPAUSE 5318 270ef - ldx snesport 5319 270ef - lda port0control,x 5320 270ef - cmp #11 5321 270ef - bne skipsnesNpause 5322 270ef - lda snesdetected0,x 5323 270ef - beq skipsnesNpause 5324 270ef - lda snes2atari0hi,x 5325 270ef - and #%00010000 5326 270ef - beq pausepressed 5327 270ef -skipsnesNpause 5328 270ef endif 5329 270ef 5330 270ef ;pause isn't pressed 5331 270ef a9 00 lda #0 5332 270f1 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 5333 270f4 5334 270f4 ;check if we're in an already paused state 5335 270f4 ad 00 21 lda pausestate 5336 270f7 f0 36 beq leavepauseroutine ; nope, leave 5337 270f9 5338 270f9 c9 01 cmp #1 ; last frame was the start of pausing 5339 270fb f0 2b beq enterpausestate2 ; move from state 1 to 2 5340 270fd 5341 270fd c9 02 cmp #2 5342 270ff f0 34 beq carryonpausing 5343 27101 5344 27101 ;pausestate must be >2, which means we're ending an unpause 5345 27101 a9 00 lda #0 5346 27103 8d ac 01 sta pausebuttonflag 5347 27106 8d 00 21 sta pausestate 5348 27109 ad 07 21 lda sCTRL 5349 2710c 85 3c sta CTRL 5350 2710e 4c 2f f1 jmp leavepauseroutine 5351 27111 5352 27111 pausepressed 5353 27111 ;pause is pressed 5354 27111 ad ac 01 lda pausebuttonflag 5355 27114 c9 ff cmp #$ff 5356 27116 f0 1d beq carryonpausing 5357 27118 5358 27118 ;its a new press, increment the state 5359 27118 ee 00 21 inc pausestate 5360 2711b 5361 2711b ;silence volume at the start and end of pausing 5362 2711b a9 00 lda #0 5363 2711d 85 19 sta AUDV0 5364 2711f 85 1a sta AUDV1 5365 27121 5366 27121 - ifconst pokeysupport 5367 27121 - ldy #7 5368 27121 -pausesilencepokeyaudioloop 5369 27121 - sta (pokeybase),y 5370 27121 - dey 5371 27121 - bpl pausesilencepokeyaudioloop 5372 27121 endif ; pokeysupport 5373 27121 5374 27121 a9 ff lda #$ff 5375 27123 8d ac 01 sta pausebuttonflag 5376 27126 d0 0d bne carryonpausing 5377 27128 5378 27128 enterpausestate2 5379 27128 a9 02 lda #2 5380 2712a 8d 00 21 sta pausestate 5381 2712d d0 06 bne carryonpausing 5382 2712f leavepauseroutine 5383 2712f ad 07 21 lda sCTRL 5384 27132 85 3c sta CTRL 5385 27134 60 rts 5386 27135 carryonpausing 5387 27135 - ifconst .pause 5388 27135 - jsr .pause 5389 27135 endif ; .pause 5390 27135 ad 07 21 lda sCTRL 5391 27138 09 80 ora #%10000000 ; turn off colorburst during pause... 5392 2713a 85 3c sta CTRL 5393 2713c 4c d5 f0 jmp pauseroutine 5394 2713f endif ; pauseroutineoff 5395 2713f 5396 2713f 5397 2713f - ifconst DOUBLEBUFFER 5398 2713f -skipterminatedisplaylistreturn 5399 2713f - rts 5400 2713f endif ; DOUBLEBUFFER 5401 2713f terminatedisplaylist 5402 2713f - ifconst DOUBLEBUFFER 5403 2713f - lda doublebufferstate 5404 2713f - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 5405 2713f endif ; DOUBLEBUFFER 5406 2713f terminatedisplaybuffer 5407 2713f ;add DL end entry on each DL 5408 2713f a2 0b ldx #(WZONECOUNT-1) 5409 27141 dlendloop 5410 27141 bd cf f5 lda DLPOINTL,x 5411 27144 - ifconst DOUBLEBUFFER 5412 27144 - clc 5413 27144 - adc doublebufferdloffset 5414 27144 endif ; DOUBLEBUFFER 5415 27144 85 63 sta dlpnt 5416 27146 bd c3 f5 lda DLPOINTH,x 5417 27149 - ifconst DOUBLEBUFFER 5418 27149 - adc #0 5419 27149 endif ; DOUBLEBUFFER 5420 27149 85 64 sta dlpnt+1 5421 2714b b4 65 ldy dlend,x 5422 2714d a9 00 lda #$00 5423 2714f dlendmoreloops 5424 2714f c8 iny 5425 27150 91 63 sta (dlpnt),y 5426 27152 - ifconst FRAMESKIPGLITCHFIXWEAK 5427 27152 - cpy #DLLASTOBJ+1 5428 27152 - beq dlendthiszonedone 5429 27152 - iny 5430 27152 - iny 5431 27152 - iny 5432 27152 - iny 5433 27152 - iny 5434 27152 - sta (dlpnt),y 5435 27152 -dlendthiszonedone 5436 27152 endif FRAMESKIPGLITCHFIXWEAK 5437 27152 - ifconst FRAMESKIPGLITCHFIX 5438 27152 - iny 5439 27152 - iny 5440 27152 - iny 5441 27152 - iny 5442 27152 - cpy #DLLASTOBJ-1 5443 27152 - bcc dlendmoreloops 5444 27152 endif ; FRAMESKIPGLITCHFIX 5445 27152 ca dex 5446 27153 10 ec bpl dlendloop 5447 27155 5448 27155 ifnconst pauseroutineoff 5449 27155 20 d5 f0 jsr pauseroutine 5450 27158 endif ; pauseroutineoff 5451 27158 60 rts 5452 27159 5453 27159 uninterruptableroutines 5454 27159 ; this is for routines that must happen off the visible screen, each frame. 5455 27159 5456 27159 - ifconst AVOXVOICE 5457 27159 - jsr serviceatarivoxqueue 5458 27159 endif 5459 27159 5460 27159 a9 00 lda #0 5461 2715b 8d b6 01 sta palfastframe 5462 2715e ad 09 21 lda paldetected 5463 27161 f0 10 beq skippalframeadjusting 5464 27163 ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 5465 27163 ae b5 01 ldx palframes 5466 27166 e8 inx 5467 27167 e0 05 cpx #5 5468 27169 d0 05 bne palframeskipdone 5469 2716b ee b6 01 inc palfastframe 5470 2716e a2 00 ldx #0 5471 27170 palframeskipdone 5472 27170 8e b5 01 stx palframes 5473 27173 skippalframeadjusting 5474 27173 5475 27173 - ifconst MUSICTRACKER 5476 27173 - ; We normally run the servicesong routine from the top-screen interrupt, but if it 5477 27173 - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 5478 27173 - ; If that happens, we try again here. Chances are very small we'll run into the same 5479 27173 - ; problem twice, and if we do, we just drop a musical note or two. 5480 27173 - lda sfxschedulemissed 5481 27173 - beq servicesongwasnotmissed 5482 27173 - jsr servicesong 5483 27173 -servicesongwasnotmissed 5484 27173 endif ; MUSICTRACKER 5485 27173 5486 27173 - ifconst RMT 5487 27173 - lda palfastframe 5488 27173 - beq skiprasterupdate2 5489 27173 - lda rasterpause 5490 27173 - beq skiprasterupdate2 5491 27173 - jsr RASTERMUSICTRACKER+3 5492 27173 -skiprasterupdate2 5493 27173 endif 5494 27173 5495 27173 5496 27173 60 rts 5497 27174 5498 27174 serviceatarivoxqueue 5499 27174 - ifconst AVOXVOICE 5500 27174 - lda voxlock 5501 27174 - bne skipvoxprocessing ; the vox is in the middle of speech address update 5502 27174 -skipvoxqueuesizedec 5503 27174 - jmp processavoxvoice 5504 27174 -skipvoxprocessing 5505 27174 - rts 5506 27174 - 5507 27174 -processavoxvoice 5508 27174 - lda avoxenable 5509 27174 - bne avoxfixport 5510 27174 - SPKOUT tempavox 5511 27174 - rts 5512 27174 -avoxfixport 5513 27174 - lda #0 ; restore the port to all bits as inputs... 5514 27174 - sta CTLSWA 5515 27174 - rts 5516 27174 -silenceavoxvoice 5517 27174 - SPEAK avoxsilentdata 5518 27174 - rts 5519 27174 -avoxsilentdata 5520 27174 - .byte 31,255 5521 27174 else 5522 27174 60 rts 5523 27175 endif ; AVOXVOICE 5524 27175 5525 27175 joybuttonhandler 5526 27175 8a txa 5527 27176 0a asl 5528 27177 a8 tay 5529 27178 b9 08 00 lda INPT0,y 5530 2717b 4a lsr 5531 2717c 9d 02 21 sta sINPT1,x 5532 2717f b9 09 00 lda INPT1,y 5533 27182 29 80 and #%10000000 5534 27184 1d 02 21 ora sINPT1,x 5535 27187 9d 02 21 sta sINPT1,x 5536 2718a 5537 2718a b5 0c lda INPT4,x 5538 2718c 30 19 bmi .skip1bjoyfirecheck 5539 2718e ;one button joystick is down 5540 2718e 49 80 eor #%10000000 5541 27190 9d 02 21 sta sINPT1,x 5542 27193 5543 27193 ad b1 01 lda joybuttonmode 5544 27196 3d aa f1 and twobuttonmask,x 5545 27199 f0 0c beq .skip1bjoyfirecheck 5546 2719b ad b1 01 lda joybuttonmode 5547 2719e 1d aa f1 ora twobuttonmask,x 5548 271a1 8d b1 01 sta joybuttonmode 5549 271a4 8d 82 02 sta SWCHB 5550 271a7 .skip1bjoyfirecheck 5551 271a7 4c 57 f0 jmp buttonreadloopreturn 5552 271aa 5553 271aa twobuttonmask 5554 271aa 04 10 .byte.b %00000100,%00010000 5555 271ac 5556 271ac - ifconst SNES2ATARISUPPORT 5557 271ac - 5558 271ac -SNES_CLOCK_PORT_BIT 5559 271ac - .byte $10,$01 5560 271ac -SNES_CTLSWA_MASK 5561 271ac - .byte $30,$03 5562 271ac -SNES_CTLSWA_SIGNAL 5563 271ac - .byte $C0,$0C 5564 271ac -SWCHA_DIRMASK 5565 271ac - .byte $F0,$0F 5566 271ac -SWCHA_INVDIRMASK 5567 271ac - .byte $0F,$F0 5568 271ac - 5569 271ac - ; Probe each port for SNES, and see if autodetection succeeds anywhere. 5570 271ac -SNES_AUTODETECT 5571 271ac - ldx #1 5572 271ac -SNES_AUTODETECT_LOOP 5573 271ac - lda #1 ; proline 5574 271ac - sta port0control,x 5575 271ac - jsr setportforinput 5576 271ac - jsr setonebuttonmode 5577 271ac - jsr SNES_READ 5578 271ac - lda snesdetected0,x 5579 271ac - bne SNES_AUTODETECT_FOUND 5580 271ac - ; detection failed 5581 271ac - jsr setportforinput 5582 271ac - jsr settwobuttonmode 5583 271ac - dex 5584 271ac - bpl SNES_AUTODETECT_LOOP 5585 271ac - rts 5586 271ac -SNES_AUTODETECT_FOUND 5587 271ac - lda #11 ; formally set the snes controller 5588 271ac - sta port0control,x 5589 271ac - stx snesport 5590 271ac - rts 5591 271ac endif ; SNES2ATARISUPPORT 5592 271ac 5593 271ac snes2atarihandler 5594 271ac - ifconst SNES2ATARISUPPORT 5595 271ac -SNES2ATARI 5596 271ac - jsr SNES_READ 5597 271ac - jmp buttonreadloopreturn 5598 271ac - 5599 271ac -SNES_READ 5600 271ac - ; x=0 for left port, x=1 for right 5601 271ac - 5602 271ac - ; Start by checking if any port directions are pressed. 5603 271ac - ; Abort the autodetect for this port if so, as snes2atari doesn't ground any 5604 271ac - ; direction pins. if directions are pressed and the port is changed to output, 5605 271ac - ; that means the output is direct-shorted, and nobody seems to know if riot's 5606 271ac - ; output mode has current protection. 5607 271ac - 5608 271ac - lda SWCHA 5609 271ac - ora SWCHA_INVDIRMASK,x 5610 271ac - eor SWCHA_DIRMASK,x 5611 271ac - beq SNES_ABORT 5612 271ac - 5613 271ac - lda port0control,x 5614 271ac - cmp #11 ; snes 5615 271ac - bne snes2atari_signal_go ; if this is a first auto-detection read, go ahead and signal 5616 271ac - lda snesdetected0,x 5617 271ac - bne snes2atari_signal_skip ; if snes was available in previous frames, skip signalling 5618 271ac -snes2atari_signal_go 5619 271ac - jsr SNES2ATARI_SIGNAL 5620 271ac -snes2atari_signal_skip 5621 271ac - 5622 271ac - lda SNES_CTLSWA_MASK,x 5623 271ac - sta CTLSWA ; enable pins UP/DOWN to work as outputs 5624 271ac - sta SWCHA ; latch+clock high 5625 271ac - nop 5626 271ac - nop 5627 271ac - nop 5628 271ac - nop 5629 271ac - nop 5630 271ac - nop 5631 271ac - nop 5632 271ac - lda #$0 5633 271ac - sta SWCHA ; latch and clock low 5634 271ac - ldy #16 ; 16 bits 5635 271ac -SNES2ATARILOOP 5636 271ac - rol INPT4,x ; sample data into carry 5637 271ac - lda SNES_CLOCK_PORT_BIT,x 5638 271ac - sta SWCHA ; clock low 5639 271ac - rol snes2atari0lo,x 5640 271ac - rol snes2atari0hi,x 5641 271ac - lda #0 5642 271ac - sta SWCHA ; clock high 5643 271ac - dey ; next bit 5644 271ac - bne SNES2ATARILOOP 5645 271ac - rol INPT4,x ; 17th bit should be lo if controller is there. 5646 271ac - rol ; 17th snes bit into A low bit 5647 271ac - eor snes2atari0lo,x ; 16th bit should be hi if controller is there. 5648 271ac - and #1 5649 271ac - sta snesdetected0,x 5650 271ac - beq SNES_STOP_CLOCK ; if snes isn't detected, leave port in default state 5651 271ac - stx snesport ; snesport keeps the index of the latest autodetected controller 5652 271ac - lda SNES_CLOCK_PORT_BIT,x 5653 271ac -SNES_STOP_CLOCK 5654 271ac - sta SWCHA ; clock low 5655 271ac - sta CTLSWA ; set port bits to input avoid conflict with other drivers 5656 271ac - rts 5657 271ac -SNES_ABORT 5658 271ac - sta snesdetected0,x 5659 271ac - rts 5660 271ac -SNES2ATARI_SIGNAL 5661 271ac - ; signal to SNES2ATARI++ that we want SNES mode... 5662 271ac - lda SNES_CTLSWA_SIGNAL,x 5663 271ac - sta CTLSWA 5664 271ac - lda #0 5665 271ac - sta SWCHA 5666 271ac - ldy #0 5667 271ac -SNES_SIGNAL_LOOP 5668 271ac - dey 5669 271ac - bne SNES_SIGNAL_LOOP 5670 271ac - lda #$FF 5671 271ac - sta SWCHA 5672 271ac - rts 5673 271ac endif 5674 271ac 5675 271ac gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 5676 271ac - ifconst LIGHTGUNSUPPORT 5677 271ac - cpx #0 5678 271ac - bne secondportgunhandler 5679 271ac -firstportgunhandler 5680 271ac - lda SWCHA 5681 271ac - asl 5682 271ac - asl 5683 271ac - asl ; shift D4 to D7 5684 271ac - and #%10000000 5685 271ac - eor #%10000000 5686 271ac - sta sINPT1 5687 271ac - jmp buttonreadloopreturn 5688 271ac -secondportgunhandler 5689 271ac - lda SWCHA 5690 271ac - lsr ; shift D0 into carry 5691 271ac - lsr ; shift carry into D7 5692 271ac - and #%10000000 5693 271ac - eor #%10000000 5694 271ac - sta sINPT3 5695 271ac - jmp buttonreadloopreturn 5696 271ac endif ; LIGHTGUNSUPPORT 5697 271ac 5698 271ac controlsusing2buttoncode 5699 271ac 00 .byte.b 0 ; 00=no controller plugged in 5700 271ad 01 .byte.b 1 ; 01=proline joystick 5701 271ae 00 .byte.b 0 ; 02=lightgun 5702 271af 00 .byte.b 0 ; 03=paddle 5703 271b0 01 .byte.b 1 ; 04=trakball 5704 271b1 01 .byte.b 1 ; 05=vcs joystick 5705 271b2 01 .byte.b 1 ; 06=driving control 5706 271b3 00 .byte.b 0 ; 07=keypad control 5707 271b4 00 .byte.b 0 ; 08=st mouse/cx80 5708 271b5 00 .byte.b 0 ; 09=amiga mouse 5709 271b6 01 .byte.b 1 ; 10=atarivox 5710 271b7 00 .byte.b 0 ; 11=snes2atari 5711 271b8 5712 271b8 buttonhandlerhi 5713 271b8 00 .byte.b 0 ; 00=no controller plugged in 5714 271b9 f1 .byte.b >joybuttonhandler ; 01=proline joystick 5715 271ba f1 .byte.b >gunbuttonhandler ; 02=lightgun 5716 271bb f5 .byte.b >paddlebuttonhandler ; 03=paddle 5717 271bc f1 .byte.b >joybuttonhandler ; 04=trakball 5718 271bd f1 .byte.b >joybuttonhandler ; 05=vcs joystick 5719 271be f1 .byte.b >joybuttonhandler ; 06=driving control 5720 271bf 00 .byte.b 0 ; 07=keypad 5721 271c0 f5 .byte.b >mousebuttonhandler ; 08=st mouse 5722 271c1 f5 .byte.b >mousebuttonhandler ; 09=amiga mouse 5723 271c2 f1 .byte.b >joybuttonhandler ; 10=atarivox 5724 271c3 f1 .byte.b >snes2atarihandler ; 11=snes 5725 271c4 buttonhandlerlo 5726 271c4 00 .byte.b 0 ; 00=no controller plugged in 5727 271c5 75 .byte.b $0F means the sound is looped while priority is active 5867 2724f 5868 2724f 05 d9 ora inttemp2 5869 27251 05 d8 ora inttemp1 ; check if F|C|V=0 5870 27253 f0 23 beq zerosfx ; if so, we're at the end of the sound. 5871 27255 5872 27255 advancesfxpointer 5873 27255 ; advance the pointer to the next sound chunk 5874 27255 c8 iny 5875 27256 84 da sty inttemp3 5876 27258 18 clc 5877 27259 b5 4e lda sfx1pointlo,x 5878 2725b 65 da adc inttemp3 5879 2725d 95 4e sta sfx1pointlo,x 5880 2725f b5 50 lda sfx1pointhi,x 5881 27261 69 00 adc #0 5882 27263 95 50 sta sfx1pointhi,x 5883 27265 4c e9 f1 jmp servicesfxchannelsloop 5884 27268 5885 27268 sfxsoundloop 5886 27268 48 pha 5887 27269 b5 52 lda sfx1priority,x 5888 2726b d0 04 bne sfxsoundloop_carryon 5889 2726d 68 pla ; fix the stack before we go 5890 2726e 4c 55 f2 jmp advancesfxpointer 5891 27271 sfxsoundloop_carryon 5892 27271 68 pla 5893 27272 29 f0 and #$F0 5894 27274 4a lsr 5895 27275 4a lsr 5896 27276 4a lsr 5897 27277 4a lsr 5898 27278 5899 27278 zerosfx 5900 27278 95 4e sta sfx1pointlo,x 5901 2727a 95 50 sta sfx1pointhi,x 5902 2727c 95 52 sta sfx1priority,x 5903 2727e 4c e9 f1 jmp servicesfxchannelsloop 5904 27281 5905 27281 5906 27281 schedulesfx 5907 27281 ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 5908 27281 a0 00 ldy #0 5909 27283 b1 e0 lda (sfxinstrumentlo),y 5910 27285 - ifconst pokeysupport 5911 27285 - cmp #$20 ; POKEY? 5912 27285 - bne scheduletiasfx 5913 27285 - jmp schedulepokeysfx 5914 27285 endif 5915 27285 scheduletiasfx 5916 27285 ;cmp #$10 ; TIA? 5917 27285 ;beq continuescheduletiasfx 5918 27285 ; rts ; unhandled!!! 5919 27285 continuescheduletiasfx 5920 27285 ifnconst TIASFXMONO 5921 27285 a5 4e lda sfx1pointlo 5922 27287 05 50 ora sfx1pointhi 5923 27289 f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 5924 2728b a5 4f lda sfx2pointlo 5925 2728d 05 51 ora sfx2pointhi 5926 2728f f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 5927 27291 ; Both channels are scheduled. 5928 27291 a0 01 ldy #1 5929 27293 b1 e0 lda (sfxinstrumentlo),y 5930 27295 d0 01 bne interruptsfx 5931 27297 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 5932 27298 interruptsfx 5933 27298 ;Compare which active sound has a lower priority. We'll interrupt the lower one. 5934 27298 a5 52 lda sfx1priority 5935 2729a c5 53 cmp sfx2priority 5936 2729c b0 04 bcs schedulesfx2 5937 2729e endif ; !TIASFXMONO 5938 2729e 5939 2729e schedulesfx1 5940 2729e a2 00 ldx #0 ; channel 1 5941 272a0 ifnconst TIASFXMONO 5942 272a0 f0 02 beq skipschedulesfx2 5943 272a2 schedulesfx2 5944 272a2 a2 01 ldx #1 ; channel 2 5945 272a4 skipschedulesfx2 5946 272a4 endif ; !TIASFXMONO 5947 272a4 5948 272a4 - ifconst MUSICTRACKER 5949 272a4 - lda sfxnoteindex 5950 272a4 - bpl skipdrumkitoverride 5951 272a4 - and #$7F ; subtract 128 5952 272a4 - sec 5953 272a4 - sbc #4 ; drums start at 132, i.e. octave 10 5954 272a4 - asl 5955 272a4 - tay 5956 272a4 - lda tiadrumkitdefinition,y 5957 272a4 - sta sfxinstrumentlo 5958 272a4 - iny 5959 272a4 - lda tiadrumkitdefinition,y 5960 272a4 - sta sfxinstrumenthi 5961 272a4 - lda #0 5962 272a4 - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 5963 272a4 -skipdrumkitoverride 5964 272a4 endif ; MUSICTRACKER 5965 272a4 a0 01 ldy #1 ; get priority and sound-resolution (in frames) 5966 272a6 b1 e0 lda (sfxinstrumentlo),y 5967 272a8 95 52 sta sfx1priority,x 5968 272aa c8 iny 5969 272ab b1 e0 lda (sfxinstrumentlo),y 5970 272ad 95 56 sta sfx1frames,x 5971 272af a5 e0 lda sfxinstrumentlo 5972 272b1 18 clc 5973 272b2 69 03 adc #3 5974 272b4 95 4e sta sfx1pointlo,x 5975 272b6 a5 e1 lda sfxinstrumenthi 5976 272b8 69 00 adc #0 5977 272ba 95 50 sta sfx1pointhi,x 5978 272bc a5 e2 lda sfxpitchoffset 5979 272be 95 54 sta sfx1poffset,x 5980 272c0 a9 00 lda #0 5981 272c2 95 58 sta sfx1tick,x 5982 272c4 a5 e3 lda sfxnoteindex 5983 272c6 95 cd sta sfx1notedata,x 5984 272c8 60 rts 5985 272c9 5986 272c9 plotsprite 5987 272c9 ifnconst NODRAWWAIT 5988 272c9 - ifconst DOUBLEBUFFER 5989 272c9 - lda doublebufferstate 5990 272c9 - bne skipplotspritewait 5991 272c9 endif ; DOUBLEBUFFER 5992 272c9 - ifconst DEBUGWAITCOLOR 5993 272c9 - lda #$41 5994 272c9 - sta BACKGRND 5995 272c9 endif 5996 272c9 plotspritewait 5997 272c9 a5 4d lda visibleover 5998 272cb d0 fc bne plotspritewait 5999 272cd skipplotspritewait 6000 272cd - ifconst DEBUGWAITCOLOR 6001 272cd - lda #$0 6002 272cd - sta BACKGRND 6003 272cd endif 6004 272cd endif 6005 272cd 6006 272cd ;arguments: 6007 272cd ; temp1=lo graphicdata 6008 272cd ; temp2=hi graphicdata 6009 272cd ; temp3=palette | width byte 6010 272cd ; temp4=x 6011 272cd ; temp5=y 6012 272cd ; temp6=mode 6013 272cd a5 46 lda temp5 ;Y position 6014 272cf 4a lsr ; 2 - Divide by 8 or 16 6015 272d0 4a lsr ; 2 6016 272d1 4a lsr ; 2 6017 272d2 if WZONEHEIGHT = 16 6018 272d2 4a lsr ; 2 6019 272d3 endif 6020 272d3 6021 272d3 aa tax 6022 272d4 6023 272d4 ifnconst NOLIMITCHECKING 6024 272d4 6025 272d4 ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 6026 272d4 6027 272d4 c9 0c cmp #WZONECOUNT 6028 272d6 6029 272d6 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 6030 272d8 ; otherwise, check to see if the bottom half is in zone 0... 6031 272d8 6032 272d8 if WZONEHEIGHT = 16 6033 272d8 c9 0f cmp #15 6034 272da - else 6035 272da - cmp #31 6036 272da endif 6037 272da 6038 272da d0 05 bne exitplotsprite1 6039 272dc a2 00 ldx #0 6040 272de 4c 17 f3 jmp continueplotsprite2 6041 272e1 exitplotsprite1 6042 272e1 60 rts 6043 272e2 6044 272e2 continueplotsprite1 6045 272e2 endif 6046 272e2 6047 272e2 bd cf f5 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 6048 272e5 - ifconst DOUBLEBUFFER 6049 272e5 - clc 6050 272e5 - adc doublebufferdloffset 6051 272e5 endif ; DOUBLEBUFFER 6052 272e5 85 63 sta dlpnt 6053 272e7 bd c3 f5 lda DLPOINTH,x 6054 272ea - ifconst DOUBLEBUFFER 6055 272ea - adc #0 6056 272ea endif ; DOUBLEBUFFER 6057 272ea 85 64 sta dlpnt+1 6058 272ec 6059 272ec ;Create DL entry for upper part of sprite 6060 272ec 6061 272ec b4 65 ldy dlend,x ;Get the index to the end of this DL 6062 272ee 6063 272ee - ifconst CHECKOVERWRITE 6064 272ee - cpy #DLLASTOBJ 6065 272ee - beq checkcontinueplotsprite2 6066 272ee -continueplotsprite1a 6067 272ee endif 6068 272ee 6069 272ee a5 42 lda temp1 ; graphic data, lo byte 6070 272f0 91 63 sta (dlpnt),y ;Low byte of data address 6071 272f2 6072 272f2 ifnconst ATOMICSPRITEUPDATE 6073 272f2 c8 iny 6074 272f3 a5 47 lda temp6 6075 272f5 91 63 sta (dlpnt),y 6076 272f7 - else 6077 272f7 - iny 6078 272f7 - sty temp8 6079 272f7 endif 6080 272f7 6081 272f7 c8 iny 6082 272f8 6083 272f8 a5 46 lda temp5 ;Y position 6084 272fa 29 0f and #(WZONEHEIGHT - 1) 6085 272fc c9 01 cmp #1 ; clear carry if our sprite is just in this zone 6086 272fe 05 43 ora temp2 ; graphic data, hi byte 6087 27300 91 63 sta (dlpnt),y 6088 27302 6089 27302 6090 27302 c8 iny 6091 27303 a5 44 lda temp3 ;palette|width 6092 27305 91 63 sta (dlpnt),y 6093 27307 6094 27307 c8 iny 6095 27308 a5 45 lda temp4 ;Horizontal position 6096 2730a 91 63 sta (dlpnt),y 6097 2730c 6098 2730c c8 iny 6099 2730d 94 65 sty dlend,x 6100 2730f 6101 2730f - ifconst ALWAYSTERMINATE 6102 2730f - iny 6103 2730f - lda #0 6104 2730f - sta (dlpnt),y 6105 2730f endif 6106 2730f 6107 2730f - ifconst ATOMICSPRITEUPDATE 6108 2730f - ldy temp8 6109 2730f - lda temp6 6110 2730f - sta (dlpnt),y 6111 2730f endif 6112 2730f 6113 2730f checkcontinueplotsprite2 6114 2730f 6115 2730f 90 33 bcc doneSPDL ;branch if the sprite was fully in the last zone 6116 27311 6117 27311 ;Create DL entry for lower part of sprite 6118 27311 6119 27311 e8 inx ;Next region 6120 27312 6121 27312 ifnconst NOLIMITCHECKING 6122 27312 e0 0c cpx #WZONECOUNT 6123 27314 6124 27314 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 6125 27316 60 rts 6126 27317 continueplotsprite2 6127 27317 endif 6128 27317 6129 27317 bd cf f5 lda DLPOINTL,x ;Get pointer to next DL 6130 2731a - ifconst DOUBLEBUFFER 6131 2731a - clc 6132 2731a - adc doublebufferdloffset 6133 2731a endif ; DOUBLEBUFFER 6134 2731a 85 63 sta dlpnt 6135 2731c bd c3 f5 lda DLPOINTH,x 6136 2731f - ifconst DOUBLEBUFFER 6137 2731f - adc #0 6138 2731f endif ; DOUBLEBUFFER 6139 2731f 85 64 sta dlpnt+1 6140 27321 b4 65 ldy dlend,x ;Get the index to the end of this DL 6141 27323 6142 27323 - ifconst CHECKOVERWRITE 6143 27323 - cpy #DLLASTOBJ 6144 27323 - bne continueplotsprite2a 6145 27323 - rts 6146 27323 -continueplotsprite2a 6147 27323 endif 6148 27323 6149 27323 a5 42 lda temp1 ; graphic data, lo byte 6150 27325 91 63 sta (dlpnt),y 6151 27327 6152 27327 ifnconst ATOMICSPRITEUPDATE 6153 27327 c8 iny 6154 27328 a5 47 lda temp6 6155 2732a 91 63 sta (dlpnt),y 6156 2732c - else 6157 2732c - iny 6158 2732c - sty temp8 6159 2732c endif 6160 2732c 6161 2732c c8 iny 6162 2732d 6163 2732d a5 46 lda temp5 ;Y position 6164 2732f 0b 0f anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 6165 27331 05 43 ora temp2 ; graphic data, hi byte 6166 27333 e9 0f sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 6167 27335 91 63 sta (dlpnt),y 6168 27337 6169 27337 c8 iny 6170 27338 6171 27338 a5 44 lda temp3 ;palette|width 6172 2733a 91 63 sta (dlpnt),y 6173 2733c 6174 2733c c8 iny 6175 2733d 6176 2733d a5 45 lda temp4 ;Horizontal position 6177 2733f 91 63 sta (dlpnt),y 6178 27341 6179 27341 c8 iny 6180 27342 94 65 sty dlend,x 6181 27344 6182 27344 - ifconst ALWAYSTERMINATE 6183 27344 - iny 6184 27344 - lda #0 6185 27344 - sta (dlpnt),y 6186 27344 endif 6187 27344 6188 27344 - ifconst ATOMICSPRITEUPDATE 6189 27344 - ldy temp8 6190 27344 - lda temp6 6191 27344 - sta (dlpnt),y 6192 27344 endif 6193 27344 6194 27344 doneSPDL 6195 27344 60 rts 6196 27345 6197 27345 6198 27345 lockzonex 6199 27345 - ifconst ZONELOCKS 6200 27345 - ldy dlend,x 6201 27345 - cpy #DLLASTOBJ 6202 27345 - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 6203 27345 - lda DLPOINTL,x 6204 27345 - ifconst DOUBLEBUFFER 6205 27345 - clc 6206 27345 - adc doublebufferdloffset 6207 27345 - endif ; DOUBLEBUFFER 6208 27345 - sta dlpnt 6209 27345 - lda DLPOINTH,x 6210 27345 - ifconst DOUBLEBUFFER 6211 27345 - adc #0 6212 27345 - endif ; DOUBLEBUFFER 6213 27345 - sta dlpnt+1 6214 27345 - iny 6215 27345 - lda #0 6216 27345 - sta (dlpnt),y 6217 27345 - dey 6218 27345 - tya 6219 27345 - ldy #(DLLASTOBJ-1) 6220 27345 - sta (dlpnt),y 6221 27345 - iny 6222 27345 - sty dlend,x 6223 27345 -lockzonexreturn 6224 27345 - rts 6225 27345 endif ; ZONELOCKS 6226 27345 unlockzonex 6227 27345 - ifconst ZONELOCKS 6228 27345 - ldy dlend,x 6229 27345 - cpy #DLLASTOBJ 6230 27345 - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 6231 27345 - lda DLPOINTL,x 6232 27345 - ifconst DOUBLEBUFFER 6233 27345 - clc 6234 27345 - adc doublebufferdloffset 6235 27345 - endif ; DOUBLEBUFFER 6236 27345 - sta dlpnt 6237 27345 - lda DLPOINTH,x 6238 27345 - ifconst DOUBLEBUFFER 6239 27345 - adc #0 6240 27345 - endif ; DOUBLEBUFFER 6241 27345 - sta dlpnt+1 6242 27345 - dey 6243 27345 - ;ldy #(DLLASTOBJ-1) 6244 27345 - lda (dlpnt),y 6245 27345 - tay 6246 27345 - sty dlend,x 6247 27345 -unlockzonexreturn 6248 27345 endif ; ZONELOCKS 6249 27345 60 rts 6250 27346 6251 27346 plotcharloop 6252 27346 ; ** read from a data indirectly pointed to from temp8,temp9 6253 27346 ; ** format is: lo_data, hi_data, palette|width, x, y 6254 27346 ; ** format ends with lo_data | hi_data = 0 6255 27346 6256 27346 - ifconst DOUBLEBUFFER 6257 27346 - lda doublebufferstate 6258 27346 - bne skipplotcharloopwait 6259 27346 endif ; DOUBLEBUFFER 6260 27346 - ifconst DEBUGWAITCOLOR 6261 27346 - lda #$61 6262 27346 - sta BACKGRND 6263 27346 endif 6264 27346 plotcharloopwait 6265 27346 a5 4d lda visibleover 6266 27348 d0 fc bne plotcharloopwait 6267 2734a - ifconst DEBUGWAITCOLOR 6268 2734a - lda #0 6269 2734a - sta BACKGRND 6270 2734a endif 6271 2734a skipplotcharloopwait 6272 2734a plotcharlooploop 6273 2734a a0 00 ldy #0 6274 2734c b1 49 lda (temp8),y 6275 2734e 85 42 sta temp1 6276 27350 c8 iny 6277 27351 b1 49 lda (temp8),y 6278 27353 85 43 sta temp2 6279 27355 05 42 ora temp1 6280 27357 d0 01 bne plotcharloopcontinue 6281 27359 ;the pointer=0, so return 6282 27359 60 rts 6283 2735a plotcharloopcontinue 6284 2735a c8 iny 6285 2735b b1 49 lda (temp8),y 6286 2735d 85 44 sta temp3 6287 2735f c8 iny 6288 27360 b1 49 lda (temp8),y 6289 27362 85 45 sta temp4 6290 27364 c8 iny 6291 27365 b1 49 lda (temp8),y 6292 27367 ;sta temp5 ; not needed with our late entry. 6293 27367 20 80 f3 jsr plotcharactersskipentry 6294 2736a a5 49 lda temp8 6295 2736c 18 clc 6296 2736d 69 05 adc #5 6297 2736f 85 49 sta temp8 6298 27371 a5 4a lda temp9 6299 27373 69 00 adc #0 6300 27375 85 4a sta temp9 6301 27377 4c 4a f3 jmp plotcharlooploop 6302 2737a 6303 2737a plotcharacters 6304 2737a - ifconst DOUBLEBUFFER 6305 2737a - lda doublebufferstate 6306 2737a - bne skipplotcharacterswait 6307 2737a endif ; DOUBLEBUFFER 6308 2737a - ifconst DEBUGWAITCOLOR 6309 2737a - lda #$41 6310 2737a - sta BACKGRND 6311 2737a endif 6312 2737a plotcharacterswait 6313 2737a a5 4d lda visibleover 6314 2737c d0 fc bne plotcharacterswait 6315 2737e - ifconst DEBUGWAITCOLOR 6316 2737e - sta BACKGRND 6317 2737e endif 6318 2737e skipplotcharacterswait 6319 2737e ;arguments: 6320 2737e ; temp1=lo charactermap 6321 2737e ; temp2=hi charactermap 6322 2737e ; temp3=palette | width byte 6323 2737e ; temp4=x 6324 2737e ; temp5=y 6325 2737e 6326 2737e a5 46 lda temp5 ;Y position 6327 27380 6328 27380 plotcharactersskipentry 6329 27380 6330 27380 ;ifconst ZONEHEIGHT 6331 27380 ; if ZONEHEIGHT = 16 6332 27380 ; and #$0F 6333 27380 ; endif 6334 27380 ; if ZONEHEIGHT = 8 6335 27380 ; and #$1F 6336 27380 ; endif 6337 27380 ;else 6338 27380 ; and #$0F 6339 27380 ;endif 6340 27380 6341 27380 aa tax 6342 27381 bd cf f5 lda DLPOINTL,x ;Get pointer to DL that the characters are in 6343 27384 - ifconst DOUBLEBUFFER 6344 27384 - clc 6345 27384 - adc doublebufferdloffset 6346 27384 endif ; DOUBLEBUFFER 6347 27384 85 63 sta dlpnt 6348 27386 bd c3 f5 lda DLPOINTH,x 6349 27389 - ifconst DOUBLEBUFFER 6350 27389 - adc #0 6351 27389 endif ; DOUBLEBUFFER 6352 27389 85 64 sta dlpnt+1 6353 2738b 6354 2738b ;Create DL entry for the characters 6355 2738b 6356 2738b b4 65 ldy dlend,x ;Get the index to the end of this DL 6357 2738d 6358 2738d - ifconst CHECKOVERWRITE 6359 2738d - cpy #DLLASTOBJ 6360 2738d - bne continueplotcharacters 6361 2738d - rts 6362 2738d -continueplotcharacters 6363 2738d endif 6364 2738d 6365 2738d a5 42 lda temp1 ; character map data, lo byte 6366 2738f 91 63 sta (dlpnt),y ;(1) store low address 6367 27391 6368 27391 c8 iny 6369 27392 ad 06 21 lda charactermode 6370 27395 91 63 sta (dlpnt),y ;(2) store mode 6371 27397 6372 27397 c8 iny 6373 27398 a5 43 lda temp2 ; character map, hi byte 6374 2739a 91 63 sta (dlpnt),y ;(3) store high address 6375 2739c 6376 2739c c8 iny 6377 2739d a5 44 lda temp3 ;palette|width 6378 2739f 91 63 sta (dlpnt),y ;(4) store palette|width 6379 273a1 6380 273a1 c8 iny 6381 273a2 a5 45 lda temp4 ;Horizontal position 6382 273a4 91 63 sta (dlpnt),y ;(5) store horizontal position 6383 273a6 6384 273a6 c8 iny 6385 273a7 94 65 sty dlend,x ; save display list end byte 6386 273a9 60 rts 6387 273aa 6388 273aa 6389 273aa - ifconst plotvalueonscreen 6390 273aa -plotcharacterslive 6391 273aa - ; a version of plotcharacters that draws live and minimally disrupts the screen... 6392 273aa - 6393 273aa - ;arguments: 6394 273aa - ; temp1=lo charactermap 6395 273aa - ; temp2=hi charactermap 6396 273aa - ; temp3=palette | width byte 6397 273aa - ; temp4=x 6398 273aa - ; temp5=y 6399 273aa - 6400 273aa - lda temp5 ;Y position 6401 273aa - 6402 273aa - tax 6403 273aa - lda DLPOINTL,x ;Get pointer to DL that the characters are in 6404 273aa - ifconst DOUBLEBUFFER 6405 273aa - clc 6406 273aa - adc doublebufferdloffset 6407 273aa - endif ; DOUBLEBUFFER 6408 273aa - sta dlpnt 6409 273aa - lda DLPOINTH,x 6410 273aa - ifconst DOUBLEBUFFER 6411 273aa - adc #0 6412 273aa - endif ; DOUBLEBUFFER 6413 273aa - sta dlpnt+1 6414 273aa - 6415 273aa - ;Create DL entry for the characters 6416 273aa - 6417 273aa - ldy dlend,x ;Get the index to the end of this DL 6418 273aa - 6419 273aa - ifconst CHECKOVERWRITE 6420 273aa - cpy #DLLASTOBJ 6421 273aa - bne continueplotcharacterslive 6422 273aa - rts 6423 273aa -continueplotcharacterslive 6424 273aa - endif 6425 273aa - 6426 273aa - lda temp1 ; character map data, lo byte 6427 273aa - sta (dlpnt),y ;(1) store low address 6428 273aa - 6429 273aa - iny 6430 273aa - ; we don't add the second byte yet, since the charmap could briefly 6431 273aa - ; render without a proper character map address, width, or position. 6432 273aa - lda charactermode 6433 273aa - sta (dlpnt),y ;(2) store mode 6434 273aa - 6435 273aa - iny 6436 273aa - lda temp2 ; character map, hi byte 6437 273aa - sta (dlpnt),y ;(3) store high address 6438 273aa - 6439 273aa - iny 6440 273aa - lda temp3 ;palette|width 6441 273aa - sta (dlpnt),y ;(4) store palette|width 6442 273aa - 6443 273aa - iny 6444 273aa - lda temp4 ;Horizontal position 6445 273aa - sta (dlpnt),y ;(5) store horizontal position 6446 273aa - 6447 273aa - iny 6448 273aa - sty dlend,x ; save display list end byte 6449 273aa - 6450 273aa - rts 6451 273aa endif ;plotcharacterslive 6452 273aa 6453 273aa - ifconst USED_PLOTVALUE 6454 273aa -plotvalue 6455 273aa - ; calling 7800basic command: 6456 273aa - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6457 273aa - ; ...displays the variable as BCD digits 6458 273aa - ; 6459 273aa - ; asm sub arguments: 6460 273aa - ; temp1=lo charactermap 6461 273aa - ; temp2=hi charactermap 6462 273aa - ; temp3=palette | width byte 6463 273aa - ; temp4=x 6464 273aa - ; temp5=y 6465 273aa - ; temp6=number of digits 6466 273aa - ; temp7=lo variable 6467 273aa - ; temp8=hi variable 6468 273aa - ; temp9=character mode 6469 273aa - 6470 273aa -plotdigitcount = temp6 6471 273aa - 6472 273aa - ifconst ZONELOCKS 6473 273aa - ldx temp5 6474 273aa - ldy dlend,x 6475 273aa - cpy #DLLASTOBJ 6476 273aa - bne carryonplotvalue 6477 273aa - rts 6478 273aa -carryonplotvalue 6479 273aa - endif 6480 273aa - 6481 273aa - lda #0 6482 273aa - tay 6483 273aa - ldx valbufend 6484 273aa - 6485 273aa - lda plotdigitcount 6486 273aa - and #1 6487 273aa - beq pvnibble2char 6488 273aa - lda #0 6489 273aa - sta VALBUFFER,x ; just in case we skip this digit 6490 273aa - beq pvnibble2char_skipnibble 6491 273aa - 6492 273aa -pvnibble2char 6493 273aa - ; high nibble... 6494 273aa - lda (temp7),y 6495 273aa - and #$f0 6496 273aa - lsr 6497 273aa - lsr 6498 273aa - lsr 6499 273aa - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6500 273aa - lsr 6501 273aa - endif 6502 273aa - 6503 273aa - clc 6504 273aa - adc temp1 ; add the offset to character graphics to our value 6505 273aa - sta VALBUFFER,x 6506 273aa - inx 6507 273aa - dec plotdigitcount 6508 273aa - 6509 273aa -pvnibble2char_skipnibble 6510 273aa - ; low nibble... 6511 273aa - lda (temp7),y 6512 273aa - and #$0f 6513 273aa - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6514 273aa - asl 6515 273aa - endif 6516 273aa - clc 6517 273aa - adc temp1 ; add the offset to character graphics to our value 6518 273aa - sta VALBUFFER,x 6519 273aa - inx 6520 273aa - iny 6521 273aa - 6522 273aa - dec plotdigitcount 6523 273aa - bne pvnibble2char 6524 273aa - 6525 273aa - ;point to the start of our valuebuffer 6526 273aa - clc 6527 273aa - lda #VALBUFFER 6531 273aa - adc #0 6532 273aa - sta temp2 6533 273aa - 6534 273aa - ;advance valbufend to the end of our value buffer 6535 273aa - stx valbufend 6536 273aa - 6537 273aa - ifnconst plotvalueonscreen 6538 273aa - jmp plotcharacters 6539 273aa - else 6540 273aa - jmp plotcharacterslive 6541 273aa - endif 6542 273aa - 6543 273aa endif ; USED_PLOTVALUE 6544 273aa 6545 273aa 6546 273aa - ifconst USED_PLOTVALUEEXTRA 6547 273aa -plotdigitcount = temp6 6548 273aa -plotvalueextra 6549 273aa - ; calling 7800basic command: 6550 273aa - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6551 273aa - ; ...displays the variable as BCD digits 6552 273aa - ; 6553 273aa - ; asm sub arguments: 6554 273aa - ; temp1=lo charactermap 6555 273aa - ; temp2=hi charactermap 6556 273aa - ; temp3=palette | width byte 6557 273aa - ; temp4=x 6558 273aa - ; temp5=y 6559 273aa - ; temp6=number of digits 6560 273aa - ; temp7=lo variable 6561 273aa - ; temp8=hi variable 6562 273aa - 6563 273aa - lda #0 6564 273aa - tay 6565 273aa - ldx valbufend 6566 273aa - ifnconst plotvalueonscreen 6567 273aa - sta VALBUFFER,x 6568 273aa - endif 6569 273aa - 6570 273aa - lda plotdigitcount 6571 273aa - and #1 6572 273aa - 6573 273aa - bne pvnibble2char_skipnibbleextra 6574 273aa - 6575 273aa -pvnibble2charextra 6576 273aa - ; high nibble... 6577 273aa - lda (temp7),y 6578 273aa - and #$f0 6579 273aa - lsr 6580 273aa - lsr 6581 273aa - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6582 273aa - lsr 6583 273aa - endif 6584 273aa - clc 6585 273aa - adc temp1 ; add the offset to character graphics to our value 6586 273aa - sta VALBUFFER,x 6587 273aa - inx 6588 273aa - 6589 273aa - ; second half of the digit 6590 273aa - clc 6591 273aa - adc #1 6592 273aa - sta VALBUFFER,x 6593 273aa - inx 6594 273aa - 6595 273aa -pvnibble2char_skipnibbleextra 6596 273aa - ; low nibble... 6597 273aa - lda (temp7),y 6598 273aa - and #$0f 6599 273aa - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6600 273aa - asl 6601 273aa - endif 6602 273aa - asl 6603 273aa - 6604 273aa - clc 6605 273aa - adc temp1 ; add the offset to character graphics to our value 6606 273aa - sta VALBUFFER,x 6607 273aa - inx 6608 273aa - 6609 273aa - clc 6610 273aa - adc #1 6611 273aa - sta VALBUFFER,x 6612 273aa - inx 6613 273aa - iny 6614 273aa - 6615 273aa - dec plotdigitcount 6616 273aa - bne pvnibble2charextra 6617 273aa - 6618 273aa - ;point to the start of our valuebuffer 6619 273aa - clc 6620 273aa - lda #VALBUFFER 6624 273aa - adc #0 6625 273aa - sta temp2 6626 273aa - 6627 273aa - ;advance valbufend to the end of our value buffer 6628 273aa - stx valbufend 6629 273aa - 6630 273aa - ifnconst plotvalueonscreen 6631 273aa - jmp plotcharacters 6632 273aa - else 6633 273aa - jmp plotcharacterslive 6634 273aa - endif 6635 273aa endif ; USED_PLOTVALUEEXTRA 6636 273aa 6637 273aa boxcollision 6638 273aa - ifconst BOXCOLLISION 6639 273aa - ; the worst case cycle-time for the code below is 43 cycles. 6640 273aa - ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 6641 273aa - 6642 273aa - ;__boxx1 = accumulator 6643 273aa - ;__boxy1 = y 6644 273aa -__boxw1 = temp3 6645 273aa -__boxh1 = temp4 6646 273aa - 6647 273aa -__boxx2 = temp5 6648 273aa -__boxy2 = temp6 6649 273aa -__boxw2 = temp7 6650 273aa -__boxh2 = temp8 6651 273aa - 6652 273aa -DoXCollisionCheck 6653 273aa - ;lda __boxx1 ; skipped. already in the accumulator 6654 273aa - cmp __boxx2 ;3 6655 273aa - bcs X1isbiggerthanX2 ;2/3 6656 273aa -X2isbiggerthanX1 6657 273aa - ; carry is clear 6658 273aa - adc __boxw1 ;3 6659 273aa - cmp __boxx2 ;3 6660 273aa - bcs DoYCollisionCheck ;3/2 6661 273aa - rts ;6 - carry clear, no collision 6662 273aa -X1isbiggerthanX2 6663 273aa - clc ;2 6664 273aa - sbc __boxw2 ;3 6665 273aa - cmp __boxx2 ;3 6666 273aa - bcs noboxcollision ;3/2 6667 273aa -DoYCollisionCheck 6668 273aa - tya ; 2 ; use to be "lda __boxy1" 6669 273aa - cmp __boxy2 ;3 6670 273aa - bcs Y1isbiggerthanY2 ;3/2 6671 273aa -Y2isbiggerthanY1 6672 273aa - ; carry is clear 6673 273aa - adc __boxh1 ;3 6674 273aa - cmp __boxy2 ;3 6675 273aa - rts ;6 6676 273aa -Y1isbiggerthanY2 6677 273aa - clc ;2 6678 273aa - sbc __boxh2 ;3 6679 273aa - cmp __boxy2 ;3 6680 273aa - bcs noboxcollision ;3/2 6681 273aa -yesboxcollision 6682 273aa - sec ;2 6683 273aa - rts ;6 6684 273aa -noboxcollision 6685 273aa - clc ;2 6686 273aa - rts ;6 6687 273aa endif ; BOXCOLLISION 6688 273aa 6689 273aa randomize 6690 273aa a5 40 lda rand 6691 273ac 4a lsr 6692 273ad 26 41 rol rand16 6693 273af 90 02 bcc noeor 6694 273b1 49 b4 eor #$B4 6695 273b3 noeor 6696 273b3 85 40 sta rand 6697 273b5 45 41 eor rand16 6698 273b7 60 rts 6699 273b8 6700 273b8 ; *** bcd conversion routine courtesy Omegamatrix 6701 273b8 ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 6702 273b8 converttobcd 6703 273b8 ;value to convert is in the accumulator 6704 273b8 85 42 sta temp1 6705 273ba 4a lsr 6706 273bb 65 42 adc temp1 6707 273bd 6a ror 6708 273be 4a lsr 6709 273bf 4a lsr 6710 273c0 65 42 adc temp1 6711 273c2 6a ror 6712 273c3 65 42 adc temp1 6713 273c5 6a ror 6714 273c6 4a lsr 6715 273c7 29 3c and #$3C 6716 273c9 85 43 sta temp2 6717 273cb 4a lsr 6718 273cc 65 43 adc temp2 6719 273ce 65 42 adc temp1 6720 273d0 60 rts ; return the result in the accumulator 6721 273d1 6722 273d1 ; Y and A contain multiplicands, result in A 6723 273d1 mul8 6724 273d1 84 42 sty temp1 6725 273d3 85 43 sta temp2 6726 273d5 a9 00 lda #0 6727 273d7 reptmul8 6728 273d7 46 43 lsr temp2 6729 273d9 90 03 bcc skipmul8 6730 273db 18 clc 6731 273dc 65 42 adc temp1 6732 273de ;bcs donemul8 might save cycles? 6733 273de skipmul8 6734 273de ;beq donemul8 might save cycles? 6735 273de 06 42 asl temp1 6736 273e0 d0 f5 bne reptmul8 6737 273e2 donemul8 6738 273e2 60 rts 6739 273e3 6740 273e3 div8 6741 273e3 ; A=numerator Y=denominator, result in A 6742 273e3 c0 02 cpy #2 6743 273e5 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 6744 273e7 84 42 sty temp1 6745 273e9 a0 ff ldy #$ff 6746 273eb div8loop 6747 273eb e5 42 sbc temp1 6748 273ed c8 iny 6749 273ee b0 fb bcs div8loop 6750 273f0 div8end 6751 273f0 98 tya 6752 273f1 ; result in A 6753 273f1 60 rts 6754 273f2 6755 273f2 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 6756 273f2 mul16 6757 273f2 84 42 sty temp1 6758 273f4 85 43 sta temp2 6759 273f6 6760 273f6 a9 00 lda #0 6761 273f8 a2 08 ldx #8 6762 273fa 46 42 lsr temp1 6763 273fc mul16_1 6764 273fc 90 03 bcc mul16_2 6765 273fe 18 clc 6766 273ff 65 43 adc temp2 6767 27401 mul16_2 6768 27401 6a ror 6769 27402 66 42 ror temp1 6770 27404 ca dex 6771 27405 d0 f5 bne mul16_1 6772 27407 85 43 sta temp2 6773 27409 60 rts 6774 2740a 6775 2740a ; div int/int 6776 2740a ; numerator in A, denom in temp1 6777 2740a ; returns with quotient in A, remainder in temp1 6778 2740a div16 6779 2740a 85 43 sta temp2 6780 2740c 84 42 sty temp1 6781 2740e a9 00 lda #0 6782 27410 a2 08 ldx #8 6783 27412 06 43 asl temp2 6784 27414 div16_1 6785 27414 2a rol 6786 27415 c5 42 cmp temp1 6787 27417 90 02 bcc div16_2 6788 27419 e5 42 sbc temp1 6789 2741b div16_2 6790 2741b 26 43 rol temp2 6791 2741d ca dex 6792 2741e d0 f4 bne div16_1 6793 27420 85 42 sta temp1 6794 27422 a5 43 lda temp2 6795 27424 60 rts 6796 27425 6797 27425 ifconst bankswitchmode 6798 27425 BS_jsr 6799 27425 - ifconst dumpbankswitch 6800 27425 - sta dumpbankswitch 6801 27425 endif 6802 27425 - ifconst MCPDEVCART 6803 27425 - ora #$18 6804 27425 - sta $3000 6805 27425 else 6806 27425 8d 00 80 sta $8000 6807 27428 endif 6808 27428 68 pla 6809 27429 aa tax 6810 2742a 68 pla 6811 2742b 60 rts 6812 2742c 6813 2742c BS_return 6814 2742c 68 pla ; bankswitch bank 6815 2742d - ifconst dumpbankswitch 6816 2742d - sta dumpbankswitch 6817 2742d endif 6818 2742d - ifconst BANKRAM 6819 2742d - sta currentbank 6820 2742d - ora currentrambank 6821 2742d endif 6822 2742d - ifconst MCPDEVCART 6823 2742d - ora #$18 6824 2742d - sta $3000 6825 2742d else 6826 2742d 8d 00 80 sta $8000 6827 27430 endif 6828 27430 68 pla ; bankswitch $0 flag 6829 27431 60 rts 6830 27432 endif 6831 27432 6832 27432 checkselectswitch 6833 27432 ad 82 02 lda SWCHB ; first check the real select switch... 6834 27435 29 02 and #%00000010 6835 27437 ifnconst SOFTPAUSEOFF 6836 27437 ifnconst MOUSESUPPORT 6837 27437 ifnconst TRAKBALLSUPPORT 6838 27437 f0 0f beq checkselectswitchreturn ; switch is pressed 6839 27439 ad b7 01 lda port0control 6840 2743c c9 0b cmp #11 6841 2743e d0 03 bne checkselectsoftswitch 6842 27440 a9 ff lda #$ff 6843 27442 60 rts 6844 27443 checkselectsoftswitch 6845 27443 ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 6846 27446 29 b0 and #%10110000 ; R_DU 6847 27448 endif ; TRAKBALLSUPPORT 6848 27448 endif ; MOUSESUPPORT 6849 27448 endif ; SOFTPAUSEOFF 6850 27448 checkselectswitchreturn 6851 27448 60 rts 6852 27449 6853 27449 checkresetswitch 6854 27449 ad 82 02 lda SWCHB ; first check the real reset switch... 6855 2744c 29 01 and #%00000001 6856 2744e ifnconst SOFTPAUSEOFF 6857 2744e ifnconst MOUSESUPPORT 6858 2744e ifnconst TRAKBALLSUPPORT 6859 2744e f0 0f beq checkresetswitchreturn ; switch is pressed 6860 27450 ad b7 01 lda port0control 6861 27453 c9 0b cmp #11 6862 27455 d0 03 bne checkresetsoftswitch 6863 27457 a9 ff lda #$ff 6864 27459 60 rts 6865 2745a checkresetsoftswitch 6866 2745a ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 6867 2745d 29 70 and #%01110000 ; _LDU 6868 2745f endif ; TRAKBALLSUPPORT 6869 2745f endif ; MOUSESUPPORT 6870 2745f endif ; SOFTPAUSEOFF 6871 2745f checkresetswitchreturn 6872 2745f 60 rts 6873 27460 6874 27460 - ifconst FINESCROLLENABLED 6875 27460 -finescrolldlls 6876 27460 - ldx temp1 ; first DLL index x3 6877 27460 - lda DLLMEM,x 6878 27460 - and #%11110000 6879 27460 - ora finescrolly 6880 27460 - sta DLLMEM,x 6881 27460 - 6882 27460 - ldx temp2 ; last DLL index x3 6883 27460 - lda DLLMEM,x 6884 27460 - and #%11110000 6885 27460 - ora finescrolly 6886 27460 - eor #(WZONEHEIGHT-1) 6887 27460 - sta DLLMEM,x 6888 27460 - rts 6889 27460 endif ; FINESCROLLENABLED 6890 27460 6891 27460 - ifconst USED_ADJUSTVISIBLE 6892 27460 -adjustvisible 6893 27460 - ; called with temp1=first visible zone *3, temp2=last visible zone *3 6894 27460 - jsr waitforvblankstart ; ensure vblank just started 6895 27460 - ldx visibleDLLstart 6896 27460 -findfirstinterrupt 6897 27460 - lda DLLMEM,x 6898 27460 - bmi foundfirstinterrupt 6899 27460 - inx 6900 27460 - inx 6901 27460 - inx 6902 27460 - bne findfirstinterrupt 6903 27460 -foundfirstinterrupt 6904 27460 - and #%01111111 ; clear the interrupt bit 6905 27460 - sta DLLMEM,x 6906 27460 - ifconst DOUBLEBUFFER 6907 27460 - sta DLLMEM+DBOFFSET,x 6908 27460 - endif ; DOUBLEBUFFER 6909 27460 - ldx overscanDLLstart 6910 27460 -findlastinterrupt 6911 27460 - lda DLLMEM,x 6912 27460 - bmi foundlastinterrupt 6913 27460 - dex 6914 27460 - dex 6915 27460 - dex 6916 27460 - bne findlastinterrupt 6917 27460 -foundlastinterrupt 6918 27460 - and #%01111111 ; clear the interrupt bit 6919 27460 - sta DLLMEM,x 6920 27460 - ifconst DOUBLEBUFFER 6921 27460 - sta DLLMEM+DBOFFSET,x 6922 27460 - endif ; DOUBLEBUFFER 6923 27460 - ;now we need to set the new interrupts 6924 27460 - clc 6925 27460 - lda temp1 6926 27460 - adc visibleDLLstart 6927 27460 - tax 6928 27460 - lda DLLMEM,x 6929 27460 - ora #%10000000 6930 27460 - sta DLLMEM,x 6931 27460 - ifconst DOUBLEBUFFER 6932 27460 - sta DLLMEM+DBOFFSET,x 6933 27460 - endif ; DOUBLEBUFFER 6934 27460 - clc 6935 27460 - lda temp2 6936 27460 - adc visibleDLLstart 6937 27460 - tax 6938 27460 - lda DLLMEM,x 6939 27460 - ora #%10000000 6940 27460 - sta DLLMEM,x 6941 27460 - ifconst DOUBLEBUFFER 6942 27460 - sta DLLMEM+DBOFFSET,x 6943 27460 - endif ; DOUBLEBUFFER 6944 27460 - jsr vblankresync 6945 27460 - rts 6946 27460 endif ; USED_ADJUSTVISIBLE 6947 27460 6948 27460 vblankresync 6949 27460 20 fe f4 jsr waitforvblankstart ; ensure vblank just started 6950 27463 a9 00 lda #0 6951 27465 85 4d sta visibleover 6952 27467 a9 03 lda #3 6953 27469 8d b2 01 sta interruptindex 6954 2746c 60 rts 6955 2746d 6956 2746d createallgamedlls 6957 2746d a2 00 ldx #0 6958 2746f a9 19 lda #NVLINES 6959 27471 ac 09 21 ldy paldetected 6960 27474 f0 03 beq skipcreatePALpadding 6961 27476 18 clc 6962 27477 69 15 adc #21 6963 27479 skipcreatePALpadding 6964 27479 20 ae f4 jsr createnonvisibledlls 6965 2747c 8e 3c 21 stx visibleDLLstart 6966 2747f 20 df f4 jsr createvisiblezones 6967 27482 8e 3d 21 stx overscanDLLstart 6968 27485 createallgamedllscontinue 6969 27485 a9 50 lda #(NVLINES+55) ; extras for PAL 6970 27487 20 ae f4 jsr createnonvisibledlls 6971 2748a 6972 2748a ae 3c 21 ldx visibleDLLstart 6973 2748d bd 00 18 lda DLLMEM,x 6974 27490 09 80 ora #%10000000 ; NMI 1 - start of visible screen 6975 27492 9d 00 18 sta DLLMEM,x 6976 27495 - ifconst DOUBLEBUFFER 6977 27495 - sta DLLMEM+DBOFFSET,x 6978 27495 endif ; DOUBLEBUFFER 6979 27495 6980 27495 ae 3d 21 ldx overscanDLLstart 6981 27498 bd 00 18 lda DLLMEM,x 6982 2749b 09 83 ora #%10000011 ; NMI 2 - end of visible screen 6983 2749d 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 6984 2749f 9d 00 18 sta DLLMEM,x 6985 274a2 - ifconst DOUBLEBUFFER 6986 274a2 - sta DLLMEM+DBOFFSET,x 6987 274a2 endif ; DOUBLEBUFFER 6988 274a2 6989 274a2 e8 inx 6990 274a3 e8 inx 6991 274a4 e8 inx 6992 274a5 6993 274a5 bd 00 18 lda DLLMEM,x 6994 274a8 09 80 ora #%10000000 ; NMI 3 - deeper overscan 6995 274aa 9d 00 18 sta DLLMEM,x 6996 274ad - ifconst DOUBLEBUFFER 6997 274ad - sta DLLMEM+DBOFFSET,x 6998 274ad endif ; DOUBLEBUFFER 6999 274ad 7000 274ad 60 rts 7001 274ae 7002 274ae createnonvisibledlls 7003 274ae 85 42 sta temp1 7004 274b0 4a lsr 7005 274b1 4a lsr 7006 274b2 4a lsr 7007 274b3 4a lsr ; /16 7008 274b4 f0 09 beq skipcreatenonvisibledlls1loop 7009 274b6 a8 tay 7010 274b7 createnonvisibledlls1loop 7011 274b7 a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 7012 274b9 20 ce f4 jsr createblankdllentry 7013 274bc 88 dey 7014 274bd d0 f8 bne createnonvisibledlls1loop 7015 274bf skipcreatenonvisibledlls1loop 7016 274bf a5 42 lda temp1 7017 274c1 29 0f and #%00001111 7018 274c3 f0 08 beq createnonvisibledllsreturn 7019 274c5 38 sec 7020 274c6 e9 01 sbc #1 7021 274c8 09 40 ora #%01000000 7022 274ca 20 ce f4 jsr createblankdllentry 7023 274cd createnonvisibledllsreturn 7024 274cd 60 rts 7025 274ce 7026 274ce createblankdllentry 7027 274ce 9d 00 18 sta DLLMEM,x 7028 274d1 - ifconst DOUBLEBUFFER 7029 274d1 - sta DLLMEM+DBOFFSET,x 7030 274d1 endif ; DOUBLEBUFFER 7031 274d1 e8 inx 7032 274d2 a9 21 lda #$21 ; blank 7033 274d4 9d 00 18 sta DLLMEM,x 7034 274d7 - ifconst DOUBLEBUFFER 7035 274d7 - sta DLLMEM+DBOFFSET,x 7036 274d7 endif ; DOUBLEBUFFER 7037 274d7 e8 inx 7038 274d8 a9 00 lda #$00 7039 274da 9d 00 18 sta DLLMEM,x 7040 274dd - ifconst DOUBLEBUFFER 7041 274dd - sta DLLMEM+DBOFFSET,x 7042 274dd endif ; DOUBLEBUFFER 7043 274dd e8 inx 7044 274de 60 rts 7045 274df 7046 274df createvisiblezones 7047 274df a0 00 ldy #0 7048 274e1 createvisiblezonesloop 7049 274e1 b9 db f5 lda.w DLHEIGHT,y 7050 274e4 09 40 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 7051 274e6 9d 00 18 sta DLLMEM,x 7052 274e9 - ifconst DOUBLEBUFFER 7053 274e9 - sta DLLMEM+DBOFFSET,x 7054 274e9 endif ; DOUBLEBUFFER 7055 274e9 e8 inx 7056 274ea b9 c3 f5 lda DLPOINTH,y 7057 274ed - ifconst BANKSET_DL_IN_CARTRAM 7058 274ed - ; with bankset cart ram, we added $8000 to the DL address so plot functions would hit the write-address 7059 274ed - ; but now we need to subtract that $8000 location to give Maria the normal address 7060 274ed - sec 7061 274ed - sbc #$80 7062 274ed endif ; BANKSET_DL_IN_CARTRAM 7063 274ed 9d 00 18 sta DLLMEM,x 7064 274f0 - ifconst DOUBLEBUFFER 7065 274f0 - sta DLLMEM+DBOFFSET,x 7066 274f0 endif ; DOUBLEBUFFER 7067 274f0 e8 inx 7068 274f1 b9 cf f5 lda DLPOINTL,y 7069 274f4 9d 00 18 sta DLLMEM,x 7070 274f7 - ifconst DOUBLEBUFFER 7071 274f7 - clc 7072 274f7 - adc #DOUBLEBUFFEROFFSET 7073 274f7 - sta DLLMEM+DBOFFSET,x 7074 274f7 - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 7075 274f7 - inc DLLMEM+DBOFFSET-1,x 7076 274f7 -skiphidoublebufferadjust 7077 274f7 endif ; DOUBLEBUFFER 7078 274f7 e8 inx 7079 274f8 c8 iny 7080 274f9 c0 0c cpy #WZONECOUNT 7081 274fb d0 e4 bne createvisiblezonesloop 7082 274fd 60 rts 7083 274fe 7084 274fe waitforvblankstart 7085 274fe vblankendwait 7086 274fe 24 28 BIT MSTAT 7087 27500 30 fc bmi vblankendwait 7088 27502 vblankstartwait 7089 27502 24 28 BIT MSTAT 7090 27504 10 fc bpl vblankstartwait 7091 27506 60 rts 7092 27507 7093 27507 - ifconst DOUBLEBUFFER 7094 27507 -flipdisplaybufferreturn 7095 27507 - rts 7096 27507 -flipdisplaybuffer 7097 27507 - ifconst interrupthold 7098 27507 - lda #$FF 7099 27507 - sta interrupthold 7100 27507 - endif 7101 27507 - lda doublebufferstate 7102 27507 - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 7103 27507 - 7104 27507 - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 7105 27507 - 7106 27507 - lda doublebufferstate 7107 27507 - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 7108 27507 - tax 7109 27507 - 7110 27507 - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 7111 27507 - 7112 27507 -flipdisplaybufferwait1 7113 27507 - lda visibleover 7114 27507 - beq flipdisplaybufferwait1 7115 27507 - 7116 27507 -flipdisplaybufferwait 7117 27507 - lda visibleover 7118 27507 - bne flipdisplaybufferwait 7119 27507 - 7120 27507 - lda doublebufferminimumframetarget 7121 27507 - beq skipminimumframecode 7122 27507 - lda doublebufferminimumframeindex 7123 27507 - bne flipdisplaybufferwait1 7124 27507 - lda doublebufferminimumframetarget 7125 27507 - sta doublebufferminimumframeindex 7126 27507 -skipminimumframecode 7127 27507 - 7128 27507 - lda DLLMEMLutHi,x 7129 27507 - sta DPPH 7130 27507 - lda DLLMEMLutLo,x 7131 27507 - sta DPPL 7132 27507 - 7133 27507 - lda NewPageflipstate,x 7134 27507 - sta doublebufferstate 7135 27507 - lda NewPageflipoffset,x 7136 27507 - sta doublebufferdloffset 7137 27507 - 7138 27507 - ifnconst BANKSET_DL_IN_CARTRAM 7139 27507 - lda doublebufferbufferdirty 7140 27507 - beq flipdisplaybufferreturn 7141 27507 - 7142 27507 - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 7143 27507 - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 7144 27507 - ; from the displayed buffer to the working buffer... 7145 27507 - 7146 27507 - lda doublebufferdloffset 7147 27507 - eor #DOUBLEBUFFEROFFSET 7148 27507 - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 7149 27507 - 7150 27507 - ldx #(WZONECOUNT-1) 7151 27507 -copybufferzoneloop 7152 27507 - 7153 27507 - lda DLPOINTL,x 7154 27507 - clc 7155 27507 - adc doublebufferdloffset 7156 27507 - sta temp1 7157 27507 - lda DLPOINTH,x 7158 27507 - adc #0 7159 27507 - sta temp2 7160 27507 - 7161 27507 - lda DLPOINTL,x 7162 27507 - clc 7163 27507 - adc temp6 7164 27507 - sta temp3 7165 27507 - lda DLPOINTH,x 7166 27507 - adc #0 7167 27507 - sta temp4 7168 27507 - 7169 27507 - lda dlendsave,x 7170 27507 - tay 7171 27507 -copybuffercharsloop 7172 27507 - lda (temp3),y 7173 27507 - sta (temp1),y 7174 27507 - dey 7175 27507 - bpl copybuffercharsloop 7176 27507 - dex 7177 27507 - bpl copybufferzoneloop 7178 27507 - lda #0 7179 27507 - sta doublebufferbufferdirty 7180 27507 - endif ; ! BANKSET_DL_IN_CARTRAM 7181 27507 - rts 7182 27507 - 7183 27507 -doublebufferoff 7184 27507 - lda #1 7185 27507 - sta doublebufferstate 7186 27507 - jsr flipdisplaybuffer 7187 27507 - lda #0 7188 27507 - sta doublebufferstate 7189 27507 - sta doublebufferdloffset 7190 27507 - rts 7191 27507 - 7192 27507 -DLLMEMLutLo 7193 27507 - .byte DLLMEM,>(DLLMEM+DBOFFSET) 7196 27507 -NewPageflipstate 7197 27507 - .byte 3,1 7198 27507 -NewPageflipoffset 7199 27507 - .byte DOUBLEBUFFEROFFSET,0 7200 27507 - 7201 27507 endif ; DOUBLEBUFFER 7202 27507 7203 27507 - ifconst MOUSESUPPORT 7204 27507 - 7205 27507 -rotationalcompare 7206 27507 - ; old = 00 01 10 11 7207 27507 - .byte $00, $01, $ff, $00 ; new=00 7208 27507 - .byte $ff, $00, $00, $01 ; new=01 7209 27507 - .byte $01, $00, $00, $ff ; new=10 7210 27507 - .byte $00, $ff, $01, $00 ; new=11 7211 27507 - 7212 27507 - ; 0000YyXx st mouse 7213 27507 - 7214 27507 - ; 0000xyXY amiga mouse 7215 27507 - 7216 27507 - ifconst MOUSEXONLY 7217 27507 -amigatoataribits ; swap bits 1 and 4... 7218 27507 - .byte %0000, %0000, %0010, %0010 7219 27507 - .byte %0000, %0000, %0010, %0010 7220 27507 - .byte %0001, %0001, %0011, %0011 7221 27507 - .byte %0001, %0001, %0011, %0011 7222 27507 - 7223 27507 - ; null change bits 7224 27507 - .byte %0000, %0001, %0010, %0011 7225 27507 - .byte %0000, %0001, %0010, %0011 7226 27507 - .byte %0000, %0001, %0010, %0011 7227 27507 - .byte %0000, %0001, %0010, %0011 7228 27507 - 7229 27507 - else ; !MOUSEXONLY 7230 27507 - 7231 27507 -amigatoataribits ; swap bits 1 and 4... 7232 27507 - .byte %0000, %1000, %0010, %1010 7233 27507 - .byte %0100, %1100, %0110, %1110 7234 27507 - .byte %0001, %1001, %0011, %1011 7235 27507 - .byte %0101, %1101, %0111, %1111 7236 27507 - ; null change bits 7237 27507 - .byte %0000, %0001, %0010, %0011 7238 27507 - .byte %0100, %0101, %0110, %0111 7239 27507 - .byte %1000, %1001, %1010, %1011 7240 27507 - .byte %1100, %1101, %1110, %1111 7241 27507 - endif ; !MOUSEXONLY 7242 27507 - 7243 27507 endif ; MOUSESUPPORT 7244 27507 7245 27507 mouse0update 7246 27507 - ifconst MOUSE0SUPPORT 7247 27507 - 7248 27507 -mousetableselect = inttemp2 7249 27507 -mousexdelta = inttemp3 7250 27507 -mouseydelta = inttemp4 7251 27507 -lastSWCHA = inttemp6 7252 27507 - 7253 27507 - ; 0000YyXx st mouse 7254 27507 - ; 0000xyXY amiga mouse 7255 27507 - 7256 27507 - lda #$ff 7257 27507 - sta lastSWCHA 7258 27507 - 7259 27507 - ldy port0control 7260 27507 - 7261 27507 - lda #%00010000 7262 27507 - cpy #9 ; AMIGA? 7263 27507 - bne skipamigabitsfix0 7264 27507 - lda #0 7265 27507 -skipamigabitsfix0 7266 27507 - sta mousetableselect 7267 27507 - ifconst DRIVINGBOOST 7268 27507 - cpy #6 ; DRIVING? 7269 27507 - bne skipdriving0setup 7270 27507 - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 7271 27507 - ; trails the actual mousex0, so we can smoothly interpolate toward 7272 27507 - ; the actual position. This actual position is stored in mousey0 7273 27507 - ; after the driver has run. 7274 27507 - ldx mousex0 7275 27507 - lda mousey0 7276 27507 - stx mousey0 7277 27507 - sta mousex0 7278 27507 -skipdriving0setup 7279 27507 - endif ; DRIVINGBOOST 7280 27507 - 7281 27507 - lda #0 7282 27507 - sta mousexdelta 7283 27507 - sta mouseydelta 7284 27507 - 7285 27507 - ifnconst MOUSETIME 7286 27507 - ifnconst MOUSEXONLY 7287 27507 - lda #180 ; minimum for x+y 7288 27507 - else 7289 27507 - lda #100 ; minimum for just x 7290 27507 - endif 7291 27507 - else 7292 27507 - lda #MOUSETIME 7293 27507 - endif 7294 27507 - jsr SETTIM64T ; INTIM is in Y 7295 27507 - 7296 27507 -mouse0updateloop 7297 27507 - lda SWCHA 7298 27507 - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 7299 27507 - cmp lastSWCHA 7300 27507 - beq mouse0loopcondition 7301 27507 - sta lastSWCHA 7302 27507 - lsr 7303 27507 - lsr 7304 27507 - lsr 7305 27507 - 7306 27507 - ora mousetableselect ; atari/amiga decoding table selection 7307 27507 - 7308 27507 - ; st mice encode on different bits/joystick-lines than amiga mice... 7309 27507 - ; 0000YyXx st mouse 7310 27507 - ; 0000xyXY amiga mouse 7311 27507 - ; ...so can shuffle the amiga bits to reuse the st driver. 7312 27507 - tay 7313 27507 - lax amigatoataribits,y 7314 27507 - 7315 27507 - ifnconst MOUSEXONLY 7316 27507 - ; first the Y... 7317 27507 - and #%00001100 7318 27507 - ora mousecodey0 7319 27507 - tay 7320 27507 - lda rotationalcompare,y 7321 27507 - clc 7322 27507 - adc mouseydelta 7323 27507 - sta mouseydelta 7324 27507 - tya 7325 27507 - lsr 7326 27507 - lsr 7327 27507 - sta mousecodey0 7328 27507 - txa 7329 27507 - ; ...then the X... 7330 27507 - and #%00000011 7331 27507 - tax 7332 27507 - endif ; !MOUSEXONLY 7333 27507 - 7334 27507 - asl 7335 27507 - asl 7336 27507 - ora mousecodex0 7337 27507 - tay 7338 27507 - lda rotationalcompare,y 7339 27507 - adc mousexdelta ; carry was clear by previous ASL 7340 27507 - sta mousexdelta 7341 27507 - stx mousecodex0 7342 27507 -mouse0loopcondition 7343 27507 - lda TIMINT 7344 27507 - bpl mouse0updateloop 7345 27507 - 7346 27507 - ; *** adapt to selected device resolution. 7347 27507 - ldx port0control 7348 27507 - 7349 27507 - ifconst PRECISIONMOUSING 7350 27507 - ldy port0resolution 7351 27507 - bne mouse0halveddone 7352 27507 - cpx #6 ; half-resolution is no good for driving wheels 7353 27507 - beq mouse0halveddone 7354 27507 - ; resolution=0 is half mouse resolution, necessary for precision 7355 27507 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7356 27507 - 7357 27507 - lda mousexdelta 7358 27507 - cmp #$80 7359 27507 - ror ; do a signed divide by 2. 7360 27507 - clc 7361 27507 - adc mousex0 7362 27507 - sta mousex0 7363 27507 - ifnconst MOUSEXONLY 7364 27507 - lda mouseydelta 7365 27507 - clc 7366 27507 - adc mousey0 7367 27507 - sta mousey0 7368 27507 - endif 7369 27507 - ; at half resolution we just exit after updating x and y 7370 27507 - jmp LLRET0 7371 27507 -mouse0halveddone 7372 27507 - endif ; PRECISIONMOUSING 7373 27507 - 7374 27507 - ifnconst MOUSEXONLY 7375 27507 - asl mouseydelta ; *2 because Y resolution is finer 7376 27507 - ldy port0resolution 7377 27507 - dey 7378 27507 - lda #0 7379 27507 -mousey0resolutionfix 7380 27507 - clc 7381 27507 - adc mouseydelta 7382 27507 - dey 7383 27507 - bpl mousey0resolutionfix 7384 27507 - clc 7385 27507 - adc mousey0 7386 27507 - sta mousey0 7387 27507 - endif ; MOUSEXONLY 7388 27507 - 7389 27507 - ldy port0resolution 7390 27507 - dey 7391 27507 - lda #0 7392 27507 -mousex0resolutionfix 7393 27507 - clc 7394 27507 - adc mousexdelta 7395 27507 - dey 7396 27507 - bpl mousex0resolutionfix 7397 27507 - ifnconst DRIVINGBOOST 7398 27507 - clc 7399 27507 - adc mousex0 7400 27507 - sta mousex0 7401 27507 - else 7402 27507 - cpx #6 7403 27507 - beq carryonmouse0boost 7404 27507 - clc 7405 27507 - adc mousex0 7406 27507 - sta mousex0 7407 27507 - jmp LLRET0 7408 27507 -carryonmouse0boost 7409 27507 - sta mousexdelta 7410 27507 - clc 7411 27507 - adc mousecodey0 7412 27507 - sta mousecodey0 7413 27507 - clc 7414 27507 - adc mousex0 7415 27507 - tay ; save the target X 7416 27507 - adc mousey0 ; average in the smoothly-trailing X 7417 27507 - ror 7418 27507 - sta mousex0 ; mousex0 now has the smoothly trailing X 7419 27507 - sty mousey0 ; and mousey0 has the the target X 7420 27507 - 7421 27507 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7422 27507 - ; A has mousex0, the smoothly trailing X 7423 27507 - sbc mousey0 ; less the target X 7424 27507 - bpl skipabsolutedrive0 7425 27507 - eor #$ff 7426 27507 -skipabsolutedrive0 7427 27507 - cmp #64 ; just an unreasonably large change 7428 27507 - bcc skipdrivewrapfix0 7429 27507 - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 7430 27507 -skipdrivewrapfix0 7431 27507 - 7432 27507 - ; get rid of the tweening if the distance travelled was very small 7433 27507 - lda mousexdelta 7434 27507 - cmp port0resolution 7435 27507 - bcs skipbetweenfix0 7436 27507 - lda mousex0 7437 27507 - sta mousey0 7438 27507 -skipbetweenfix0 7439 27507 - 7440 27507 -drivingboostreductioncheck0 7441 27507 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7442 27507 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7443 27507 - ; negated again because truncation during BCD math results in 7444 27507 - ; differing magnitudes, depending if the value is +ve or -ve. 7445 27507 -driving0fix 7446 27507 - lax mousecodey0 7447 27507 - cmp #$80 7448 27507 - bcs driving0skipnegate1 7449 27507 - eor #$FF 7450 27507 - adc #1 7451 27507 - sta mousecodey0 7452 27507 -driving0skipnegate1 7453 27507 - cmp #$80 7454 27507 - ror 7455 27507 - cmp #$80 7456 27507 - ror 7457 27507 - cmp #$80 7458 27507 - ror 7459 27507 - sta inttemp1 7460 27507 - lda mousecodey0 7461 27507 - sec 7462 27507 - sbc inttemp1 7463 27507 - cpx #$80 7464 27507 - bcs driving0skipnegate2 7465 27507 - eor #$FF 7466 27507 - adc #1 7467 27507 -driving0skipnegate2 7468 27507 - sta mousecodey0 7469 27507 -drivingboostdone0 7470 27507 - endif ; DRIVINGBOOST 7471 27507 - 7472 27507 - jmp LLRET0 7473 27507 - 7474 27507 endif ; MOUSE0SUPPORT 7475 27507 7476 27507 mouse1update 7477 27507 - ifconst MOUSE1SUPPORT 7478 27507 - 7479 27507 -mousetableselect = inttemp2 7480 27507 -mousexdelta = inttemp3 7481 27507 -mouseydelta = inttemp4 7482 27507 -lastSWCHA = inttemp6 7483 27507 - 7484 27507 - ; 0000YyXx st mouse 7485 27507 - ; 0000xyXY amiga mouse 7486 27507 - 7487 27507 - lda #$ff 7488 27507 - sta lastSWCHA 7489 27507 - 7490 27507 - ldy port1control 7491 27507 - 7492 27507 - lda #%00010000 7493 27507 - cpy #9 ; AMIGA? 7494 27507 - bne skipamigabitsfix1 7495 27507 - lda #0 7496 27507 -skipamigabitsfix1 7497 27507 - sta mousetableselect 7498 27507 - ifconst DRIVINGBOOST 7499 27507 - cpy #6 ; DRIVING? 7500 27507 - bne skipdriving1setup 7501 27507 - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 7502 27507 - ; trails the actual mousex1, so we can smoothly interpolate toward 7503 27507 - ; the actual position. This actual position is stored in mousey1 7504 27507 - ; after the driver has run. 7505 27507 - ldx mousex1 7506 27507 - lda mousey1 7507 27507 - stx mousey1 7508 27507 - sta mousex1 7509 27507 -skipdriving1setup 7510 27507 - endif ; DRIVINGBOOST 7511 27507 - 7512 27507 - lda #0 7513 27507 - sta mousexdelta 7514 27507 - sta mouseydelta 7515 27507 - 7516 27507 - ifnconst MOUSETIME 7517 27507 - ifnconst MOUSEXONLY 7518 27507 - lda #180 ; minimum for x+y 7519 27507 - else 7520 27507 - lda #100 ; minimum for just x 7521 27507 - endif 7522 27507 - else 7523 27507 - lda #MOUSETIME 7524 27507 - endif 7525 27507 - jsr SETTIM64T ; INTIM is in Y 7526 27507 - 7527 27507 -mouse1updateloop 7528 27507 - lda SWCHA 7529 27507 - and #%00001111 7530 27507 - cmp lastSWCHA 7531 27507 - beq mouse1loopcondition 7532 27507 - sta lastSWCHA 7533 27507 - 7534 27507 - ora mousetableselect ; atari/amiga decoding table selection 7535 27507 - 7536 27507 - ; st mice encode on different bits/joystick-lines than amiga mice... 7537 27507 - ; 0000YyXx st mouse 7538 27507 - ; 0000xyXY amiga mouse 7539 27507 - ; ...so can shuffle the amiga bits to reuse the st driver. 7540 27507 - tay 7541 27507 - lax amigatoataribits,y 7542 27507 - 7543 27507 - ifnconst MOUSEXONLY 7544 27507 - ; first the Y... 7545 27507 - and #%00001100 7546 27507 - ora mousecodey1 7547 27507 - tay 7548 27507 - lda rotationalcompare,y 7549 27507 - clc 7550 27507 - adc mouseydelta 7551 27507 - sta mouseydelta 7552 27507 - tya 7553 27507 - lsr 7554 27507 - lsr 7555 27507 - sta mousecodey1 7556 27507 - txa 7557 27507 - ; ...then the X... 7558 27507 - and #%00000011 7559 27507 - tax 7560 27507 - endif ; !MOUSEXONLY 7561 27507 - 7562 27507 - asl 7563 27507 - asl 7564 27507 - ora mousecodex1 7565 27507 - tay 7566 27507 - lda rotationalcompare,y 7567 27507 - adc mousexdelta ; carry was clear by previous ASL 7568 27507 - sta mousexdelta 7569 27507 - stx mousecodex1 7570 27507 -mouse1loopcondition 7571 27507 - lda TIMINT 7572 27507 - bpl mouse1updateloop 7573 27507 - 7574 27507 - ; *** adapt to selected device resolution. 7575 27507 - ldx port1control 7576 27507 - 7577 27507 - ifconst PRECISIONMOUSING 7578 27507 - ldy port1resolution 7579 27507 - bne mouse1halveddone 7580 27507 - cpx #6 ; half-resolution is no good for driving wheels 7581 27507 - beq mouse1halveddone 7582 27507 - ; resolution=0 is half mouse resolution, necessary for precision 7583 27507 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7584 27507 - 7585 27507 - lda mousexdelta 7586 27507 - cmp #$80 7587 27507 - ror ; do a signed divide by 2. 7588 27507 - clc 7589 27507 - adc mousex1 7590 27507 - sta mousex1 7591 27507 - ifnconst MOUSEXONLY 7592 27507 - lda mouseydelta 7593 27507 - clc 7594 27507 - adc mousey1 7595 27507 - sta mousey1 7596 27507 - endif 7597 27507 - ; at half resolution we just exit after updating x and y 7598 27507 - jmp LLRET1 7599 27507 -mouse1halveddone 7600 27507 - endif ; PRECISIONMOUSING 7601 27507 - 7602 27507 - ifnconst MOUSEXONLY 7603 27507 - asl mouseydelta ; *2 because Y resolution is finer 7604 27507 - ldy port1resolution 7605 27507 - dey 7606 27507 - lda #0 7607 27507 -mousey1resolutionfix 7608 27507 - clc 7609 27507 - adc mouseydelta 7610 27507 - dey 7611 27507 - bpl mousey1resolutionfix 7612 27507 - clc 7613 27507 - adc mousey1 7614 27507 - sta mousey1 7615 27507 - endif ; MOUSEXONLY 7616 27507 - 7617 27507 - ldy port1resolution 7618 27507 - dey 7619 27507 - lda #0 7620 27507 -mousex1resolutionfix 7621 27507 - clc 7622 27507 - adc mousexdelta 7623 27507 - dey 7624 27507 - bpl mousex1resolutionfix 7625 27507 - ifnconst DRIVINGBOOST 7626 27507 - clc 7627 27507 - adc mousex1 7628 27507 - sta mousex1 7629 27507 - else 7630 27507 - cpx #6 7631 27507 - beq carryonmouse1boost 7632 27507 - clc 7633 27507 - adc mousex1 7634 27507 - sta mousex1 7635 27507 - jmp LLRET1 7636 27507 -carryonmouse1boost 7637 27507 - sta mousexdelta 7638 27507 - clc 7639 27507 - adc mousecodey1 7640 27507 - sta mousecodey1 7641 27507 - clc 7642 27507 - adc mousex1 7643 27507 - tay ; save the target X 7644 27507 - adc mousey1 ; average in the smoothly-trailing X 7645 27507 - ror 7646 27507 - sta mousex1 ; mousex0 now has the smoothly trailing X 7647 27507 - sty mousey1 ; and mousey0 has the the target X 7648 27507 - 7649 27507 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7650 27507 - ; A has mousex1, the smoothly trailing X 7651 27507 - sbc mousey1 ; less the target X 7652 27507 - bpl skipabsolutedrive1 7653 27507 - eor #$ff 7654 27507 -skipabsolutedrive1 7655 27507 - cmp #64 ; just an unreasonably large change 7656 27507 - bcc skipdrivewrapfix1 7657 27507 - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 7658 27507 -skipdrivewrapfix1 7659 27507 - 7660 27507 - ; get rid of the tweening if the distance travelled was very small 7661 27507 - lda mousexdelta 7662 27507 - cmp port1resolution 7663 27507 - bcs skipbetweenfix1 7664 27507 - lda mousex1 7665 27507 - sta mousey1 7666 27507 -skipbetweenfix1 7667 27507 - 7668 27507 -drivingboostreductioncheck1 7669 27507 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7670 27507 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7671 27507 - ; negated again because truncation during BCD math results in 7672 27507 - ; differing magnitudes, depending if the value is +ve or -ve. 7673 27507 -driving1fix 7674 27507 - lax mousecodey1 7675 27507 - cmp #$80 7676 27507 - bcs driving0skipnegate1 7677 27507 - eor #$FF 7678 27507 - adc #1 7679 27507 - sta mousecodey1 7680 27507 -driving0skipnegate1 7681 27507 - cmp #$80 7682 27507 - ror 7683 27507 - cmp #$80 7684 27507 - ror 7685 27507 - cmp #$80 7686 27507 - ror 7687 27507 - sta inttemp1 7688 27507 - lda mousecodey1 7689 27507 - sec 7690 27507 - sbc inttemp1 7691 27507 - cpx #$80 7692 27507 - bcs driving1skipnegate2 7693 27507 - eor #$FF 7694 27507 - adc #1 7695 27507 -driving1skipnegate2 7696 27507 - sta mousecodey1 7697 27507 -drivingboostdone1 7698 27507 - endif ; DRIVINGBOOST 7699 27507 - 7700 27507 - jmp LLRET1 7701 27507 - 7702 27507 endif ; MOUSE1SUPPORT 7703 27507 7704 27507 7705 27507 trakball0update 7706 27507 - ifconst TRAKBALL0SUPPORT 7707 27507 - ifnconst TRAKTIME 7708 27507 - ifnconst TRAKXONLY 7709 27507 - lda #180 ; minimum for x+y 7710 27507 - else ; !TRAKXONLY 7711 27507 - lda #100 ; minimum for just x 7712 27507 - endif ; !TRAKXONLY 7713 27507 - else ; !TRAKTIME 7714 27507 - lda #TRAKTIME 7715 27507 - endif ; !TRAKTIME 7716 27507 - jsr SETTIM64T ; INTIM is in Y 7717 27507 - ldx #0 7718 27507 - ifnconst TRAKXONLY 7719 27507 - ldy #0 7720 27507 - endif ; TRAKXONLY 7721 27507 -trakball0updateloop 7722 27507 - lda SWCHA 7723 27507 - and #%00110000 7724 27507 - cmp trakballcodex0 7725 27507 - sta trakballcodex0 7726 27507 - beq trakball0movementXdone 7727 27507 - and #%00010000 7728 27507 - beq trakball0negativeX 7729 27507 -trakball0positiveX 7730 27507 - ;(2 from beq) 7731 27507 - inx ; 2 7732 27507 - jmp trakball0movementXdone ; 3 7733 27507 -trakball0negativeX 7734 27507 - ;(3 from beq) 7735 27507 - dex ; 2 7736 27507 - nop ; 2 7737 27507 -trakball0movementXdone 7738 27507 - 7739 27507 - ifnconst TRAKXONLY 7740 27507 - lda SWCHA 7741 27507 - and #%11000000 7742 27507 - cmp trakballcodey0 7743 27507 - sta trakballcodey0 7744 27507 - beq trakball0movementYdone 7745 27507 - and #%01000000 7746 27507 - beq trakball0negativeY 7747 27507 -trakball0positiveY 7748 27507 - ;(2 from beq) 7749 27507 - iny ; 2 7750 27507 - jmp trakball0movementYdone ; 3 7751 27507 -trakball0negativeY 7752 27507 - ;(3 from beq) 7753 27507 - dey ; 2 7754 27507 - nop ; 2 7755 27507 -trakball0movementYdone 7756 27507 - endif ; !TRAKXONLY 7757 27507 - 7758 27507 - lda TIMINT 7759 27507 - bpl trakball0updateloop 7760 27507 - lda #0 7761 27507 - cpx #0 7762 27507 - beq trakball0skipXadjust 7763 27507 - clc 7764 27507 -trakball0Xloop 7765 27507 - adc port0resolution 7766 27507 - dex 7767 27507 - bne trakball0Xloop 7768 27507 - clc 7769 27507 - adc trakballx0 7770 27507 - sta trakballx0 7771 27507 -trakball0skipXadjust 7772 27507 - ifnconst TRAKXONLY 7773 27507 - lda #0 7774 27507 - cpy #0 7775 27507 - beq trakball0skipYadjust 7776 27507 - clc 7777 27507 -trakball0yloop 7778 27507 - adc port0resolution 7779 27507 - dey 7780 27507 - bne trakball0yloop 7781 27507 - clc 7782 27507 - adc trakbally0 7783 27507 - sta trakbally0 7784 27507 -trakball0skipYadjust 7785 27507 - endif ; !TRAKXONLY 7786 27507 - 7787 27507 - jmp LLRET0 7788 27507 endif 7789 27507 7790 27507 7791 27507 7792 27507 trakball1update 7793 27507 - ifconst TRAKBALL1SUPPORT 7794 27507 - ifnconst TRAKTIME 7795 27507 - ifnconst TRAKXONLY 7796 27507 - lda #180 ; minimum for x+y 7797 27507 - else ; !TRAKXONLY 7798 27507 - lda #100 ; minimum for just x 7799 27507 - endif ; !TRAKXONLY 7800 27507 - else ; !TRAKTIME 7801 27507 - lda #TRAKTIME 7802 27507 - endif ; !TRAKTIME 7803 27507 - jsr SETTIM64T ; INTIM is in Y 7804 27507 - ldx #0 7805 27507 - ifnconst TRAKXONLY 7806 27507 - ldy #0 7807 27507 - endif ; TRAKXONLY 7808 27507 -trakball1updateloop 7809 27507 - lda SWCHA 7810 27507 - and #%00000011 7811 27507 - cmp trakballcodex1 7812 27507 - sta trakballcodex1 7813 27507 - beq trakball1movementXdone 7814 27507 - and #%00000001 7815 27507 - beq trakball1negativeX 7816 27507 -trakball1positiveX 7817 27507 - ;(2 from beq) 7818 27507 - inx ; 2 7819 27507 - jmp trakball1movementXdone ; 3 7820 27507 -trakball1negativeX 7821 27507 - ;(3 from beq) 7822 27507 - dex ; 2 7823 27507 - nop ; 2 7824 27507 -trakball1movementXdone 7825 27507 - 7826 27507 - ifnconst TRAKXONLY 7827 27507 - lda SWCHA 7828 27507 - and #%00001100 7829 27507 - cmp trakballcodey1 7830 27507 - sta trakballcodey1 7831 27507 - beq trakball1movementYdone 7832 27507 - and #%00000100 7833 27507 - beq trakball1negativeY 7834 27507 -trakball1positiveY 7835 27507 - ;(2 from beq) 7836 27507 - iny ; 2 7837 27507 - jmp trakball1movementYdone ; 3 7838 27507 -trakball1negativeY 7839 27507 - ;(3 from beq) 7840 27507 - dey ; 2 7841 27507 - nop ; 2 7842 27507 -trakball1movementYdone 7843 27507 - endif ; !TRAKXONLY 7844 27507 - 7845 27507 - lda TIMINT 7846 27507 - bpl trakball1updateloop 7847 27507 - lda #0 7848 27507 - cpx #0 7849 27507 - beq trakball1skipXadjust 7850 27507 - clc 7851 27507 -trakball1Xloop 7852 27507 - adc port1resolution 7853 27507 - dex 7854 27507 - bne trakball1Xloop 7855 27507 - clc 7856 27507 - adc trakballx1 7857 27507 - sta trakballx1 7858 27507 -trakball1skipXadjust 7859 27507 - ifnconst TRAKXONLY 7860 27507 - lda #0 7861 27507 - cpy #0 7862 27507 - beq trakball1skipYadjust 7863 27507 - clc 7864 27507 -trakball1yloop 7865 27507 - adc port1resolution 7866 27507 - dey 7867 27507 - bne trakball1yloop 7868 27507 - clc 7869 27507 - adc trakbally1 7870 27507 - sta trakbally1 7871 27507 -trakball1skipYadjust 7872 27507 - endif ; !TRAKXONLY 7873 27507 - 7874 27507 - jmp LLRET1 7875 27507 endif 7876 27507 7877 27507 7878 27507 paddleport0update 7879 27507 - ifconst PADDLE0SUPPORT 7880 27507 - lda #6 7881 27507 - sta VBLANK ; start charging the paddle caps 7882 27507 - lda #0 ; use PADDLE timing 7883 27507 - jsr SETTIM64T ; INTIM is in Y 7884 27507 - 7885 27507 -paddleport0updateloop 7886 27507 - lda INPT0 7887 27507 - bmi skippaddle0setposition 7888 27507 - sty paddleposition0 7889 27507 -skippaddle0setposition 7890 27507 - ifconst TWOPADDLESUPPORT 7891 27507 - lda INPT1 7892 27507 - bmi skippaddle1setposition 7893 27507 - sty paddleposition1 7894 27507 -skippaddle1setposition 7895 27507 - endif 7896 27507 - ldy INTIM 7897 27507 - cpy #TIMEOFFSET 7898 27507 - bcs paddleport0updateloop 7899 27507 - 7900 27507 - lda #%10000110 7901 27507 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 7902 27507 - sec 7903 27507 - lda paddleposition0 7904 27507 - sbc #TIMEOFFSET 7905 27507 - ifconst PADDLESCALEX2 7906 27507 - asl 7907 27507 - endif 7908 27507 - 7909 27507 - ifnconst PADDLESMOOTHINGOFF 7910 27507 - clc 7911 27507 - adc paddleprevious0 7912 27507 - ror 7913 27507 - sta paddleprevious0 7914 27507 - endif 7915 27507 - 7916 27507 - sta paddleposition0 7917 27507 - 7918 27507 - ifconst TWOPADDLESUPPORT 7919 27507 - sec 7920 27507 - lda paddleposition1 7921 27507 - sbc #TIMEOFFSET 7922 27507 - ifconst PADDLESCALEX2 7923 27507 - asl 7924 27507 - endif 7925 27507 - 7926 27507 - ifnconst PADDLESMOOTHINGOFF 7927 27507 - clc 7928 27507 - adc paddleprevious1 7929 27507 - ror 7930 27507 - sta paddleprevious1 7931 27507 - endif 7932 27507 - sta paddleposition1 7933 27507 - endif ; TWOPADDLESUPPORT 7934 27507 - 7935 27507 - jmp LLRET0 7936 27507 endif 7937 27507 7938 27507 paddleport1update 7939 27507 - ifconst PADDLE1SUPPORT 7940 27507 - lda #6 7941 27507 - sta VBLANK ; start charging the paddle caps 7942 27507 - 7943 27507 - lda #0 ; use PADDLE timing 7944 27507 - jsr SETTIM64T ; INTIM is in Y 7945 27507 - 7946 27507 -paddleport1updateloop 7947 27507 - lda INPT2 7948 27507 - bmi skippaddle2setposition 7949 27507 - sty paddleposition2 7950 27507 -skippaddle2setposition 7951 27507 - ifconst TWOPADDLESUPPORT 7952 27507 - lda INPT3 7953 27507 - bmi skippaddle3setposition 7954 27507 - sty paddleposition3 7955 27507 -skippaddle3setposition 7956 27507 - endif 7957 27507 - ldy INTIM 7958 27507 - cpy #TIMEOFFSET 7959 27507 - bcs paddleport1updateloop 7960 27507 - 7961 27507 - lda #%10000110 7962 27507 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 7963 27507 - sec 7964 27507 - lda paddleposition2 7965 27507 - sbc #TIMEOFFSET 7966 27507 - ifconst PADDLESCALEX2 7967 27507 - asl 7968 27507 - endif 7969 27507 - 7970 27507 - ifnconst PADDLESMOOTHINGOFF 7971 27507 - clc 7972 27507 - adc paddleprevious2 7973 27507 - ror 7974 27507 - sta paddleprevious2 7975 27507 - endif 7976 27507 - 7977 27507 - sta paddleposition2 7978 27507 - 7979 27507 - ifconst TWOPADDLESUPPORT 7980 27507 - sec 7981 27507 - lda paddleposition3 7982 27507 - sbc #TIMEOFFSET 7983 27507 - ifconst PADDLESCALEX2 7984 27507 - asl 7985 27507 - endif 7986 27507 - 7987 27507 - ifnconst PADDLESMOOTHINGOFF 7988 27507 - clc 7989 27507 - adc paddleprevious3 7990 27507 - ror 7991 27507 - sta paddleprevious3 7992 27507 - endif 7993 27507 - sta paddleposition3 7994 27507 - endif ; TWOPADDLESUPPORT 7995 27507 - 7996 27507 - jmp LLRET1 7997 27507 endif 7998 27507 7999 27507 8000 27507 paddlebuttonhandler ; outside of conditional, for button-handler LUT 8001 27507 - ifconst PADDLESUPPORT 8002 27507 - ; x=0|1 for port, rather than paddle #. 8003 27507 - ; Only the first paddle button will integrate into "joy0fire" testing. If the 8004 27507 - ; game wants to support 2 paddles, up to the game to instead test the 8005 27507 - ; joystick right+left directions instead. 8006 27507 - lda SWCHA ; top of nibble is first paddle button 8007 27507 - cpx #0 ; port 0? 8008 27507 - beq skippaddleport2shift 8009 27507 - asl ; shift second port to upper nibble 8010 27507 - asl 8011 27507 - asl 8012 27507 - asl 8013 27507 -skippaddleport2shift 8014 27507 - and #%10000000 8015 27507 - eor #%10000000 ; invert 8016 27507 - sta sINPT1,x 8017 27507 - jmp buttonreadloopreturn 8018 27507 endif ; PADDLESUPPORT 8019 27507 8020 27507 mousebuttonhandler ; outside of conditional, for button-handler LUT 8021 27507 - ifconst MOUSESUPPORT 8022 27507 - ; stick the mouse buttons in the correct shadow register... 8023 27507 - txa 8024 27507 - asl 8025 27507 - tay ; y=x*2 8026 27507 - lda INPT4,x 8027 27507 - eor #%10000000 8028 27507 - lsr 8029 27507 - sta sINPT1,x 8030 27507 - 8031 27507 - lda INPT1,y 8032 27507 - and #%10000000 8033 27507 - eor #%10000000 8034 27507 - ora sINPT1,x 8035 27507 - sta sINPT1,x 8036 27507 - jmp buttonreadloopreturn 8037 27507 endif ; MOUSESUPPORT 8038 27507 8039 27507 - ifconst KEYPADSUPPORT 8040 27507 - ; ** select keypad rows 0 to 3 over 4 frames... 8041 27507 -keypadrowselect 8042 27507 - inc keypadcounter 8043 27507 - ldy #0 8044 27507 - lda port0control 8045 27507 - cmp #7 8046 27507 - bne skipport0val 8047 27507 - iny ; y=y+1 8048 27507 -skipport0val 8049 27507 - lda port1control 8050 27507 - cmp #7 8051 27507 - bne skipport1val 8052 27507 - iny 8053 27507 - iny ; y=y+2 8054 27507 -skipport1val 8055 27507 - cpy #0 8056 27507 - beq exitkeypadrowselect 8057 27507 - lda keyrowdirectionmask,y 8058 27507 - sta CTLSWA 8059 27507 - tya 8060 27507 - asl 8061 27507 - asl 8062 27507 - sta inttemp1 8063 27507 - lda keypadcounter 8064 27507 - and #3 8065 27507 - ora inttemp1 8066 27507 - tax 8067 27507 - lda keyrowselectvalue,x 8068 27507 - sta SWCHA 8069 27507 -exitkeypadrowselect 8070 27507 - rts 8071 27507 - 8072 27507 -keyrowdirectionmask 8073 27507 - .byte #%00000000 ; 0 : port0=input port1=input 8074 27507 - .byte #%11110000 ; 1 : port0=output port1=input 8075 27507 - .byte #%00001111 ; 2 : port0=input port1=output 8076 27507 - .byte #%11111111 ; 3 : port0=output port1=output 8077 27507 - 8078 27507 -keyrowselectvalue 8079 27507 - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 8080 27507 - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 8081 27507 - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 8082 27507 - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 8083 27507 endif ; KEYPADSUPPORT 8084 27507 8085 27507 - ifconst KEYPADSUPPORT 8086 27507 - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 8087 27507 -keypadcolumnread 8088 27507 - lda port0control 8089 27507 - cmp #7 8090 27507 - bne skipkeypadcolumnread0 8091 27507 - lda keypadcounter 8092 27507 - and #3 8093 27507 - asl ; x2 because keypad variables are interleaved 8094 27507 - tax 8095 27507 - lda #0 8096 27507 - sta keypadmatrix0a,x 8097 27507 - lda INPT0 8098 27507 - cmp #$80 8099 27507 - rol keypadmatrix0a,x 8100 27507 - lda INPT1 8101 27507 - cmp #$80 8102 27507 - rol keypadmatrix0a,x 8103 27507 - lda INPT4 8104 27507 - cmp #$80 8105 27507 - rol keypadmatrix0a,x 8106 27507 - lda keypadmatrix0a,x 8107 27507 - eor #%00000111 8108 27507 - sta keypadmatrix0a,x 8109 27507 -skipkeypadcolumnread0 8110 27507 - 8111 27507 - lda port1control 8112 27507 - cmp #7 8113 27507 - bne skipkeypadcolumnread1 8114 27507 - lda keypadcounter 8115 27507 - and #3 8116 27507 - asl ; x2 because keypad variables are interleaved 8117 27507 - tax 8118 27507 - lda #0 8119 27507 - sta keypadmatrix1a,x 8120 27507 - rol keypadmatrix1a,x 8121 27507 - lda INPT2 8122 27507 - cmp #$80 8123 27507 - rol keypadmatrix1a,x 8124 27507 - lda INPT3 8125 27507 - cmp #$80 8126 27507 - rol keypadmatrix1a,x 8127 27507 - lda INPT5 8128 27507 - cmp #$80 8129 27507 - rol keypadmatrix1a,x 8130 27507 - lda keypadmatrix1a,x 8131 27507 - eor #%00000111 8132 27507 - sta keypadmatrix1a,x 8133 27507 -skipkeypadcolumnread1 8134 27507 - rts 8135 27507 endif ; KEYPADSUPPORT 8136 27507 8137 27507 setportforinput 8138 27507 a5 e4 lda CTLSWAs 8139 27509 3d 12 f5 and allpinsinputlut,x 8140 2750c 85 e4 sta CTLSWAs 8141 2750e 8d 81 02 sta CTLSWA 8142 27511 60 rts 8143 27512 8144 27512 allpinsinputlut 8145 27512 0f f0 .byte.b $0F, $F0 8146 27514 8147 27514 setonebuttonmode 8148 27514 a9 06 lda #6 ; in case we're in unlocked-bios mode 8149 27516 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8150 27518 a9 14 lda #$14 8151 2751a 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8152 2751d a5 e5 lda CTLSWBs 8153 2751f 1d 28 f5 ora thisjoy2buttonbit,x 8154 27522 85 e5 sta CTLSWBs 8155 27524 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 8156 27527 60 rts 8157 27528 8158 27528 thisjoy2buttonbit 8159 27528 04 10 .byte.b $04, $10 8160 2752a 8161 2752a settwobuttonmode 8162 2752a a9 06 lda #6 ; in case we're in unlocked-bios mode 8163 2752c 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8164 2752e a9 14 lda #$14 8165 27530 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8166 27533 a5 e5 lda CTLSWBs 8167 27535 3d 3e f5 and thisjoy2buttonmask,x 8168 27538 85 e5 sta CTLSWBs 8169 2753a 8d 82 02 sta SWCHB 8170 2753d 60 rts 8171 2753e 8172 2753e thisjoy2buttonmask 8173 2753e fb ef .byte.b $fb, $ef 8174 27540 8175 27540 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8176 27540 8177 27540 START 8178 27540 start 8179 27540 8180 27540 ;******** more or less the Atari recommended startup procedure 8181 27540 8182 27540 78 sei 8183 27541 d8 cld 8184 27542 8185 27542 ifnconst NOTIALOCK 8186 27542 a9 07 lda #$07 8187 27544 - else 8188 27544 - lda #$06 8189 27544 endif 8190 27544 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 8191 27546 a9 7f lda #$7F 8192 27548 85 3c sta CTRL ;disable DMA 8193 2754a a9 00 lda #$00 8194 2754c 85 38 sta OFFSET 8195 2754e ifnconst NOTIALOCK 8196 2754e 85 01 sta INPTCTRL 8197 27550 85 20 sta BACKGRND ; black default, in case a flash cart is using something else 8198 27552 endif 8199 27552 a2 ff ldx #$FF 8200 27554 9a txs 8201 27555 8202 27555 ;************** Clear Memory 8203 27555 8204 27555 ; ** Clear 1800-27FF, pg0+pg1 memory. 8205 27555 ClearMemPages 8206 27555 a9 00 lda #0 8207 27557 a8 tay ; y=0 8208 27558 85 80 sta $80 8209 2755a a2 18 ldx #$18 8210 2755c ClearMemPagesLoop 8211 2755c 86 81 stx $81 ; needed for when we step on ZP memory 8212 2755e 91 80 sta ($80),y ;Store data 8213 27560 c8 iny ;Next byte 8214 27561 d0 f9 bne ClearMemPagesLoop 8215 27563 e8 inx 8216 27564 e0 28 cpx #$28 8217 27566 d0 f4 bne ClearMemPagesLoop 8218 27568 85 81 sta $81 8219 2756a 8220 2756a ;seed random number with hopefully-random timer value 8221 2756a a9 01 lda #1 8222 2756c 0d 84 02 ora INTIM 8223 2756f 85 40 sta rand 8224 27571 8225 27571 ; detect the console type... 8226 27571 pndetectvblankstart 8227 27571 a5 28 lda MSTAT 8228 27573 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 8229 27575 pndetectvblankover 8230 27575 a5 28 lda MSTAT 8231 27577 30 fc bmi pndetectvblankover ; then wait for it to be over 8232 27579 a0 00 ldy #$00 8233 2757b a2 00 ldx #$00 8234 2757d pndetectvblankhappening 8235 2757d a5 28 lda MSTAT 8236 2757f 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 8237 27581 85 24 sta WSYNC 8238 27583 85 24 sta WSYNC 8239 27585 e8 inx 8240 27586 d0 f5 bne pndetectvblankhappening 8241 27588 pndetectinvblank 8242 27588 e0 7d cpx #125 8243 2758a 90 02 bcc pndetecispal 8244 2758c a0 01 ldy #$01 8245 2758e pndetecispal 8246 2758e 8c 09 21 sty paldetected 8247 27591 8248 27591 20 6d f4 jsr createallgamedlls 8249 27594 8250 27594 a9 18 lda #>DLLMEM 8251 27596 85 2c sta DPPH 8252 27598 a9 00 lda # 255 8437 275c3 -DOUBLEBUFFEROFFSET = 255 8438 275c3 else 8439 275c3 00 f2 DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 8440 275c3 endif 8441 275c3 8442 275c3 ifconst EXTRADLMEMORY 8443 275c3 SECONDDLHALFSTART SET $2300 8444 275c3 endif 8445 275c3 8446 275c3 DLPOINTH 8447 275c3 DLINDEX SET 0 8448 275c3 REPEAT WZONECOUNT 8449 275c3 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275c3 ifconst EXTRADLMEMORY 8451 275c3 - if TMPMEMADDRESS > $1FFF 8452 275c3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275c3 else 8454 275c3 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275c3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275c3 -SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275c3 endif 8458 275c3 endif ; TMPMEMADDRESS > $1FFF 8459 275c3 endif ; EXTRADLMEMORY 8460 275c3 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275c3 18 .byte.b >TMPMEMADDRESS 8462 275c3 DLINDEX SET DLINDEX + 1 8448 275c3 REPEND 8449 275c3 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275c4 ifconst EXTRADLMEMORY 8451 275c4 - if TMPMEMADDRESS > $1FFF 8452 275c4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275c4 else 8454 275c4 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275c4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275c4 -SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275c4 endif 8458 275c4 endif ; TMPMEMADDRESS > $1FFF 8459 275c4 endif ; EXTRADLMEMORY 8460 275c4 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275c4 19 .byte.b >TMPMEMADDRESS 8462 275c4 DLINDEX SET DLINDEX + 1 8448 275c4 REPEND 8449 275c4 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275c5 ifconst EXTRADLMEMORY 8451 275c5 - if TMPMEMADDRESS > $1FFF 8452 275c5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275c5 else 8454 275c5 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275c5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275c5 -SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275c5 endif 8458 275c5 endif ; TMPMEMADDRESS > $1FFF 8459 275c5 endif ; EXTRADLMEMORY 8460 275c5 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275c5 1a .byte.b >TMPMEMADDRESS 8462 275c5 DLINDEX SET DLINDEX + 1 8448 275c5 REPEND 8449 275c5 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275c6 ifconst EXTRADLMEMORY 8451 275c6 - if TMPMEMADDRESS > $1FFF 8452 275c6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275c6 else 8454 275c6 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275c6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275c6 -SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275c6 endif 8458 275c6 endif ; TMPMEMADDRESS > $1FFF 8459 275c6 endif ; EXTRADLMEMORY 8460 275c6 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275c6 1b .byte.b >TMPMEMADDRESS 8462 275c6 DLINDEX SET DLINDEX + 1 8448 275c6 REPEND 8449 275c6 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275c7 ifconst EXTRADLMEMORY 8451 275c7 - if TMPMEMADDRESS > $1FFF 8452 275c7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275c7 else 8454 275c7 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275c7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275c7 -SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275c7 endif 8458 275c7 endif ; TMPMEMADDRESS > $1FFF 8459 275c7 endif ; EXTRADLMEMORY 8460 275c7 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275c7 1c .byte.b >TMPMEMADDRESS 8462 275c7 DLINDEX SET DLINDEX + 1 8448 275c7 REPEND 8449 275c7 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275c8 ifconst EXTRADLMEMORY 8451 275c8 - if TMPMEMADDRESS > $1FFF 8452 275c8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275c8 else 8454 275c8 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275c8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275c8 -SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275c8 endif 8458 275c8 endif ; TMPMEMADDRESS > $1FFF 8459 275c8 endif ; EXTRADLMEMORY 8460 275c8 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275c8 1d .byte.b >TMPMEMADDRESS 8462 275c8 DLINDEX SET DLINDEX + 1 8448 275c8 REPEND 8449 275c8 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275c9 ifconst EXTRADLMEMORY 8451 275c9 - if TMPMEMADDRESS > $1FFF 8452 275c9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275c9 else 8454 275c9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275c9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275c9 -SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275c9 endif 8458 275c9 endif ; TMPMEMADDRESS > $1FFF 8459 275c9 endif ; EXTRADLMEMORY 8460 275c9 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275c9 1e .byte.b >TMPMEMADDRESS 8462 275c9 DLINDEX SET DLINDEX + 1 8448 275c9 REPEND 8449 275c9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275ca ifconst EXTRADLMEMORY 8451 275ca - if TMPMEMADDRESS > $1FFF 8452 275ca -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275ca else 8454 275ca if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275ca TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275ca SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275ca endif 8458 275ca endif ; TMPMEMADDRESS > $1FFF 8459 275ca endif ; EXTRADLMEMORY 8460 275ca ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275ca 22 .byte.b >TMPMEMADDRESS 8462 275ca DLINDEX SET DLINDEX + 1 8448 275ca REPEND 8449 275ca TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275cb ifconst EXTRADLMEMORY 8451 275cb if TMPMEMADDRESS > $1FFF 8452 275cb TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275cb - else 8454 275cb - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275cb -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275cb -SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275cb - endif 8458 275cb endif ; TMPMEMADDRESS > $1FFF 8459 275cb endif ; EXTRADLMEMORY 8460 275cb ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275cb 23 .byte.b >TMPMEMADDRESS 8462 275cb DLINDEX SET DLINDEX + 1 8448 275cb REPEND 8449 275cb TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275cc ifconst EXTRADLMEMORY 8451 275cc if TMPMEMADDRESS > $1FFF 8452 275cc TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275cc - else 8454 275cc - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275cc -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275cc -SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275cc - endif 8458 275cc endif ; TMPMEMADDRESS > $1FFF 8459 275cc endif ; EXTRADLMEMORY 8460 275cc ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275cc 24 .byte.b >TMPMEMADDRESS 8462 275cc DLINDEX SET DLINDEX + 1 8448 275cc REPEND 8449 275cc TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275cd ifconst EXTRADLMEMORY 8451 275cd if TMPMEMADDRESS > $1FFF 8452 275cd TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275cd - else 8454 275cd - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275cd -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275cd -SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275cd - endif 8458 275cd endif ; TMPMEMADDRESS > $1FFF 8459 275cd endif ; EXTRADLMEMORY 8460 275cd ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275cd 25 .byte.b >TMPMEMADDRESS 8462 275cd DLINDEX SET DLINDEX + 1 8448 275cd REPEND 8449 275cd TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8450 275ce ifconst EXTRADLMEMORY 8451 275ce if TMPMEMADDRESS > $1FFF 8452 275ce TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8453 275ce - else 8454 275ce - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8455 275ce -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8456 275ce -SECONDDLHALFSTART SET TMPMEMADDRESS 8457 275ce - endif 8458 275ce endif ; TMPMEMADDRESS > $1FFF 8459 275ce endif ; EXTRADLMEMORY 8460 275ce ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8461 275ce 26 .byte.b >TMPMEMADDRESS 8462 275ce DLINDEX SET DLINDEX + 1 8463 275cf REPEND 8464 275cf 8465 275cf ifconst EXTRADLMEMORY $2235 to $27ff was claimed as extra DL memory. 8466 275cf echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 8467 275cf endif 8468 275cf 8469 275cf 8470 275cf DLPOINTL 8471 275cf DLINDEX SET 0 8472 275cf REPEAT WZONECOUNT 8473 275cf TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8474 275cf ifconst EXTRADLMEMORY 8475 275cf - if TMPMEMADDRESS > $1FFF 8476 275cf -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275cf else 8478 275cf - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275cf -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275cf endif 8481 275cf endif ; TMPMEMADDRESS > $1FFF 8482 275cf endif ; EXTRADLMEMORY 8483 275cf 80 .byte.b $1FFF 8476 275d0 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275d0 else 8478 275d0 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275d0 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275d0 endif 8481 275d0 endif ; TMPMEMADDRESS > $1FFF 8482 275d0 endif ; EXTRADLMEMORY 8483 275d0 75 .byte.b $1FFF 8476 275d1 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275d1 else 8478 275d1 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275d1 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275d1 endif 8481 275d1 endif ; TMPMEMADDRESS > $1FFF 8482 275d1 endif ; EXTRADLMEMORY 8483 275d1 6a .byte.b $1FFF 8476 275d2 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275d2 else 8478 275d2 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275d2 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275d2 endif 8481 275d2 endif ; TMPMEMADDRESS > $1FFF 8482 275d2 endif ; EXTRADLMEMORY 8483 275d2 60 .byte.b $1FFF 8476 275d3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275d3 else 8478 275d3 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275d3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275d3 endif 8481 275d3 endif ; TMPMEMADDRESS > $1FFF 8482 275d3 endif ; EXTRADLMEMORY 8483 275d3 55 .byte.b $1FFF 8476 275d4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275d4 else 8478 275d4 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275d4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275d4 endif 8481 275d4 endif ; TMPMEMADDRESS > $1FFF 8482 275d4 endif ; EXTRADLMEMORY 8483 275d4 4a .byte.b $1FFF 8476 275d5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275d5 else 8478 275d5 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275d5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275d5 endif 8481 275d5 endif ; TMPMEMADDRESS > $1FFF 8482 275d5 endif ; EXTRADLMEMORY 8483 275d5 40 .byte.b $1FFF 8476 275d6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275d6 else 8478 275d6 if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275d6 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275d6 endif 8481 275d6 endif ; TMPMEMADDRESS > $1FFF 8482 275d6 endif ; EXTRADLMEMORY 8483 275d6 35 .byte.b $1FFF 8476 275d7 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275d7 - else 8478 275d7 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275d7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275d7 - endif 8481 275d7 endif ; TMPMEMADDRESS > $1FFF 8482 275d7 endif ; EXTRADLMEMORY 8483 275d7 2a .byte.b $1FFF 8476 275d8 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275d8 - else 8478 275d8 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275d8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275d8 - endif 8481 275d8 endif ; TMPMEMADDRESS > $1FFF 8482 275d8 endif ; EXTRADLMEMORY 8483 275d8 20 .byte.b $1FFF 8476 275d9 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275d9 - else 8478 275d9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275d9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275d9 - endif 8481 275d9 endif ; TMPMEMADDRESS > $1FFF 8482 275d9 endif ; EXTRADLMEMORY 8483 275d9 15 .byte.b $1FFF 8476 275da TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8477 275da - else 8478 275da - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8479 275da -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8480 275da - endif 8481 275da endif ; TMPMEMADDRESS > $1FFF 8482 275da endif ; EXTRADLMEMORY 8483 275da 0a .byte.b $1FFF 8493 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db else 8495 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 18 80 ZONE0ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8489 275db REPEND 8490 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8491 275db ifconst EXTRADLMEMORY 8492 275db - if TMPMEMADDRESS > $1FFF 8493 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db else 8495 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 19 75 ZONE1ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8489 275db REPEND 8490 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8491 275db ifconst EXTRADLMEMORY 8492 275db - if TMPMEMADDRESS > $1FFF 8493 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db else 8495 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 1a 6a ZONE2ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8489 275db REPEND 8490 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8491 275db ifconst EXTRADLMEMORY 8492 275db - if TMPMEMADDRESS > $1FFF 8493 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db else 8495 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 1b 60 ZONE3ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8489 275db REPEND 8490 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8491 275db ifconst EXTRADLMEMORY 8492 275db - if TMPMEMADDRESS > $1FFF 8493 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db else 8495 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 1c 55 ZONE4ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8489 275db REPEND 8490 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8491 275db ifconst EXTRADLMEMORY 8492 275db - if TMPMEMADDRESS > $1FFF 8493 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db else 8495 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 1d 4a ZONE5ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8489 275db REPEND 8490 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8491 275db ifconst EXTRADLMEMORY 8492 275db - if TMPMEMADDRESS > $1FFF 8493 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db else 8495 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 1e 40 ZONE6ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8489 275db REPEND 8490 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8491 275db ifconst EXTRADLMEMORY 8492 275db - if TMPMEMADDRESS > $1FFF 8493 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db else 8495 275db if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 22 35 ZONE7ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8489 275db REPEND 8490 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8491 275db ifconst EXTRADLMEMORY 8492 275db if TMPMEMADDRESS > $1FFF 8493 275db TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db - else 8495 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db - endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 23 2a ZONE8ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8489 275db REPEND 8490 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8491 275db ifconst EXTRADLMEMORY 8492 275db if TMPMEMADDRESS > $1FFF 8493 275db TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db - else 8495 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db - endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 24 20 ZONE9ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8489 275db REPEND 8490 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8491 275db ifconst EXTRADLMEMORY 8492 275db if TMPMEMADDRESS > $1FFF 8493 275db TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db - else 8495 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db - endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 25 15 ZONE10ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8489 275db REPEND 8490 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8491 275db ifconst EXTRADLMEMORY 8492 275db if TMPMEMADDRESS > $1FFF 8493 275db TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8494 275db - else 8495 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8496 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8497 275db - endif 8498 275db endif ; TMPMEMADDRESS > $1FFF 8499 275db endif ; EXTRADLMEMORY 8500 275db 8501 275db 26 0a ZONE11ADDRESS = TMPMEMADDRESS 8502 275db 8503 275db DLINDEX SET DLINDEX + 1 8504 275db REPEND 8505 275db 8506 275db $1880 to $23ff used as zone memory, allowing 48 display objects per zone. 8507 275db echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 8508 275db 8509 275db DLHEIGHT 8510 275db REPEAT WZONECOUNT 8511 275db 0f .byte.b (WZONEHEIGHT-1) 8510 275db REPEND 8511 275dc 0f .byte.b (WZONEHEIGHT-1) 8510 275dc REPEND 8511 275dd 0f .byte.b (WZONEHEIGHT-1) 8510 275dd REPEND 8511 275de 0f .byte.b (WZONEHEIGHT-1) 8510 275de REPEND 8511 275df 0f .byte.b (WZONEHEIGHT-1) 8510 275df REPEND 8511 275e0 0f .byte.b (WZONEHEIGHT-1) 8510 275e0 REPEND 8511 275e1 0f .byte.b (WZONEHEIGHT-1) 8510 275e1 REPEND 8511 275e2 0f .byte.b (WZONEHEIGHT-1) 8510 275e2 REPEND 8511 275e3 0f .byte.b (WZONEHEIGHT-1) 8510 275e3 REPEND 8511 275e4 0f .byte.b (WZONEHEIGHT-1) 8510 275e4 REPEND 8511 275e5 0f .byte.b (WZONEHEIGHT-1) 8510 275e5 REPEND 8511 275e6 0f .byte.b (WZONEHEIGHT-1) 8512 275e7 REPEND 8513 275e7 8514 275e7 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8515 275e7 8516 275e7 ; a simple guard, than ensures the 7800basic code hasn't 8517 275e7 ; spilled into the encryption area... 2455 bytes left in the 7800basic reserved area. 8518 275e7 echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 8519 275e7 - if (*>$FF7D) 8520 275e7 - ERR ; abort the assembly 8521 275e7 endif 8522 275e7 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8523 275e7 8524 275e7 - ifconst DEV 8525 275e7 - ifnconst ZONEHEIGHT 8526 275e7 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8527 275e7 - else 8528 275e7 - if ZONEHEIGHT = 8 8529 275e7 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8530 275e7 - else 8531 275e7 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8532 275e7 - endif 8533 275e7 - endif 8534 275e7 endif 8535 275e7 8536 275e7 - if START_OF_ROM = . 8537 275e7 - .byte 0 8538 275e7 endif 8539 275e7 START_OF_ROM SET 0 8540 275e7 8541 275e7 ; FF7E/FF7F contains the 7800basic crc checksum word 8542 275e7 8543 275e7 ; FF80 - FFF7 contains the 7800 encryption key 8544 275e7 8545 275e7 - ifnconst bankswitchmode 8546 275e7 - ORG $FFF8 8547 275e7 else 8548 275e7 ifconst ROM128K 8549 27ff8 ORG $27FF8 8550 27ff8 RORG $FFF8 8551 27ff8 endif 8552 27ff8 - ifconst ROM144K 8553 27ff8 - ORG $27FF8 8554 27ff8 - RORG $FFF8 8555 27ff8 endif 8556 27ff8 - ifconst ROM256K 8557 27ff8 - ORG $47FF8 8558 27ff8 - RORG $FFF8 8559 27ff8 endif 8560 27ff8 - ifconst ROM272K 8561 27ff8 - ORG $47FF8 8562 27ff8 - RORG $FFF8 8563 27ff8 endif 8564 27ff8 - ifconst ROM512K 8565 27ff8 - ORG $87FF8 8566 27ff8 - RORG $FFF8 8567 27ff8 endif 8568 27ff8 - ifconst ROM528K 8569 27ff8 - ORG $87FF8 8570 27ff8 - RORG $FFF8 8571 27ff8 endif 8572 27ff8 endif 8573 27ff8 8574 27ff8 8575 27ff8 ff .byte.b $FF ; region verification. $FF=all regions 8576 27ff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 8577 27ffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 8578 27ffa 8579 27ffa ;Vectors 8580 27ffa 00 f0 .word.w NMI 8581 27ffc 40 f5 .word.w START 8582 27ffe 5f f0 .word.w IRQ 8583 28000