------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Menu_Demo_v1.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 58 menu_selection_color6 = var24 116 28000 ???? 117 28000 ???? 01 56 menu_selection_color5 = var22 118 28000 ???? 119 28000 ???? 01 55 menu_selection_color4 = var21 120 28000 ???? 121 28000 ???? 01 54 menu_selection_color3 = var20 122 28000 ???? 123 28000 ???? 01 53 menu_selection_color2 = var19 124 28000 ???? 125 28000 ???? 01 52 menu_selection_color1 = var18 126 28000 ???? 127 28000 ???? 01 57 menu_option_players = var23 128 28000 ???? 129 28000 ???? 01 51 menu_option_time = var17 130 28000 ???? 131 28000 ???? 01 50 menu_option_level = var16 132 28000 ???? 133 28000 ???? 01 4f menu_option_lives = var15 134 28000 ???? 135 28000 ???? 01 4e menu_option_skill = var14 136 28000 ???? 137 28000 ???? 01 4d menu_yposition = var13 138 28000 ???? 139 28000 ???? 01 4c menu_xposition = var12 140 28000 ???? 141 28000 ???? 01 4b joyposup = var11 142 28000 ???? 143 28000 ???? 01 4a joyposright = var10 144 28000 ???? 145 28000 ???? 01 49 joyposleft = var9 146 28000 ???? 147 28000 ???? 01 48 joyposdown = var8 148 28000 ???? 149 28000 ???? 01 45 firedebounce = var5 150 28000 ???? 151 28000 ???? 01 44 debounce_right = var4 152 28000 ???? 153 28000 ???? 01 43 debounce_left = var3 154 28000 ???? 155 28000 ???? 01 42 debounce_down = var2 156 28000 ???? 157 28000 ???? 01 41 debounce_up = var1 158 28000 ???? 159 28000 ???? 01 40 frameCounter = var0 160 28000 ???? 161 28000 ???? 00 01 EXTRADLMEMORY = 1 162 28000 ???? 00 01 NTSC = 1 163 28000 ???? 00 10 ZONEHEIGHT = 16 164 28000 ???? 00 08 bankswitchmode = 8 165 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_v1.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 58 menu_selection_color6 = var24 116 28000 ???? 117 28000 ???? 01 56 menu_selection_color5 = var22 118 28000 ???? 119 28000 ???? 01 55 menu_selection_color4 = var21 120 28000 ???? 121 28000 ???? 01 54 menu_selection_color3 = var20 122 28000 ???? 123 28000 ???? 01 53 menu_selection_color2 = var19 124 28000 ???? 125 28000 ???? 01 52 menu_selection_color1 = var18 126 28000 ???? 127 28000 ???? 01 57 menu_option_players = var23 128 28000 ???? 129 28000 ???? 01 51 menu_option_time = var17 130 28000 ???? 131 28000 ???? 01 50 menu_option_level = var16 132 28000 ???? 133 28000 ???? 01 4f menu_option_lives = var15 134 28000 ???? 135 28000 ???? 01 4e menu_option_skill = var14 136 28000 ???? 137 28000 ???? 01 4d menu_yposition = var13 138 28000 ???? 139 28000 ???? 01 4c menu_xposition = var12 140 28000 ???? 141 28000 ???? 01 4b joyposup = var11 142 28000 ???? 143 28000 ???? 01 4a joyposright = var10 144 28000 ???? 145 28000 ???? 01 49 joyposleft = var9 146 28000 ???? 147 28000 ???? 01 48 joyposdown = var8 148 28000 ???? 149 28000 ???? 01 45 firedebounce = var5 150 28000 ???? 151 28000 ???? 01 44 debounce_right = var4 152 28000 ???? 153 28000 ???? 01 43 debounce_left = var3 154 28000 ???? 155 28000 ???? 01 42 debounce_down = var2 156 28000 ???? 157 28000 ???? 01 41 debounce_up = var1 158 28000 ???? 159 28000 ???? 01 40 frameCounter = var0 160 28000 ???? 161 28000 ???? 00 01 EXTRADLMEMORY = 1 162 28000 ???? 00 01 NTSC = 1 163 28000 ???? 00 10 ZONEHEIGHT = 16 164 28000 ???? 00 08 bankswitchmode = 8 165 28000 ???? 00 01 ROM128K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Menu_Demo_v1.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 firedebounce = var5 790 8007 791 8007 . 792 8007 ;; 793 8007 794 8007 . 795 8007 ;; 796 8007 797 8007 .L013 ;; dim joyposdown = var8 798 8007 799 8007 .L014 ;; dim joyposleft = var9 800 8007 801 8007 .L015 ;; dim joyposright = var10 802 8007 803 8007 .L016 ;; dim joyposup = var11 804 8007 805 8007 .L017 ;; dim menu_xposition = var12 806 8007 807 8007 .L018 ;; dim menu_yposition = var13 808 8007 809 8007 .L019 ;; dim menu_option_skill = var14 810 8007 811 8007 .L020 ;; dim menu_option_lives = var15 812 8007 813 8007 .L021 ;; dim menu_option_level = var16 814 8007 815 8007 .L022 ;; dim menu_option_time = var17 816 8007 817 8007 .L023 ;; dim menu_option_players = var23 818 8007 819 8007 .L024 ;; dim menu_selection_color1 = var18 820 8007 821 8007 .L025 ;; dim menu_selection_color2 = var19 822 8007 823 8007 .L026 ;; dim menu_selection_color3 = var20 824 8007 825 8007 .L027 ;; dim menu_selection_color4 = var21 826 8007 827 8007 .L028 ;; dim menu_selection_color5 = var22 828 8007 829 8007 .L029 ;; dim menu_selection_color6 = var24 830 8007 831 8007 . 832 8007 ;; 833 8007 834 8007 .L030 ;; debounce_up = 0 : debounce_down = 0 : debounce_left = 0 : debounce_right = 0 : firedebounce = 0 835 8007 836 8007 a9 00 LDA #0 837 8009 8d 41 01 STA debounce_up 838 800c 8d 42 01 STA debounce_down 839 800f 8d 43 01 STA debounce_left 840 8012 8d 44 01 STA debounce_right 841 8015 8d 45 01 STA firedebounce 842 8018 .L031 ;; joyposdown = 0 : joyposleft = 0 : joyposright = 0 : joyposup = 0 843 8018 844 8018 a9 00 LDA #0 845 801a 8d 48 01 STA joyposdown 846 801d 8d 49 01 STA joyposleft 847 8020 8d 4a 01 STA joyposright 848 8023 8d 4b 01 STA joyposup 849 8026 . 850 8026 ;; 851 8026 852 8026 .L032 ;; incgraphic heofonfir_logo_e.png 160A 853 8026 854 8026 .L033 ;; incgraphic heofonfir_logo_f.png 160A 855 8026 856 8026 .L034 ;; incgraphic heofonfir_logo_h.png 160A 857 8026 858 8026 .L035 ;; incgraphic heofonfir_logo_i.png 160A 859 8026 860 8026 .L036 ;; incgraphic heofonfir_logo_n.png 160A 861 8026 862 8026 .L037 ;; incgraphic heofonfir_logo_o.png 160A 863 8026 864 8026 .L038 ;; incgraphic heofonfir_logo_r.png 160A 865 8026 866 8026 .L039 ;; incgraphic heofonfir_push_fire_banner.png 160A 867 8026 868 8026 .L040 ;; incgraphic heofonfir_complete_font.png 160A 869 8026 870 8026 . 871 8026 ;; 872 8026 873 8026 .L041 ;; BACKGRND = $00 874 8026 875 8026 a9 00 LDA #$00 876 8028 85 20 STA BACKGRND 877 802a . 878 802a ;; 879 802a 880 802a .L042 ;; P0C1 = $F7 : P0C2 = $1C : P0C3 = $0F 881 802a 882 802a a9 f7 LDA #$F7 883 802c 85 21 STA P0C1 884 802e a9 1c LDA #$1C 885 8030 85 22 STA P0C2 886 8032 a9 0f LDA #$0F 887 8034 85 23 STA P0C3 888 8036 .L043 ;; P1C1 = $05 : P1C2 = $15 : P1C3 = $3D 889 8036 890 8036 a9 05 LDA #$05 891 8038 85 25 STA P1C1 892 803a a9 15 LDA #$15 893 803c 85 26 STA P1C2 894 803e a9 3d LDA #$3D 895 8040 85 27 STA P1C3 896 8042 .L044 ;; P2C1 = $90 : P2C2 = $96 : P2C3 = $AF 897 8042 898 8042 a9 90 LDA #$90 899 8044 85 29 STA P2C1 900 8046 a9 96 LDA #$96 901 8048 85 2a STA P2C2 902 804a a9 af LDA #$AF 903 804c 85 2b STA P2C3 904 804e .L045 ;; P3C1 = $77 : P3C2 = $7A : P3C3 = $6F 905 804e 906 804e a9 77 LDA #$77 907 8050 85 2d STA P3C1 908 8052 a9 7a LDA #$7A 909 8054 85 2e STA P3C2 910 8056 a9 6f LDA #$6F 911 8058 85 2f STA P3C3 912 805a .L046 ;; P4C1 = $E1 : P4C2 = $CA : P4C3 = $DD 913 805a 914 805a a9 e1 LDA #$E1 915 805c 85 31 STA P4C1 916 805e a9 ca LDA #$CA 917 8060 85 32 STA P4C2 918 8062 a9 dd LDA #$DD 919 8064 85 33 STA P4C3 920 8066 .L047 ;; P5C1 = $02 : P5C2 = $31 : P5C3 = $25 921 8066 922 8066 a9 02 LDA #$02 923 8068 85 35 STA P5C1 924 806a a9 31 LDA #$31 925 806c 85 36 STA P5C2 926 806e a9 25 LDA #$25 927 8070 85 37 STA P5C3 928 8072 .L048 ;; P6C1 = $07 : P6C2 = $0A : P6C3 = $0C 929 8072 930 8072 a9 07 LDA #$07 931 8074 85 39 STA P6C1 932 8076 a9 0a LDA #$0A 933 8078 85 3a STA P6C2 934 807a a9 0c LDA #$0C 935 807c 85 3b STA P6C3 936 807e .L049 ;; P7C1 = $50 : P7C2 = $64 : P7C3 = $78 937 807e 938 807e a9 50 LDA #$50 939 8080 85 3d STA P7C1 940 8082 a9 64 LDA #$64 941 8084 85 3e STA P7C2 942 8086 a9 78 LDA #$78 943 8088 85 3f STA P7C3 944 808a . 945 808a ;; 946 808a 947 808a .L050 ;; characterset heofonfir_complete_font 948 808a 949 808a a9 a0 lda #>heofonfir_complete_font 950 808c 8d 0b 21 sta sCHARBASE 951 808f 952 808f 85 34 sta CHARBASE 953 8091 a9 60 lda #(heofonfir_complete_font_mode | %01100000) 954 8093 8d 06 21 sta charactermode 955 8096 956 8096 .L051 ;; alphachars '0123456789abcdefghijklmnopqrstuvwxyz.,!?:; &+-=*/\^ˇ_~¸`¡¿()[]æðȝœþƿγδθλξσφψω' 957 8096 958 8096 . 959 8096 ;; 960 8096 961 8096 .L052 ;; goto titlescreen 962 8096 963 8096 4c 56 91 jmp .titlescreen 964 8099 965 8099 .main 966 8099 ;; main 967 8099 968 8099 .L053 ;; if switchreset then reboot 969 8099 970 8099 20 49 f4 jsr checkresetswitch 971 809c d0 03 BNE .skipL053 972 809e .condpart0 973 809e 4c 40 f5 JMP START 974 80a1 .skipL053 975 80a1 .L054 ;; frameCounter = 0 976 80a1 977 80a1 a9 00 LDA #0 978 80a3 8d 40 01 STA frameCounter 979 80a6 .mainloop 980 80a6 ;; mainloop 981 80a6 982 80a6 .L055 ;; drawwait 983 80a6 984 80a6 20 d0 f1 jsr drawwait 985 80a9 .L056 ;; clearscreen 986 80a9 987 80a9 20 7f f0 jsr clearscreen 988 80ac . 989 80ac ;; 990 80ac 991 80ac .L057 ;; if menu_option_skill = 1 then plotchars 'novice^skill^chosen' 2 0 0 992 80ac 993 80ac ad 4e 01 LDA menu_option_skill 994 80af c9 01 CMP #1 995 80b1 d0 2f BNE .skipL057 996 80b3 .condpart1 997 80b3 4c c9 80 JMP skipalphadata0 998 80b6 alphadata0 999 80b6 59 .byte.b (alphadata0 1023 80cf 85 43 sta temp2 1024 80d1 1025 80d1 a9 0d lda #13 ; width in two's complement 1026 80d3 09 40 ora #64 ; palette left shifted 5 bits 1027 80d5 85 44 sta temp3 1028 80d7 a9 00 lda #0 1029 80d9 85 45 sta temp4 1030 80db 1031 80db a9 00 lda #0 1032 80dd 1033 80dd 85 46 sta temp5 1034 80df 1035 80df 20 7a f3 jsr plotcharacters 1036 80e2 .skipL057 1037 80e2 .L058 ;; if menu_option_skill = 2 then plotchars 'standard^skill^chosen' 2 0 0 1038 80e2 1039 80e2 ad 4e 01 LDA menu_option_skill 1040 80e5 c9 02 CMP #2 1041 80e7 d0 31 BNE .skipL058 1042 80e9 .condpart2 1043 80e9 4c 01 81 JMP skipalphadata1 1044 80ec alphadata1 1045 80ec 5e .byte.b (alphadata1 1071 8107 85 43 sta temp2 1072 8109 1073 8109 a9 0b lda #11 ; width in two's complement 1074 810b 09 40 ora #64 ; palette left shifted 5 bits 1075 810d 85 44 sta temp3 1076 810f a9 00 lda #0 1077 8111 85 45 sta temp4 1078 8113 1079 8113 a9 00 lda #0 1080 8115 1081 8115 85 46 sta temp5 1082 8117 1083 8117 20 7a f3 jsr plotcharacters 1084 811a .skipL058 1085 811a .L059 ;; if menu_option_skill = 3 then plotchars 'expert^skill^chosen' 2 0 0 1086 811a 1087 811a ad 4e 01 LDA menu_option_skill 1088 811d c9 03 CMP #3 1089 811f d0 2f BNE .skipL059 1090 8121 .condpart3 1091 8121 4c 37 81 JMP skipalphadata2 1092 8124 alphadata2 1093 8124 50 .byte.b (alphadata2 1117 813d 85 43 sta temp2 1118 813f 1119 813f a9 0d lda #13 ; width in two's complement 1120 8141 09 40 ora #64 ; palette left shifted 5 bits 1121 8143 85 44 sta temp3 1122 8145 a9 00 lda #0 1123 8147 85 45 sta temp4 1124 8149 1125 8149 a9 00 lda #0 1126 814b 1127 814b 85 46 sta temp5 1128 814d 1129 814d 20 7a f3 jsr plotcharacters 1130 8150 .skipL059 1131 8150 .L060 ;; if menu_option_lives = 1 then plotchars 'one^life^chosen' 2 0 1 1132 8150 1133 8150 ad 4f 01 LDA menu_option_lives 1134 8153 c9 01 CMP #1 1135 8155 d0 2b BNE .skipL060 1136 8157 .condpart4 1137 8157 4c 69 81 JMP skipalphadata3 1138 815a alphadata3 1139 815a 5a .byte.b (alphadata3 1159 816f 85 43 sta temp2 1160 8171 1161 8171 a9 11 lda #17 ; width in two's complement 1162 8173 09 40 ora #64 ; palette left shifted 5 bits 1163 8175 85 44 sta temp3 1164 8177 a9 00 lda #0 1165 8179 85 45 sta temp4 1166 817b 1167 817b a9 01 lda #1 1168 817d 1169 817d 85 46 sta temp5 1170 817f 1171 817f 20 7a f3 jsr plotcharacters 1172 8182 .skipL060 1173 8182 .L061 ;; if menu_option_lives = 2 then plotchars 'two^lives^chosen' 2 0 1 1174 8182 1175 8182 ad 4f 01 LDA menu_option_lives 1176 8185 c9 02 CMP #2 1177 8187 d0 2c BNE .skipL061 1178 8189 .condpart5 1179 8189 4c 9c 81 JMP skipalphadata4 1180 818c alphadata4 1181 818c 5f .byte.b (alphadata4 1202 81a2 85 43 sta temp2 1203 81a4 1204 81a4 a9 10 lda #16 ; width in two's complement 1205 81a6 09 40 ora #64 ; palette left shifted 5 bits 1206 81a8 85 44 sta temp3 1207 81aa a9 00 lda #0 1208 81ac 85 45 sta temp4 1209 81ae 1210 81ae a9 01 lda #1 1211 81b0 1212 81b0 85 46 sta temp5 1213 81b2 1214 81b2 20 7a f3 jsr plotcharacters 1215 81b5 .skipL061 1216 81b5 .L062 ;; if menu_option_lives = 3 then plotchars 'three^lives^chosen' 2 0 1 1217 81b5 1218 81b5 ad 4f 01 LDA menu_option_lives 1219 81b8 c9 03 CMP #3 1220 81ba d0 2e BNE .skipL062 1221 81bc .condpart6 1222 81bc 4c d1 81 JMP skipalphadata5 1223 81bf alphadata5 1224 81bf 5f .byte.b (alphadata5 1247 81d7 85 43 sta temp2 1248 81d9 1249 81d9 a9 0e lda #14 ; width in two's complement 1250 81db 09 40 ora #64 ; palette left shifted 5 bits 1251 81dd 85 44 sta temp3 1252 81df a9 00 lda #0 1253 81e1 85 45 sta temp4 1254 81e3 1255 81e3 a9 01 lda #1 1256 81e5 1257 81e5 85 46 sta temp5 1258 81e7 1259 81e7 20 7a f3 jsr plotcharacters 1260 81ea .skipL062 1261 81ea .L063 ;; if menu_option_level = 1 then plotchars 'level^one^chosen' 2 0 2 1262 81ea 1263 81ea ad 50 01 LDA menu_option_level 1264 81ed c9 01 CMP #1 1265 81ef d0 2c BNE .skipL063 1266 81f1 .condpart7 1267 81f1 4c 04 82 JMP skipalphadata6 1268 81f4 alphadata6 1269 81f4 57 .byte.b (alphadata6 1290 820a 85 43 sta temp2 1291 820c 1292 820c a9 10 lda #16 ; width in two's complement 1293 820e 09 40 ora #64 ; palette left shifted 5 bits 1294 8210 85 44 sta temp3 1295 8212 a9 00 lda #0 1296 8214 85 45 sta temp4 1297 8216 1298 8216 a9 02 lda #2 1299 8218 1300 8218 85 46 sta temp5 1301 821a 1302 821a 20 7a f3 jsr plotcharacters 1303 821d .skipL063 1304 821d .L064 ;; if menu_option_level = 2 then plotchars 'level^two^chosen' 2 0 2 1305 821d 1306 821d ad 50 01 LDA menu_option_level 1307 8220 c9 02 CMP #2 1308 8222 d0 2c BNE .skipL064 1309 8224 .condpart8 1310 8224 4c 37 82 JMP skipalphadata7 1311 8227 alphadata7 1312 8227 57 .byte.b (alphadata7 1333 823d 85 43 sta temp2 1334 823f 1335 823f a9 10 lda #16 ; width in two's complement 1336 8241 09 40 ora #64 ; palette left shifted 5 bits 1337 8243 85 44 sta temp3 1338 8245 a9 00 lda #0 1339 8247 85 45 sta temp4 1340 8249 1341 8249 a9 02 lda #2 1342 824b 1343 824b 85 46 sta temp5 1344 824d 1345 824d 20 7a f3 jsr plotcharacters 1346 8250 .skipL064 1347 8250 .L065 ;; if menu_option_level = 3 then plotchars 'level^three^chosen' 2 0 2 1348 8250 1349 8250 ad 50 01 LDA menu_option_level 1350 8253 c9 03 CMP #3 1351 8255 d0 2e BNE .skipL065 1352 8257 .condpart9 1353 8257 4c 6c 82 JMP skipalphadata8 1354 825a alphadata8 1355 825a 57 .byte.b (alphadata8 1378 8272 85 43 sta temp2 1379 8274 1380 8274 a9 0e lda #14 ; width in two's complement 1381 8276 09 40 ora #64 ; palette left shifted 5 bits 1382 8278 85 44 sta temp3 1383 827a a9 00 lda #0 1384 827c 85 45 sta temp4 1385 827e 1386 827e a9 02 lda #2 1387 8280 1388 8280 85 46 sta temp5 1389 8282 1390 8282 20 7a f3 jsr plotcharacters 1391 8285 .skipL065 1392 8285 .L066 ;; if menu_option_time = 1 then plotchars 'normal^game^chosen' 2 0 3 1393 8285 1394 8285 ad 51 01 LDA menu_option_time 1395 8288 c9 01 CMP #1 1396 828a d0 2e BNE .skipL066 1397 828c .condpart10 1398 828c 4c a1 82 JMP skipalphadata9 1399 828f alphadata9 1400 828f 59 .byte.b (alphadata9 1423 82a7 85 43 sta temp2 1424 82a9 1425 82a9 a9 0e lda #14 ; width in two's complement 1426 82ab 09 40 ora #64 ; palette left shifted 5 bits 1427 82ad 85 44 sta temp3 1428 82af a9 00 lda #0 1429 82b1 85 45 sta temp4 1430 82b3 1431 82b3 a9 03 lda #3 1432 82b5 1433 82b5 85 46 sta temp5 1434 82b7 1435 82b7 20 7a f3 jsr plotcharacters 1436 82ba .skipL066 1437 82ba .L067 ;; if menu_option_time = 2 then plotchars 'two^minutes^chosen' 2 0 3 1438 82ba 1439 82ba ad 51 01 LDA menu_option_time 1440 82bd c9 02 CMP #2 1441 82bf d0 2e BNE .skipL067 1442 82c1 .condpart11 1443 82c1 4c d6 82 JMP skipalphadata10 1444 82c4 alphadata10 1445 82c4 5f .byte.b (alphadata10 1468 82dc 85 43 sta temp2 1469 82de 1470 82de a9 0e lda #14 ; width in two's complement 1471 82e0 09 40 ora #64 ; palette left shifted 5 bits 1472 82e2 85 44 sta temp3 1473 82e4 a9 00 lda #0 1474 82e6 85 45 sta temp4 1475 82e8 1476 82e8 a9 03 lda #3 1477 82ea 1478 82ea 85 46 sta temp5 1479 82ec 1480 82ec 20 7a f3 jsr plotcharacters 1481 82ef .skipL067 1482 82ef .L068 ;; if menu_option_time = 3 then plotchars 'five^minutes^chosen' 2 0 3 1483 82ef 1484 82ef ad 51 01 LDA menu_option_time 1485 82f2 c9 03 CMP #3 1486 82f4 d0 2f BNE .skipL068 1487 82f6 .condpart12 1488 82f6 4c 0c 83 JMP skipalphadata11 1489 82f9 alphadata11 1490 82f9 51 .byte.b (alphadata11 1514 8312 85 43 sta temp2 1515 8314 1516 8314 a9 0d lda #13 ; width in two's complement 1517 8316 09 40 ora #64 ; palette left shifted 5 bits 1518 8318 85 44 sta temp3 1519 831a a9 00 lda #0 1520 831c 85 45 sta temp4 1521 831e 1522 831e a9 03 lda #3 1523 8320 1524 8320 85 46 sta temp5 1525 8322 1526 8322 20 7a f3 jsr plotcharacters 1527 8325 .skipL068 1528 8325 .L069 ;; if menu_option_players = 1 then plotchars 'one-player^mode^chosen' 2 0 4 1529 8325 1530 8325 ad 57 01 LDA menu_option_players 1531 8328 c9 01 CMP #1 1532 832a d0 32 BNE .skipL069 1533 832c .condpart13 1534 832c 4c 45 83 JMP skipalphadata12 1535 832f alphadata12 1536 832f 5a .byte.b (alphadata12 1563 834b 85 43 sta temp2 1564 834d 1565 834d a9 0a lda #10 ; width in two's complement 1566 834f 09 40 ora #64 ; palette left shifted 5 bits 1567 8351 85 44 sta temp3 1568 8353 a9 00 lda #0 1569 8355 85 45 sta temp4 1570 8357 1571 8357 a9 04 lda #4 1572 8359 1573 8359 85 46 sta temp5 1574 835b 1575 835b 20 7a f3 jsr plotcharacters 1576 835e .skipL069 1577 835e .L070 ;; if menu_option_players = 2 then plotchars 'two-player^mode^chosen' 2 0 4 1578 835e 1579 835e ad 57 01 LDA menu_option_players 1580 8361 c9 02 CMP #2 1581 8363 d0 32 BNE .skipL070 1582 8365 .condpart14 1583 8365 4c 7e 83 JMP skipalphadata13 1584 8368 alphadata13 1585 8368 5f .byte.b (alphadata13 1612 8384 85 43 sta temp2 1613 8386 1614 8386 a9 0a lda #10 ; width in two's complement 1615 8388 09 40 ora #64 ; palette left shifted 5 bits 1616 838a 85 44 sta temp3 1617 838c a9 00 lda #0 1618 838e 85 45 sta temp4 1619 8390 1620 8390 a9 04 lda #4 1621 8392 1622 8392 85 46 sta temp5 1623 8394 1624 8394 20 7a f3 jsr plotcharacters 1625 8397 .skipL070 1626 8397 . 1627 8397 ;; 1628 8397 1629 8397 . 1630 8397 ;; 1631 8397 1632 8397 . 1633 8397 ;; 1634 8397 1635 8397 . 1636 8397 ;; 1637 8397 1638 8397 . 1639 8397 ;; 1640 8397 1641 8397 . 1642 8397 ;; 1643 8397 1644 8397 . 1645 8397 ;; 1646 8397 1647 8397 . 1648 8397 ;; 1649 8397 1650 8397 . 1651 8397 ;; 1652 8397 1653 8397 . 1654 8397 ;; 1655 8397 1656 8397 . 1657 8397 ;; 1658 8397 1659 8397 . 1660 8397 ;; 1661 8397 1662 8397 .L071 ;; drawscreen 1663 8397 1664 8397 20 b3 f0 jsr drawscreen 1665 839a .L072 ;; goto mainloop 1666 839a 1667 839a 4c a6 80 jmp .mainloop 1668 839d 1669 839d . 1670 839d ;; 1671 839d 1672 839d . 1673 839d ;; 1674 839d 1675 839d . 1676 839d ;; 1677 839d 1678 839d . 1679 839d ;; 1680 839d 1681 839d . 1682 839d ;; 1683 839d 1684 839d . 1685 839d ;; 1686 839d 1687 839d . 1688 839d ;; 1689 839d 1690 839d . 1691 839d ;; 1692 839d 1693 839d . 1694 839d ;; 1695 839d 1696 839d . 1697 839d ;; 1698 839d 1699 839d . 1700 839d ;; 1701 839d 1702 839d . 1703 839d ;; 1704 839d 1705 839d . 1706 839d ;; 1707 839d 1708 839d . 1709 839d ;; 1710 839d 1711 839d . 1712 839d ;; 1713 839d 1714 839d . 1715 839d ;; 1716 839d 1717 839d . 1718 839d ;; 1719 839d 1720 839d . 1721 839d ;; 1722 839d 1723 839d . 1724 839d ;; 1725 839d 1726 839d . 1727 839d ;; 1728 839d 1729 839d . 1730 839d ;; 1731 839d 1732 839d . 1733 839d ;; 1734 839d 1735 839d . 1736 839d ;; 1737 839d 1738 839d . 1739 839d ;; 1740 839d 1741 839d . 1742 839d ;; 1743 839d 1744 839d . 1745 839d ;; 1746 839d 1747 839d . 1748 839d ;; 1749 839d 1750 839d . 1751 839d ;; 1752 839d 1753 839d . 1754 839d ;; 1755 839d 1756 839d . 1757 839d ;; 1758 839d 1759 839d .menuscreen 1760 839d ;; menuscreen 1761 839d 1762 839d .L073 ;; menu_yposition = 5 1763 839d 1764 839d a9 05 LDA #5 1765 839f 8d 4d 01 STA menu_yposition 1766 83a2 . 1767 83a2 ;; 1768 83a2 1769 83a2 .L074 ;; menu_option_level = 1 1770 83a2 1771 83a2 a9 01 LDA #1 1772 83a4 8d 50 01 STA menu_option_level 1773 83a7 .L075 ;; menu_option_lives = 3 1774 83a7 1775 83a7 a9 03 LDA #3 1776 83a9 8d 4f 01 STA menu_option_lives 1777 83ac .L076 ;; menu_option_skill = 1 1778 83ac 1779 83ac a9 01 LDA #1 1780 83ae 8d 4e 01 STA menu_option_skill 1781 83b1 .L077 ;; menu_option_time = 1 1782 83b1 1783 83b1 a9 01 LDA #1 1784 83b3 8d 51 01 STA menu_option_time 1785 83b6 .L078 ;; menu_option_players = 1 1786 83b6 1787 83b6 a9 01 LDA #1 1788 83b8 8d 57 01 STA menu_option_players 1789 83bb . 1790 83bb ;; 1791 83bb 1792 83bb .L079 ;; menu_selection_color1 = 7 1793 83bb 1794 83bb a9 07 LDA #7 1795 83bd 8d 52 01 STA menu_selection_color1 1796 83c0 .L080 ;; menu_selection_color2 = 2 1797 83c0 1798 83c0 a9 02 LDA #2 1799 83c2 8d 53 01 STA menu_selection_color2 1800 83c5 .L081 ;; menu_selection_color3 = 2 1801 83c5 1802 83c5 a9 02 LDA #2 1803 83c7 8d 54 01 STA menu_selection_color3 1804 83ca .L082 ;; menu_selection_color4 = 2 1805 83ca 1806 83ca a9 02 LDA #2 1807 83cc 8d 55 01 STA menu_selection_color4 1808 83cf .L083 ;; menu_selection_color5 = 2 1809 83cf 1810 83cf a9 02 LDA #2 1811 83d1 8d 56 01 STA menu_selection_color5 1812 83d4 .L084 ;; menu_selection_color6 = 2 1813 83d4 1814 83d4 a9 02 LDA #2 1815 83d6 8d 58 01 STA menu_selection_color6 1816 83d9 . 1817 83d9 ;; 1818 83d9 1819 83d9 .menuscreen_loop 1820 83d9 ;; menuscreen_loop 1821 83d9 1822 83d9 .L085 ;; drawwait 1823 83d9 1824 83d9 20 d0 f1 jsr drawwait 1825 83dc .L086 ;; clearscreen 1826 83dc 1827 83dc 20 7f f0 jsr clearscreen 1828 83df .L087 ;; if joy0up then debounce_up = 5 1829 83df 1830 83df a9 10 lda #$10 1831 83e1 2c 80 02 bit SWCHA 1832 83e4 d0 05 BNE .skipL087 1833 83e6 .condpart15 1834 83e6 a9 05 LDA #5 1835 83e8 8d 41 01 STA debounce_up 1836 83eb .skipL087 1837 83eb .L088 ;; if !joy0up && debounce_up = 5 then debounce_up = 6 1838 83eb 1839 83eb a9 10 lda #$10 1840 83ed 2c 80 02 bit SWCHA 1841 83f0 f0 0c BEQ .skipL088 1842 83f2 .condpart16 1843 83f2 ad 41 01 LDA debounce_up 1844 83f5 c9 05 CMP #5 1845 83f7 d0 05 BNE .skip16then 1846 83f9 .condpart17 1847 83f9 a9 06 LDA #6 1848 83fb 8d 41 01 STA debounce_up 1849 83fe .skip16then 1850 83fe .skipL088 1851 83fe .L089 ;; if joy0down then debounce_down = 5 1852 83fe 1853 83fe a9 20 lda #$20 1854 8400 2c 80 02 bit SWCHA 1855 8403 d0 05 BNE .skipL089 1856 8405 .condpart18 1857 8405 a9 05 LDA #5 1858 8407 8d 42 01 STA debounce_down 1859 840a .skipL089 1860 840a .L090 ;; if !joy0down && debounce_down = 5 then debounce_down = 6 1861 840a 1862 840a a9 20 lda #$20 1863 840c 2c 80 02 bit SWCHA 1864 840f f0 0c BEQ .skipL090 1865 8411 .condpart19 1866 8411 ad 42 01 LDA debounce_down 1867 8414 c9 05 CMP #5 1868 8416 d0 05 BNE .skip19then 1869 8418 .condpart20 1870 8418 a9 06 LDA #6 1871 841a 8d 42 01 STA debounce_down 1872 841d .skip19then 1873 841d .skipL090 1874 841d .L091 ;; if joy0left then debounce_left = 5 1875 841d 1876 841d 2c 80 02 bit SWCHA 1877 8420 70 05 BVS .skipL091 1878 8422 .condpart21 1879 8422 a9 05 LDA #5 1880 8424 8d 43 01 STA debounce_left 1881 8427 .skipL091 1882 8427 .L092 ;; if !joy0left && debounce_left = 5 then debounce_left = 6 1883 8427 1884 8427 2c 80 02 bit SWCHA 1885 842a 50 0c BVC .skipL092 1886 842c .condpart22 1887 842c ad 43 01 LDA debounce_left 1888 842f c9 05 CMP #5 1889 8431 d0 05 BNE .skip22then 1890 8433 .condpart23 1891 8433 a9 06 LDA #6 1892 8435 8d 43 01 STA debounce_left 1893 8438 .skip22then 1894 8438 .skipL092 1895 8438 .L093 ;; if joy0right then debounce_right = 5 1896 8438 1897 8438 2c 80 02 bit SWCHA 1898 843b 30 05 BMI .skipL093 1899 843d .condpart24 1900 843d a9 05 LDA #5 1901 843f 8d 44 01 STA debounce_right 1902 8442 .skipL093 1903 8442 .L094 ;; if !joy0right && debounce_right = 5 then debounce_right = 6 1904 8442 1905 8442 2c 80 02 bit SWCHA 1906 8445 10 0c BPL .skipL094 1907 8447 .condpart25 1908 8447 ad 44 01 LDA debounce_right 1909 844a c9 05 CMP #5 1910 844c d0 05 BNE .skip25then 1911 844e .condpart26 1912 844e a9 06 LDA #6 1913 8450 8d 44 01 STA debounce_right 1914 8453 .skip25then 1915 8453 .skipL094 1916 8453 . 1917 8453 ;; 1918 8453 1919 8453 . 1920 8453 ;; 1921 8453 1922 8453 .L095 ;; plotsprite heofonfir_logo_h 0 9 2 1923 8453 1924 8453 a9 10 lda #heofonfir_logo_h 1928 8459 85 43 sta temp2 1929 845b 1930 845b a9 1c lda #(0|heofonfir_logo_h_width_twoscompliment) 1931 845d 85 44 sta temp3 1932 845f 1933 845f a9 09 lda #9 1934 8461 85 45 sta temp4 1935 8463 1936 8463 a9 02 lda #2 1937 8465 1938 8465 85 46 sta temp5 1939 8467 1940 8467 a9 40 lda #(heofonfir_logo_h_mode|%01000000) 1941 8469 85 47 sta temp6 1942 846b 1943 846b 20 c9 f2 jsr plotsprite 1944 846e ; +tall sprite replot 1945 846e 18 clc 1946 846f a5 42 lda temp1 1947 8471 69 04 adc #heofonfir_logo_h_width 1948 8473 85 42 sta temp1 1949 8475 a5 46 lda temp5 1950 8477 69 10 adc #WZONEHEIGHT 1951 8479 85 46 sta temp5 1952 847b 20 c9 f2 jsr plotsprite 1953 847e .L096 ;; plotsprite heofonfir_logo_e 0 26 2 1954 847e 1955 847e a9 00 lda #heofonfir_logo_e 1959 8484 85 43 sta temp2 1960 8486 1961 8486 a9 1c lda #(0|heofonfir_logo_e_width_twoscompliment) 1962 8488 85 44 sta temp3 1963 848a 1964 848a a9 1a lda #26 1965 848c 85 45 sta temp4 1966 848e 1967 848e a9 02 lda #2 1968 8490 1969 8490 85 46 sta temp5 1970 8492 1971 8492 a9 40 lda #(heofonfir_logo_e_mode|%01000000) 1972 8494 85 47 sta temp6 1973 8496 1974 8496 20 c9 f2 jsr plotsprite 1975 8499 ; +tall sprite replot 1976 8499 18 clc 1977 849a a5 42 lda temp1 1978 849c 69 04 adc #heofonfir_logo_e_width 1979 849e 85 42 sta temp1 1980 84a0 a5 46 lda temp5 1981 84a2 69 10 adc #WZONEHEIGHT 1982 84a4 85 46 sta temp5 1983 84a6 20 c9 f2 jsr plotsprite 1984 84a9 .L097 ;; plotsprite heofonfir_logo_o 0 42 2 1985 84a9 1986 84a9 a9 28 lda #heofonfir_logo_o 1990 84af 85 43 sta temp2 1991 84b1 1992 84b1 a9 1c lda #(0|heofonfir_logo_o_width_twoscompliment) 1993 84b3 85 44 sta temp3 1994 84b5 1995 84b5 a9 2a lda #42 1996 84b7 85 45 sta temp4 1997 84b9 1998 84b9 a9 02 lda #2 1999 84bb 2000 84bb 85 46 sta temp5 2001 84bd 2002 84bd a9 40 lda #(heofonfir_logo_o_mode|%01000000) 2003 84bf 85 47 sta temp6 2004 84c1 2005 84c1 20 c9 f2 jsr plotsprite 2006 84c4 ; +tall sprite replot 2007 84c4 18 clc 2008 84c5 a5 42 lda temp1 2009 84c7 69 04 adc #heofonfir_logo_o_width 2010 84c9 85 42 sta temp1 2011 84cb a5 46 lda temp5 2012 84cd 69 10 adc #WZONEHEIGHT 2013 84cf 85 46 sta temp5 2014 84d1 20 c9 f2 jsr plotsprite 2015 84d4 .L098 ;; plotsprite heofonfir_logo_f 0 58 2 2016 84d4 2017 84d4 a9 08 lda #heofonfir_logo_f 2021 84da 85 43 sta temp2 2022 84dc 2023 84dc a9 1c lda #(0|heofonfir_logo_f_width_twoscompliment) 2024 84de 85 44 sta temp3 2025 84e0 2026 84e0 a9 3a lda #58 2027 84e2 85 45 sta temp4 2028 84e4 2029 84e4 a9 02 lda #2 2030 84e6 2031 84e6 85 46 sta temp5 2032 84e8 2033 84e8 a9 40 lda #(heofonfir_logo_f_mode|%01000000) 2034 84ea 85 47 sta temp6 2035 84ec 2036 84ec 20 c9 f2 jsr plotsprite 2037 84ef ; +tall sprite replot 2038 84ef 18 clc 2039 84f0 a5 42 lda temp1 2040 84f2 69 04 adc #heofonfir_logo_f_width 2041 84f4 85 42 sta temp1 2042 84f6 a5 46 lda temp5 2043 84f8 69 10 adc #WZONEHEIGHT 2044 84fa 85 46 sta temp5 2045 84fc 20 c9 f2 jsr plotsprite 2046 84ff .L099 ;; plotsprite heofonfir_logo_o 0 74 2 2047 84ff 2048 84ff a9 28 lda #heofonfir_logo_o 2052 8505 85 43 sta temp2 2053 8507 2054 8507 a9 1c lda #(0|heofonfir_logo_o_width_twoscompliment) 2055 8509 85 44 sta temp3 2056 850b 2057 850b a9 4a lda #74 2058 850d 85 45 sta temp4 2059 850f 2060 850f a9 02 lda #2 2061 8511 2062 8511 85 46 sta temp5 2063 8513 2064 8513 a9 40 lda #(heofonfir_logo_o_mode|%01000000) 2065 8515 85 47 sta temp6 2066 8517 2067 8517 20 c9 f2 jsr plotsprite 2068 851a ; +tall sprite replot 2069 851a 18 clc 2070 851b a5 42 lda temp1 2071 851d 69 04 adc #heofonfir_logo_o_width 2072 851f 85 42 sta temp1 2073 8521 a5 46 lda temp5 2074 8523 69 10 adc #WZONEHEIGHT 2075 8525 85 46 sta temp5 2076 8527 20 c9 f2 jsr plotsprite 2077 852a .L0100 ;; plotsprite heofonfir_logo_n 0 90 2 2078 852a 2079 852a a9 20 lda #heofonfir_logo_n 2083 8530 85 43 sta temp2 2084 8532 2085 8532 a9 1c lda #(0|heofonfir_logo_n_width_twoscompliment) 2086 8534 85 44 sta temp3 2087 8536 2088 8536 a9 5a lda #90 2089 8538 85 45 sta temp4 2090 853a 2091 853a a9 02 lda #2 2092 853c 2093 853c 85 46 sta temp5 2094 853e 2095 853e a9 40 lda #(heofonfir_logo_n_mode|%01000000) 2096 8540 85 47 sta temp6 2097 8542 2098 8542 20 c9 f2 jsr plotsprite 2099 8545 ; +tall sprite replot 2100 8545 18 clc 2101 8546 a5 42 lda temp1 2102 8548 69 04 adc #heofonfir_logo_n_width 2103 854a 85 42 sta temp1 2104 854c a5 46 lda temp5 2105 854e 69 10 adc #WZONEHEIGHT 2106 8550 85 46 sta temp5 2107 8552 20 c9 f2 jsr plotsprite 2108 8555 .L0101 ;; plotsprite heofonfir_logo_f 0 107 2 2109 8555 2110 8555 a9 08 lda #heofonfir_logo_f 2114 855b 85 43 sta temp2 2115 855d 2116 855d a9 1c lda #(0|heofonfir_logo_f_width_twoscompliment) 2117 855f 85 44 sta temp3 2118 8561 2119 8561 a9 6b lda #107 2120 8563 85 45 sta temp4 2121 8565 2122 8565 a9 02 lda #2 2123 8567 2124 8567 85 46 sta temp5 2125 8569 2126 8569 a9 40 lda #(heofonfir_logo_f_mode|%01000000) 2127 856b 85 47 sta temp6 2128 856d 2129 856d 20 c9 f2 jsr plotsprite 2130 8570 ; +tall sprite replot 2131 8570 18 clc 2132 8571 a5 42 lda temp1 2133 8573 69 04 adc #heofonfir_logo_f_width 2134 8575 85 42 sta temp1 2135 8577 a5 46 lda temp5 2136 8579 69 10 adc #WZONEHEIGHT 2137 857b 85 46 sta temp5 2138 857d 20 c9 f2 jsr plotsprite 2139 8580 .L0102 ;; plotsprite heofonfir_logo_i 0 121 2 2140 8580 2141 8580 a9 18 lda #heofonfir_logo_i 2145 8586 85 43 sta temp2 2146 8588 2147 8588 a9 1c lda #(0|heofonfir_logo_i_width_twoscompliment) 2148 858a 85 44 sta temp3 2149 858c 2150 858c a9 79 lda #121 2151 858e 85 45 sta temp4 2152 8590 2153 8590 a9 02 lda #2 2154 8592 2155 8592 85 46 sta temp5 2156 8594 2157 8594 a9 40 lda #(heofonfir_logo_i_mode|%01000000) 2158 8596 85 47 sta temp6 2159 8598 2160 8598 20 c9 f2 jsr plotsprite 2161 859b ; +tall sprite replot 2162 859b 18 clc 2163 859c a5 42 lda temp1 2164 859e 69 04 adc #heofonfir_logo_i_width 2165 85a0 85 42 sta temp1 2166 85a2 a5 46 lda temp5 2167 85a4 69 10 adc #WZONEHEIGHT 2168 85a6 85 46 sta temp5 2169 85a8 20 c9 f2 jsr plotsprite 2170 85ab .L0103 ;; plotsprite heofonfir_logo_r 0 136 2 2171 85ab 2172 85ab a9 30 lda #heofonfir_logo_r 2176 85b1 85 43 sta temp2 2177 85b3 2178 85b3 a9 1c lda #(0|heofonfir_logo_r_width_twoscompliment) 2179 85b5 85 44 sta temp3 2180 85b7 2181 85b7 a9 88 lda #136 2182 85b9 85 45 sta temp4 2183 85bb 2184 85bb a9 02 lda #2 2185 85bd 2186 85bd 85 46 sta temp5 2187 85bf 2188 85bf a9 40 lda #(heofonfir_logo_r_mode|%01000000) 2189 85c1 85 47 sta temp6 2190 85c3 2191 85c3 20 c9 f2 jsr plotsprite 2192 85c6 ; +tall sprite replot 2193 85c6 18 clc 2194 85c7 a5 42 lda temp1 2195 85c9 69 04 adc #heofonfir_logo_r_width 2196 85cb 85 42 sta temp1 2197 85cd a5 46 lda temp5 2198 85cf 69 10 adc #WZONEHEIGHT 2199 85d1 85 46 sta temp5 2200 85d3 20 c9 f2 jsr plotsprite 2201 85d6 . 2202 85d6 ;; 2203 85d6 2204 85d6 .L0104 ;; plotchars 'game^setup' 0 26 4 2205 85d6 2206 85d6 4c e3 85 JMP skipalphadata14 2207 85d9 alphadata14 2208 85d9 52 .byte.b (alphadata14 2223 85e9 85 43 sta temp2 2224 85eb 2225 85eb a9 16 lda #22 ; width in two's complement 2226 85ed 09 00 ora #0 ; palette left shifted 5 bits 2227 85ef 85 44 sta temp3 2228 85f1 a9 1a lda #26 2229 85f3 85 45 sta temp4 2230 85f5 2231 85f5 a9 04 lda #4 2232 85f7 2233 85f7 85 46 sta temp5 2234 85f9 2235 85f9 20 7a f3 jsr plotcharacters 2236 85fc . 2237 85fc ;; 2238 85fc 2239 85fc .L0105 ;; 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 : menu_selection_color6 = 2 2240 85fc 2241 85fc ad 4d 01 LDA menu_yposition 2242 85ff c9 05 CMP #5 2243 8601 d0 16 BNE .skipL0105 2244 8603 .condpart27 2245 8603 a9 07 LDA #7 2246 8605 8d 52 01 STA menu_selection_color1 2247 8608 a9 02 LDA #2 2248 860a 8d 53 01 STA menu_selection_color2 2249 860d 8d 54 01 STA menu_selection_color3 2250 8610 8d 55 01 STA menu_selection_color4 2251 8613 8d 56 01 STA menu_selection_color5 2252 8616 8d 58 01 STA menu_selection_color6 2253 8619 .skipL0105 2254 8619 .L0106 ;; 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 : menu_selection_color6 = 2 2255 8619 2256 8619 ad 4d 01 LDA menu_yposition 2257 861c c9 06 CMP #6 2258 861e d0 18 BNE .skipL0106 2259 8620 .condpart28 2260 8620 a9 02 LDA #2 2261 8622 8d 52 01 STA menu_selection_color1 2262 8625 a9 07 LDA #7 2263 8627 8d 53 01 STA menu_selection_color2 2264 862a a9 02 LDA #2 2265 862c 8d 54 01 STA menu_selection_color3 2266 862f 8d 55 01 STA menu_selection_color4 2267 8632 8d 56 01 STA menu_selection_color5 2268 8635 8d 58 01 STA menu_selection_color6 2269 8638 .skipL0106 2270 8638 .L0107 ;; 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 : menu_selection_color6 = 2 2271 8638 2272 8638 ad 4d 01 LDA menu_yposition 2273 863b c9 07 CMP #7 2274 863d d0 18 BNE .skipL0107 2275 863f .condpart29 2276 863f a9 02 LDA #2 2277 8641 8d 52 01 STA menu_selection_color1 2278 8644 8d 53 01 STA menu_selection_color2 2279 8647 a9 07 LDA #7 2280 8649 8d 54 01 STA menu_selection_color3 2281 864c a9 02 LDA #2 2282 864e 8d 55 01 STA menu_selection_color4 2283 8651 8d 56 01 STA menu_selection_color5 2284 8654 8d 58 01 STA menu_selection_color6 2285 8657 .skipL0107 2286 8657 .L0108 ;; 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 : menu_selection_color6 = 2 2287 8657 2288 8657 ad 4d 01 LDA menu_yposition 2289 865a c9 08 CMP #8 2290 865c d0 18 BNE .skipL0108 2291 865e .condpart30 2292 865e a9 02 LDA #2 2293 8660 8d 52 01 STA menu_selection_color1 2294 8663 8d 53 01 STA menu_selection_color2 2295 8666 8d 54 01 STA menu_selection_color3 2296 8669 a9 07 LDA #7 2297 866b 8d 55 01 STA menu_selection_color4 2298 866e a9 02 LDA #2 2299 8670 8d 56 01 STA menu_selection_color5 2300 8673 8d 58 01 STA menu_selection_color6 2301 8676 .skipL0108 2302 8676 .L0109 ;; 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 : menu_selection_color6 = 2 2303 8676 2304 8676 ad 4d 01 LDA menu_yposition 2305 8679 c9 09 CMP #9 2306 867b d0 18 BNE .skipL0109 2307 867d .condpart31 2308 867d a9 02 LDA #2 2309 867f 8d 52 01 STA menu_selection_color1 2310 8682 8d 53 01 STA menu_selection_color2 2311 8685 8d 54 01 STA menu_selection_color3 2312 8688 8d 55 01 STA menu_selection_color4 2313 868b a9 07 LDA #7 2314 868d 8d 56 01 STA menu_selection_color5 2315 8690 a9 02 LDA #2 2316 8692 8d 58 01 STA menu_selection_color6 2317 8695 .skipL0109 2318 8695 .L0110 ;; if menu_yposition = 10 then menu_selection_color1 = 2 : menu_selection_color2 = 2 : menu_selection_color3 = 2 : menu_selection_color4 = 2 : menu_selection_color5 = 2 : menu_selection_color6 = 7 2319 8695 2320 8695 ad 4d 01 LDA menu_yposition 2321 8698 c9 0a CMP #10 2322 869a d0 16 BNE .skipL0110 2323 869c .condpart32 2324 869c a9 02 LDA #2 2325 869e 8d 52 01 STA menu_selection_color1 2326 86a1 8d 53 01 STA menu_selection_color2 2327 86a4 8d 54 01 STA menu_selection_color3 2328 86a7 8d 55 01 STA menu_selection_color4 2329 86aa 8d 56 01 STA menu_selection_color5 2330 86ad a9 07 LDA #7 2331 86af 8d 58 01 STA menu_selection_color6 2332 86b2 .skipL0110 2333 86b2 . 2334 86b2 ;; 2335 86b2 2336 86b2 .L0111 ;; plotchars 'skill:' 0 28 5 2337 86b2 2338 86b2 4c bb 86 JMP skipalphadata15 2339 86b5 alphadata15 2340 86b5 5e .byte.b (alphadata15 2351 86c1 85 43 sta temp2 2352 86c3 2353 86c3 a9 1a lda #26 ; width in two's complement 2354 86c5 09 00 ora #0 ; palette left shifted 5 bits 2355 86c7 85 44 sta temp3 2356 86c9 a9 1c lda #28 2357 86cb 85 45 sta temp4 2358 86cd 2359 86cd a9 05 lda #5 2360 86cf 2361 86cf 85 46 sta temp5 2362 86d1 2363 86d1 20 7a f3 jsr plotcharacters 2364 86d4 .L0112 ;; plotchars 'lives:' 0 28 6 2365 86d4 2366 86d4 4c dd 86 JMP skipalphadata16 2367 86d7 alphadata16 2368 86d7 57 .byte.b (alphadata16 2379 86e3 85 43 sta temp2 2380 86e5 2381 86e5 a9 1a lda #26 ; width in two's complement 2382 86e7 09 00 ora #0 ; palette left shifted 5 bits 2383 86e9 85 44 sta temp3 2384 86eb a9 1c lda #28 2385 86ed 85 45 sta temp4 2386 86ef 2387 86ef a9 06 lda #6 2388 86f1 2389 86f1 85 46 sta temp5 2390 86f3 2391 86f3 20 7a f3 jsr plotcharacters 2392 86f6 .L0113 ;; plotchars 'level:' 0 28 7 2393 86f6 2394 86f6 4c ff 86 JMP skipalphadata17 2395 86f9 alphadata17 2396 86f9 57 .byte.b (alphadata17 2407 8705 85 43 sta temp2 2408 8707 2409 8707 a9 1a lda #26 ; width in two's complement 2410 8709 09 00 ora #0 ; palette left shifted 5 bits 2411 870b 85 44 sta temp3 2412 870d a9 1c lda #28 2413 870f 85 45 sta temp4 2414 8711 2415 8711 a9 07 lda #7 2416 8713 2417 8713 85 46 sta temp5 2418 8715 2419 8715 20 7a f3 jsr plotcharacters 2420 8718 .L0114 ;; plotchars 'time^trial:' 0 28 8 2421 8718 2422 8718 4c 26 87 JMP skipalphadata18 2423 871b alphadata18 2424 871b 5f .byte.b (alphadata18 2440 872c 85 43 sta temp2 2441 872e 2442 872e a9 15 lda #21 ; width in two's complement 2443 8730 09 00 ora #0 ; palette left shifted 5 bits 2444 8732 85 44 sta temp3 2445 8734 a9 1c lda #28 2446 8736 85 45 sta temp4 2447 8738 2448 8738 a9 08 lda #8 2449 873a 2450 873a 85 46 sta temp5 2451 873c 2452 873c 20 7a f3 jsr plotcharacters 2453 873f .L0115 ;; plotchars 'players:' 0 28 9 2454 873f 2455 873f 4c 4a 87 JMP skipalphadata19 2456 8742 alphadata19 2457 8742 5b .byte.b (alphadata19 2470 8750 85 43 sta temp2 2471 8752 2472 8752 a9 18 lda #24 ; width in two's complement 2473 8754 09 00 ora #0 ; palette left shifted 5 bits 2474 8756 85 44 sta temp3 2475 8758 a9 1c lda #28 2476 875a 85 45 sta temp4 2477 875c 2478 875c a9 09 lda #9 2479 875e 2480 875e 85 46 sta temp5 2481 8760 2482 8760 20 7a f3 jsr plotcharacters 2483 8763 .L0116 ;; plotchars 'start^game' 0 28 10 2484 8763 2485 8763 4c 70 87 JMP skipalphadata20 2486 8766 alphadata20 2487 8766 5e .byte.b (alphadata20 2502 8776 85 43 sta temp2 2503 8778 2504 8778 a9 16 lda #22 ; width in two's complement 2505 877a 09 00 ora #0 ; palette left shifted 5 bits 2506 877c 85 44 sta temp3 2507 877e a9 1c lda #28 2508 8780 85 45 sta temp4 2509 8782 2510 8782 a9 0a lda #10 2511 8784 2512 8784 85 46 sta temp5 2513 8786 2514 8786 20 7a f3 jsr plotcharacters 2515 8789 . 2516 8789 ;; 2517 8789 2518 8789 . 2519 8789 ;; 2520 8789 2521 8789 .L0117 ;; if debounce_down = 6 && menu_yposition = 5 then debounce_down = 0 : menu_yposition = 6 2522 8789 2523 8789 ad 42 01 LDA debounce_down 2524 878c c9 06 CMP #6 2525 878e d0 11 BNE .skipL0117 2526 8790 .condpart33 2527 8790 ad 4d 01 LDA menu_yposition 2528 8793 c9 05 CMP #5 2529 8795 d0 0a BNE .skip33then 2530 8797 .condpart34 2531 8797 a9 00 LDA #0 2532 8799 8d 42 01 STA debounce_down 2533 879c a9 06 LDA #6 2534 879e 8d 4d 01 STA menu_yposition 2535 87a1 .skip33then 2536 87a1 .skipL0117 2537 87a1 .L0118 ;; if debounce_down = 6 && menu_yposition = 6 then debounce_down = 0 : menu_yposition = 7 2538 87a1 2539 87a1 ad 42 01 LDA debounce_down 2540 87a4 c9 06 CMP #6 2541 87a6 d0 11 BNE .skipL0118 2542 87a8 .condpart35 2543 87a8 ad 4d 01 LDA menu_yposition 2544 87ab c9 06 CMP #6 2545 87ad d0 0a BNE .skip35then 2546 87af .condpart36 2547 87af a9 00 LDA #0 2548 87b1 8d 42 01 STA debounce_down 2549 87b4 a9 07 LDA #7 2550 87b6 8d 4d 01 STA menu_yposition 2551 87b9 .skip35then 2552 87b9 .skipL0118 2553 87b9 .L0119 ;; if debounce_down = 6 && menu_yposition = 7 then debounce_down = 0 : menu_yposition = 8 2554 87b9 2555 87b9 ad 42 01 LDA debounce_down 2556 87bc c9 06 CMP #6 2557 87be d0 11 BNE .skipL0119 2558 87c0 .condpart37 2559 87c0 ad 4d 01 LDA menu_yposition 2560 87c3 c9 07 CMP #7 2561 87c5 d0 0a BNE .skip37then 2562 87c7 .condpart38 2563 87c7 a9 00 LDA #0 2564 87c9 8d 42 01 STA debounce_down 2565 87cc a9 08 LDA #8 2566 87ce 8d 4d 01 STA menu_yposition 2567 87d1 .skip37then 2568 87d1 .skipL0119 2569 87d1 .L0120 ;; if debounce_down = 6 && menu_yposition = 8 then debounce_down = 0 : menu_yposition = 9 2570 87d1 2571 87d1 ad 42 01 LDA debounce_down 2572 87d4 c9 06 CMP #6 2573 87d6 d0 11 BNE .skipL0120 2574 87d8 .condpart39 2575 87d8 ad 4d 01 LDA menu_yposition 2576 87db c9 08 CMP #8 2577 87dd d0 0a BNE .skip39then 2578 87df .condpart40 2579 87df a9 00 LDA #0 2580 87e1 8d 42 01 STA debounce_down 2581 87e4 a9 09 LDA #9 2582 87e6 8d 4d 01 STA menu_yposition 2583 87e9 .skip39then 2584 87e9 .skipL0120 2585 87e9 .L0121 ;; if debounce_down = 6 && menu_yposition = 9 then debounce_down = 0 : menu_yposition = 10 2586 87e9 2587 87e9 ad 42 01 LDA debounce_down 2588 87ec c9 06 CMP #6 2589 87ee d0 11 BNE .skipL0121 2590 87f0 .condpart41 2591 87f0 ad 4d 01 LDA menu_yposition 2592 87f3 c9 09 CMP #9 2593 87f5 d0 0a BNE .skip41then 2594 87f7 .condpart42 2595 87f7 a9 00 LDA #0 2596 87f9 8d 42 01 STA debounce_down 2597 87fc a9 0a LDA #10 2598 87fe 8d 4d 01 STA menu_yposition 2599 8801 .skip41then 2600 8801 .skipL0121 2601 8801 .L0122 ;; if debounce_down = 6 && menu_yposition = 10 then debounce_down = 0 : menu_yposition = 10 2602 8801 2603 8801 ad 42 01 LDA debounce_down 2604 8804 c9 06 CMP #6 2605 8806 d0 11 BNE .skipL0122 2606 8808 .condpart43 2607 8808 ad 4d 01 LDA menu_yposition 2608 880b c9 0a CMP #10 2609 880d d0 0a BNE .skip43then 2610 880f .condpart44 2611 880f a9 00 LDA #0 2612 8811 8d 42 01 STA debounce_down 2613 8814 a9 0a LDA #10 2614 8816 8d 4d 01 STA menu_yposition 2615 8819 .skip43then 2616 8819 .skipL0122 2617 8819 . 2618 8819 ;; 2619 8819 2620 8819 .L0123 ;; if debounce_up = 6 && menu_yposition = 9 then debounce_up = 0 : menu_yposition = 10 2621 8819 2622 8819 ad 41 01 LDA debounce_up 2623 881c c9 06 CMP #6 2624 881e d0 11 BNE .skipL0123 2625 8820 .condpart45 2626 8820 ad 4d 01 LDA menu_yposition 2627 8823 c9 09 CMP #9 2628 8825 d0 0a BNE .skip45then 2629 8827 .condpart46 2630 8827 a9 00 LDA #0 2631 8829 8d 41 01 STA debounce_up 2632 882c a9 0a LDA #10 2633 882e 8d 4d 01 STA menu_yposition 2634 8831 .skip45then 2635 8831 .skipL0123 2636 8831 .L0124 ;; if debounce_up = 6 && menu_yposition = 8 then debounce_up = 0 : menu_yposition = 9 2637 8831 2638 8831 ad 41 01 LDA debounce_up 2639 8834 c9 06 CMP #6 2640 8836 d0 11 BNE .skipL0124 2641 8838 .condpart47 2642 8838 ad 4d 01 LDA menu_yposition 2643 883b c9 08 CMP #8 2644 883d d0 0a BNE .skip47then 2645 883f .condpart48 2646 883f a9 00 LDA #0 2647 8841 8d 41 01 STA debounce_up 2648 8844 a9 09 LDA #9 2649 8846 8d 4d 01 STA menu_yposition 2650 8849 .skip47then 2651 8849 .skipL0124 2652 8849 .L0125 ;; if debounce_up = 6 && menu_yposition = 7 then debounce_up = 0 : menu_yposition = 8 2653 8849 2654 8849 ad 41 01 LDA debounce_up 2655 884c c9 06 CMP #6 2656 884e d0 11 BNE .skipL0125 2657 8850 .condpart49 2658 8850 ad 4d 01 LDA menu_yposition 2659 8853 c9 07 CMP #7 2660 8855 d0 0a BNE .skip49then 2661 8857 .condpart50 2662 8857 a9 00 LDA #0 2663 8859 8d 41 01 STA debounce_up 2664 885c a9 08 LDA #8 2665 885e 8d 4d 01 STA menu_yposition 2666 8861 .skip49then 2667 8861 .skipL0125 2668 8861 .L0126 ;; if debounce_up = 6 && menu_yposition = 6 then debounce_up = 0 : menu_yposition = 7 2669 8861 2670 8861 ad 41 01 LDA debounce_up 2671 8864 c9 06 CMP #6 2672 8866 d0 11 BNE .skipL0126 2673 8868 .condpart51 2674 8868 ad 4d 01 LDA menu_yposition 2675 886b c9 06 CMP #6 2676 886d d0 0a BNE .skip51then 2677 886f .condpart52 2678 886f a9 00 LDA #0 2679 8871 8d 41 01 STA debounce_up 2680 8874 a9 07 LDA #7 2681 8876 8d 4d 01 STA menu_yposition 2682 8879 .skip51then 2683 8879 .skipL0126 2684 8879 .L0127 ;; if debounce_up = 6 && menu_yposition = 5 then debounce_up = 0 : menu_yposition = 6 2685 8879 2686 8879 ad 41 01 LDA debounce_up 2687 887c c9 06 CMP #6 2688 887e d0 11 BNE .skipL0127 2689 8880 .condpart53 2690 8880 ad 4d 01 LDA menu_yposition 2691 8883 c9 05 CMP #5 2692 8885 d0 0a BNE .skip53then 2693 8887 .condpart54 2694 8887 a9 00 LDA #0 2695 8889 8d 41 01 STA debounce_up 2696 888c a9 06 LDA #6 2697 888e 8d 4d 01 STA menu_yposition 2698 8891 .skip53then 2699 8891 .skipL0127 2700 8891 .L0128 ;; if debounce_up = 6 && menu_yposition = 5 then debounce_up = 0 : menu_yposition = 5 2701 8891 2702 8891 ad 41 01 LDA debounce_up 2703 8894 c9 06 CMP #6 2704 8896 d0 11 BNE .skipL0128 2705 8898 .condpart55 2706 8898 ad 4d 01 LDA menu_yposition 2707 889b c9 05 CMP #5 2708 889d d0 0a BNE .skip55then 2709 889f .condpart56 2710 889f a9 00 LDA #0 2711 88a1 8d 41 01 STA debounce_up 2712 88a4 a9 05 LDA #5 2713 88a6 8d 4d 01 STA menu_yposition 2714 88a9 .skip55then 2715 88a9 .skipL0128 2716 88a9 . 2717 88a9 ;; 2718 88a9 2719 88a9 . 2720 88a9 ;; 2721 88a9 2722 88a9 .L0129 ;; if menu_yposition = 5 && debounce_right = 6 && menu_option_skill = 1 then menu_option_skill = 2 : debounce_right = 0 : playsfx sfx_bling 2723 88a9 2724 88a9 ad 4d 01 LDA menu_yposition 2725 88ac c9 05 CMP #5 2726 88ae d0 31 BNE .skipL0129 2727 88b0 .condpart57 2728 88b0 ad 44 01 LDA debounce_right 2729 88b3 c9 06 CMP #6 2730 88b5 d0 2a BNE .skip57then 2731 88b7 .condpart58 2732 88b7 ad 4e 01 LDA menu_option_skill 2733 88ba c9 01 CMP #1 2734 88bc d0 23 BNE .skip58then 2735 88be .condpart59 2736 88be a9 02 LDA #2 2737 88c0 8d 4e 01 STA menu_option_skill 2738 88c3 a9 00 LDA #0 2739 88c5 8d 44 01 STA debounce_right 2740 88c8 ifnconst NOTIALOCKMUTE 2741 88c8 a9 01 lda #1 2742 88ca 85 de sta sfxschedulelock 2743 88cc a9 49 lda #sfx_bling 2746 88d2 85 e1 sta sfxinstrumenthi 2747 88d4 a9 00 lda #0 2748 88d6 85 e2 sta sfxpitchoffset ; no pitch modification 2749 88d8 85 e3 sta sfxnoteindex ; not a musical note 2750 88da 20 81 f2 jsr schedulesfx 2751 88dd a9 00 lda #0 2752 88df 85 de sta sfxschedulelock 2753 88e1 endif ; NOTIALOCKMUTE 2754 88e1 .skip58then 2755 88e1 .skip57then 2756 88e1 .skipL0129 2757 88e1 .L0130 ;; if menu_yposition = 5 && debounce_right = 6 && menu_option_skill = 2 then menu_option_skill = 3 : debounce_right = 0 : playsfx sfx_bling 2758 88e1 2759 88e1 ad 4d 01 LDA menu_yposition 2760 88e4 c9 05 CMP #5 2761 88e6 d0 31 BNE .skipL0130 2762 88e8 .condpart60 2763 88e8 ad 44 01 LDA debounce_right 2764 88eb c9 06 CMP #6 2765 88ed d0 2a BNE .skip60then 2766 88ef .condpart61 2767 88ef ad 4e 01 LDA menu_option_skill 2768 88f2 c9 02 CMP #2 2769 88f4 d0 23 BNE .skip61then 2770 88f6 .condpart62 2771 88f6 a9 03 LDA #3 2772 88f8 8d 4e 01 STA menu_option_skill 2773 88fb a9 00 LDA #0 2774 88fd 8d 44 01 STA debounce_right 2775 8900 ifnconst NOTIALOCKMUTE 2776 8900 a9 01 lda #1 2777 8902 85 de sta sfxschedulelock 2778 8904 a9 49 lda #sfx_bling 2781 890a 85 e1 sta sfxinstrumenthi 2782 890c a9 00 lda #0 2783 890e 85 e2 sta sfxpitchoffset ; no pitch modification 2784 8910 85 e3 sta sfxnoteindex ; not a musical note 2785 8912 20 81 f2 jsr schedulesfx 2786 8915 a9 00 lda #0 2787 8917 85 de sta sfxschedulelock 2788 8919 endif ; NOTIALOCKMUTE 2789 8919 .skip61then 2790 8919 .skip60then 2791 8919 .skipL0130 2792 8919 .L0131 ;; if menu_yposition = 5 && debounce_right = 6 && menu_option_skill = 3 then menu_option_skill = 1 : debounce_right = 0 : playsfx sfx_bling 2793 8919 2794 8919 ad 4d 01 LDA menu_yposition 2795 891c c9 05 CMP #5 2796 891e d0 31 BNE .skipL0131 2797 8920 .condpart63 2798 8920 ad 44 01 LDA debounce_right 2799 8923 c9 06 CMP #6 2800 8925 d0 2a BNE .skip63then 2801 8927 .condpart64 2802 8927 ad 4e 01 LDA menu_option_skill 2803 892a c9 03 CMP #3 2804 892c d0 23 BNE .skip64then 2805 892e .condpart65 2806 892e a9 01 LDA #1 2807 8930 8d 4e 01 STA menu_option_skill 2808 8933 a9 00 LDA #0 2809 8935 8d 44 01 STA debounce_right 2810 8938 ifnconst NOTIALOCKMUTE 2811 8938 a9 01 lda #1 2812 893a 85 de sta sfxschedulelock 2813 893c a9 49 lda #sfx_bling 2816 8942 85 e1 sta sfxinstrumenthi 2817 8944 a9 00 lda #0 2818 8946 85 e2 sta sfxpitchoffset ; no pitch modification 2819 8948 85 e3 sta sfxnoteindex ; not a musical note 2820 894a 20 81 f2 jsr schedulesfx 2821 894d a9 00 lda #0 2822 894f 85 de sta sfxschedulelock 2823 8951 endif ; NOTIALOCKMUTE 2824 8951 .skip64then 2825 8951 .skip63then 2826 8951 .skipL0131 2827 8951 .L0132 ;; if menu_yposition = 5 && debounce_left = 6 && menu_option_skill = 1 then menu_option_skill = 3 : debounce_left = 0 : playsfx sfx_bling 2828 8951 2829 8951 ad 4d 01 LDA menu_yposition 2830 8954 c9 05 CMP #5 2831 8956 d0 31 BNE .skipL0132 2832 8958 .condpart66 2833 8958 ad 43 01 LDA debounce_left 2834 895b c9 06 CMP #6 2835 895d d0 2a BNE .skip66then 2836 895f .condpart67 2837 895f ad 4e 01 LDA menu_option_skill 2838 8962 c9 01 CMP #1 2839 8964 d0 23 BNE .skip67then 2840 8966 .condpart68 2841 8966 a9 03 LDA #3 2842 8968 8d 4e 01 STA menu_option_skill 2843 896b a9 00 LDA #0 2844 896d 8d 43 01 STA debounce_left 2845 8970 ifnconst NOTIALOCKMUTE 2846 8970 a9 01 lda #1 2847 8972 85 de sta sfxschedulelock 2848 8974 a9 49 lda #sfx_bling 2851 897a 85 e1 sta sfxinstrumenthi 2852 897c a9 00 lda #0 2853 897e 85 e2 sta sfxpitchoffset ; no pitch modification 2854 8980 85 e3 sta sfxnoteindex ; not a musical note 2855 8982 20 81 f2 jsr schedulesfx 2856 8985 a9 00 lda #0 2857 8987 85 de sta sfxschedulelock 2858 8989 endif ; NOTIALOCKMUTE 2859 8989 .skip67then 2860 8989 .skip66then 2861 8989 .skipL0132 2862 8989 .L0133 ;; if menu_yposition = 5 && debounce_left = 6 && menu_option_skill = 2 then menu_option_skill = 1 : debounce_left = 0 : playsfx sfx_bling 2863 8989 2864 8989 ad 4d 01 LDA menu_yposition 2865 898c c9 05 CMP #5 2866 898e d0 31 BNE .skipL0133 2867 8990 .condpart69 2868 8990 ad 43 01 LDA debounce_left 2869 8993 c9 06 CMP #6 2870 8995 d0 2a BNE .skip69then 2871 8997 .condpart70 2872 8997 ad 4e 01 LDA menu_option_skill 2873 899a c9 02 CMP #2 2874 899c d0 23 BNE .skip70then 2875 899e .condpart71 2876 899e a9 01 LDA #1 2877 89a0 8d 4e 01 STA menu_option_skill 2878 89a3 a9 00 LDA #0 2879 89a5 8d 43 01 STA debounce_left 2880 89a8 ifnconst NOTIALOCKMUTE 2881 89a8 a9 01 lda #1 2882 89aa 85 de sta sfxschedulelock 2883 89ac a9 49 lda #sfx_bling 2886 89b2 85 e1 sta sfxinstrumenthi 2887 89b4 a9 00 lda #0 2888 89b6 85 e2 sta sfxpitchoffset ; no pitch modification 2889 89b8 85 e3 sta sfxnoteindex ; not a musical note 2890 89ba 20 81 f2 jsr schedulesfx 2891 89bd a9 00 lda #0 2892 89bf 85 de sta sfxschedulelock 2893 89c1 endif ; NOTIALOCKMUTE 2894 89c1 .skip70then 2895 89c1 .skip69then 2896 89c1 .skipL0133 2897 89c1 .L0134 ;; if menu_yposition = 5 && debounce_left = 6 && menu_option_skill = 3 then menu_option_skill = 2 : debounce_left = 0 : playsfx sfx_bling 2898 89c1 2899 89c1 ad 4d 01 LDA menu_yposition 2900 89c4 c9 05 CMP #5 2901 89c6 d0 31 BNE .skipL0134 2902 89c8 .condpart72 2903 89c8 ad 43 01 LDA debounce_left 2904 89cb c9 06 CMP #6 2905 89cd d0 2a BNE .skip72then 2906 89cf .condpart73 2907 89cf ad 4e 01 LDA menu_option_skill 2908 89d2 c9 03 CMP #3 2909 89d4 d0 23 BNE .skip73then 2910 89d6 .condpart74 2911 89d6 a9 02 LDA #2 2912 89d8 8d 4e 01 STA menu_option_skill 2913 89db a9 00 LDA #0 2914 89dd 8d 43 01 STA debounce_left 2915 89e0 ifnconst NOTIALOCKMUTE 2916 89e0 a9 01 lda #1 2917 89e2 85 de sta sfxschedulelock 2918 89e4 a9 49 lda #sfx_bling 2921 89ea 85 e1 sta sfxinstrumenthi 2922 89ec a9 00 lda #0 2923 89ee 85 e2 sta sfxpitchoffset ; no pitch modification 2924 89f0 85 e3 sta sfxnoteindex ; not a musical note 2925 89f2 20 81 f2 jsr schedulesfx 2926 89f5 a9 00 lda #0 2927 89f7 85 de sta sfxschedulelock 2928 89f9 endif ; NOTIALOCKMUTE 2929 89f9 .skip73then 2930 89f9 .skip72then 2931 89f9 .skipL0134 2932 89f9 . 2933 89f9 ;; 2934 89f9 2935 89f9 .L0135 ;; if menu_yposition = 6 && debounce_right = 6 && menu_option_lives = 1 then menu_option_lives = 2 : debounce_right = 0 : playsfx sfx_bling 2936 89f9 2937 89f9 ad 4d 01 LDA menu_yposition 2938 89fc c9 06 CMP #6 2939 89fe d0 31 BNE .skipL0135 2940 8a00 .condpart75 2941 8a00 ad 44 01 LDA debounce_right 2942 8a03 c9 06 CMP #6 2943 8a05 d0 2a BNE .skip75then 2944 8a07 .condpart76 2945 8a07 ad 4f 01 LDA menu_option_lives 2946 8a0a c9 01 CMP #1 2947 8a0c d0 23 BNE .skip76then 2948 8a0e .condpart77 2949 8a0e a9 02 LDA #2 2950 8a10 8d 4f 01 STA menu_option_lives 2951 8a13 a9 00 LDA #0 2952 8a15 8d 44 01 STA debounce_right 2953 8a18 ifnconst NOTIALOCKMUTE 2954 8a18 a9 01 lda #1 2955 8a1a 85 de sta sfxschedulelock 2956 8a1c a9 49 lda #sfx_bling 2959 8a22 85 e1 sta sfxinstrumenthi 2960 8a24 a9 00 lda #0 2961 8a26 85 e2 sta sfxpitchoffset ; no pitch modification 2962 8a28 85 e3 sta sfxnoteindex ; not a musical note 2963 8a2a 20 81 f2 jsr schedulesfx 2964 8a2d a9 00 lda #0 2965 8a2f 85 de sta sfxschedulelock 2966 8a31 endif ; NOTIALOCKMUTE 2967 8a31 .skip76then 2968 8a31 .skip75then 2969 8a31 .skipL0135 2970 8a31 .L0136 ;; if menu_yposition = 6 && debounce_right = 6 && menu_option_lives = 2 then menu_option_lives = 3 : debounce_right = 0 : playsfx sfx_bling 2971 8a31 2972 8a31 ad 4d 01 LDA menu_yposition 2973 8a34 c9 06 CMP #6 2974 8a36 d0 31 BNE .skipL0136 2975 8a38 .condpart78 2976 8a38 ad 44 01 LDA debounce_right 2977 8a3b c9 06 CMP #6 2978 8a3d d0 2a BNE .skip78then 2979 8a3f .condpart79 2980 8a3f ad 4f 01 LDA menu_option_lives 2981 8a42 c9 02 CMP #2 2982 8a44 d0 23 BNE .skip79then 2983 8a46 .condpart80 2984 8a46 a9 03 LDA #3 2985 8a48 8d 4f 01 STA menu_option_lives 2986 8a4b a9 00 LDA #0 2987 8a4d 8d 44 01 STA debounce_right 2988 8a50 ifnconst NOTIALOCKMUTE 2989 8a50 a9 01 lda #1 2990 8a52 85 de sta sfxschedulelock 2991 8a54 a9 49 lda #sfx_bling 2994 8a5a 85 e1 sta sfxinstrumenthi 2995 8a5c a9 00 lda #0 2996 8a5e 85 e2 sta sfxpitchoffset ; no pitch modification 2997 8a60 85 e3 sta sfxnoteindex ; not a musical note 2998 8a62 20 81 f2 jsr schedulesfx 2999 8a65 a9 00 lda #0 3000 8a67 85 de sta sfxschedulelock 3001 8a69 endif ; NOTIALOCKMUTE 3002 8a69 .skip79then 3003 8a69 .skip78then 3004 8a69 .skipL0136 3005 8a69 .L0137 ;; if menu_yposition = 6 && debounce_right = 6 && menu_option_lives = 3 then menu_option_lives = 1 : debounce_right = 0 : playsfx sfx_bling 3006 8a69 3007 8a69 ad 4d 01 LDA menu_yposition 3008 8a6c c9 06 CMP #6 3009 8a6e d0 31 BNE .skipL0137 3010 8a70 .condpart81 3011 8a70 ad 44 01 LDA debounce_right 3012 8a73 c9 06 CMP #6 3013 8a75 d0 2a BNE .skip81then 3014 8a77 .condpart82 3015 8a77 ad 4f 01 LDA menu_option_lives 3016 8a7a c9 03 CMP #3 3017 8a7c d0 23 BNE .skip82then 3018 8a7e .condpart83 3019 8a7e a9 01 LDA #1 3020 8a80 8d 4f 01 STA menu_option_lives 3021 8a83 a9 00 LDA #0 3022 8a85 8d 44 01 STA debounce_right 3023 8a88 ifnconst NOTIALOCKMUTE 3024 8a88 a9 01 lda #1 3025 8a8a 85 de sta sfxschedulelock 3026 8a8c a9 49 lda #sfx_bling 3029 8a92 85 e1 sta sfxinstrumenthi 3030 8a94 a9 00 lda #0 3031 8a96 85 e2 sta sfxpitchoffset ; no pitch modification 3032 8a98 85 e3 sta sfxnoteindex ; not a musical note 3033 8a9a 20 81 f2 jsr schedulesfx 3034 8a9d a9 00 lda #0 3035 8a9f 85 de sta sfxschedulelock 3036 8aa1 endif ; NOTIALOCKMUTE 3037 8aa1 .skip82then 3038 8aa1 .skip81then 3039 8aa1 .skipL0137 3040 8aa1 .L0138 ;; if menu_yposition = 6 && debounce_left = 6 && menu_option_lives = 1 then menu_option_lives = 2 : debounce_left = 0 : playsfx sfx_bling 3041 8aa1 3042 8aa1 ad 4d 01 LDA menu_yposition 3043 8aa4 c9 06 CMP #6 3044 8aa6 d0 31 BNE .skipL0138 3045 8aa8 .condpart84 3046 8aa8 ad 43 01 LDA debounce_left 3047 8aab c9 06 CMP #6 3048 8aad d0 2a BNE .skip84then 3049 8aaf .condpart85 3050 8aaf ad 4f 01 LDA menu_option_lives 3051 8ab2 c9 01 CMP #1 3052 8ab4 d0 23 BNE .skip85then 3053 8ab6 .condpart86 3054 8ab6 a9 02 LDA #2 3055 8ab8 8d 4f 01 STA menu_option_lives 3056 8abb a9 00 LDA #0 3057 8abd 8d 43 01 STA debounce_left 3058 8ac0 ifnconst NOTIALOCKMUTE 3059 8ac0 a9 01 lda #1 3060 8ac2 85 de sta sfxschedulelock 3061 8ac4 a9 49 lda #sfx_bling 3064 8aca 85 e1 sta sfxinstrumenthi 3065 8acc a9 00 lda #0 3066 8ace 85 e2 sta sfxpitchoffset ; no pitch modification 3067 8ad0 85 e3 sta sfxnoteindex ; not a musical note 3068 8ad2 20 81 f2 jsr schedulesfx 3069 8ad5 a9 00 lda #0 3070 8ad7 85 de sta sfxschedulelock 3071 8ad9 endif ; NOTIALOCKMUTE 3072 8ad9 .skip85then 3073 8ad9 .skip84then 3074 8ad9 .skipL0138 3075 8ad9 .L0139 ;; if menu_yposition = 6 && debounce_left = 6 && menu_option_lives = 2 then menu_option_lives = 3 : debounce_left = 0 : playsfx sfx_bling 3076 8ad9 3077 8ad9 ad 4d 01 LDA menu_yposition 3078 8adc c9 06 CMP #6 3079 8ade d0 31 BNE .skipL0139 3080 8ae0 .condpart87 3081 8ae0 ad 43 01 LDA debounce_left 3082 8ae3 c9 06 CMP #6 3083 8ae5 d0 2a BNE .skip87then 3084 8ae7 .condpart88 3085 8ae7 ad 4f 01 LDA menu_option_lives 3086 8aea c9 02 CMP #2 3087 8aec d0 23 BNE .skip88then 3088 8aee .condpart89 3089 8aee a9 03 LDA #3 3090 8af0 8d 4f 01 STA menu_option_lives 3091 8af3 a9 00 LDA #0 3092 8af5 8d 43 01 STA debounce_left 3093 8af8 ifnconst NOTIALOCKMUTE 3094 8af8 a9 01 lda #1 3095 8afa 85 de sta sfxschedulelock 3096 8afc a9 49 lda #sfx_bling 3099 8b02 85 e1 sta sfxinstrumenthi 3100 8b04 a9 00 lda #0 3101 8b06 85 e2 sta sfxpitchoffset ; no pitch modification 3102 8b08 85 e3 sta sfxnoteindex ; not a musical note 3103 8b0a 20 81 f2 jsr schedulesfx 3104 8b0d a9 00 lda #0 3105 8b0f 85 de sta sfxschedulelock 3106 8b11 endif ; NOTIALOCKMUTE 3107 8b11 .skip88then 3108 8b11 .skip87then 3109 8b11 .skipL0139 3110 8b11 .L0140 ;; if menu_yposition = 6 && debounce_left = 6 && menu_option_lives = 3 then menu_option_lives = 1 : debounce_left = 0 : playsfx sfx_bling 3111 8b11 3112 8b11 ad 4d 01 LDA menu_yposition 3113 8b14 c9 06 CMP #6 3114 8b16 d0 31 BNE .skipL0140 3115 8b18 .condpart90 3116 8b18 ad 43 01 LDA debounce_left 3117 8b1b c9 06 CMP #6 3118 8b1d d0 2a BNE .skip90then 3119 8b1f .condpart91 3120 8b1f ad 4f 01 LDA menu_option_lives 3121 8b22 c9 03 CMP #3 3122 8b24 d0 23 BNE .skip91then 3123 8b26 .condpart92 3124 8b26 a9 01 LDA #1 3125 8b28 8d 4f 01 STA menu_option_lives 3126 8b2b a9 00 LDA #0 3127 8b2d 8d 43 01 STA debounce_left 3128 8b30 ifnconst NOTIALOCKMUTE 3129 8b30 a9 01 lda #1 3130 8b32 85 de sta sfxschedulelock 3131 8b34 a9 49 lda #sfx_bling 3134 8b3a 85 e1 sta sfxinstrumenthi 3135 8b3c a9 00 lda #0 3136 8b3e 85 e2 sta sfxpitchoffset ; no pitch modification 3137 8b40 85 e3 sta sfxnoteindex ; not a musical note 3138 8b42 20 81 f2 jsr schedulesfx 3139 8b45 a9 00 lda #0 3140 8b47 85 de sta sfxschedulelock 3141 8b49 endif ; NOTIALOCKMUTE 3142 8b49 .skip91then 3143 8b49 .skip90then 3144 8b49 .skipL0140 3145 8b49 . 3146 8b49 ;; 3147 8b49 3148 8b49 .L0141 ;; if menu_yposition = 7 && debounce_right = 6 && menu_option_level = 1 then menu_option_level = 2 : debounce_right = 0 : playsfx sfx_bling 3149 8b49 3150 8b49 ad 4d 01 LDA menu_yposition 3151 8b4c c9 07 CMP #7 3152 8b4e d0 31 BNE .skipL0141 3153 8b50 .condpart93 3154 8b50 ad 44 01 LDA debounce_right 3155 8b53 c9 06 CMP #6 3156 8b55 d0 2a BNE .skip93then 3157 8b57 .condpart94 3158 8b57 ad 50 01 LDA menu_option_level 3159 8b5a c9 01 CMP #1 3160 8b5c d0 23 BNE .skip94then 3161 8b5e .condpart95 3162 8b5e a9 02 LDA #2 3163 8b60 8d 50 01 STA menu_option_level 3164 8b63 a9 00 LDA #0 3165 8b65 8d 44 01 STA debounce_right 3166 8b68 ifnconst NOTIALOCKMUTE 3167 8b68 a9 01 lda #1 3168 8b6a 85 de sta sfxschedulelock 3169 8b6c a9 49 lda #sfx_bling 3172 8b72 85 e1 sta sfxinstrumenthi 3173 8b74 a9 00 lda #0 3174 8b76 85 e2 sta sfxpitchoffset ; no pitch modification 3175 8b78 85 e3 sta sfxnoteindex ; not a musical note 3176 8b7a 20 81 f2 jsr schedulesfx 3177 8b7d a9 00 lda #0 3178 8b7f 85 de sta sfxschedulelock 3179 8b81 endif ; NOTIALOCKMUTE 3180 8b81 .skip94then 3181 8b81 .skip93then 3182 8b81 .skipL0141 3183 8b81 .L0142 ;; if menu_yposition = 7 && debounce_right = 6 && menu_option_level = 2 then menu_option_level = 3 : debounce_right = 0 : playsfx sfx_bling 3184 8b81 3185 8b81 ad 4d 01 LDA menu_yposition 3186 8b84 c9 07 CMP #7 3187 8b86 d0 31 BNE .skipL0142 3188 8b88 .condpart96 3189 8b88 ad 44 01 LDA debounce_right 3190 8b8b c9 06 CMP #6 3191 8b8d d0 2a BNE .skip96then 3192 8b8f .condpart97 3193 8b8f ad 50 01 LDA menu_option_level 3194 8b92 c9 02 CMP #2 3195 8b94 d0 23 BNE .skip97then 3196 8b96 .condpart98 3197 8b96 a9 03 LDA #3 3198 8b98 8d 50 01 STA menu_option_level 3199 8b9b a9 00 LDA #0 3200 8b9d 8d 44 01 STA debounce_right 3201 8ba0 ifnconst NOTIALOCKMUTE 3202 8ba0 a9 01 lda #1 3203 8ba2 85 de sta sfxschedulelock 3204 8ba4 a9 49 lda #sfx_bling 3207 8baa 85 e1 sta sfxinstrumenthi 3208 8bac a9 00 lda #0 3209 8bae 85 e2 sta sfxpitchoffset ; no pitch modification 3210 8bb0 85 e3 sta sfxnoteindex ; not a musical note 3211 8bb2 20 81 f2 jsr schedulesfx 3212 8bb5 a9 00 lda #0 3213 8bb7 85 de sta sfxschedulelock 3214 8bb9 endif ; NOTIALOCKMUTE 3215 8bb9 .skip97then 3216 8bb9 .skip96then 3217 8bb9 .skipL0142 3218 8bb9 .L0143 ;; if menu_yposition = 7 && debounce_right = 6 && menu_option_level = 3 then menu_option_level = 1 : debounce_right = 0 : playsfx sfx_bling 3219 8bb9 3220 8bb9 ad 4d 01 LDA menu_yposition 3221 8bbc c9 07 CMP #7 3222 8bbe d0 31 BNE .skipL0143 3223 8bc0 .condpart99 3224 8bc0 ad 44 01 LDA debounce_right 3225 8bc3 c9 06 CMP #6 3226 8bc5 d0 2a BNE .skip99then 3227 8bc7 .condpart100 3228 8bc7 ad 50 01 LDA menu_option_level 3229 8bca c9 03 CMP #3 3230 8bcc d0 23 BNE .skip100then 3231 8bce .condpart101 3232 8bce a9 01 LDA #1 3233 8bd0 8d 50 01 STA menu_option_level 3234 8bd3 a9 00 LDA #0 3235 8bd5 8d 44 01 STA debounce_right 3236 8bd8 ifnconst NOTIALOCKMUTE 3237 8bd8 a9 01 lda #1 3238 8bda 85 de sta sfxschedulelock 3239 8bdc a9 49 lda #sfx_bling 3242 8be2 85 e1 sta sfxinstrumenthi 3243 8be4 a9 00 lda #0 3244 8be6 85 e2 sta sfxpitchoffset ; no pitch modification 3245 8be8 85 e3 sta sfxnoteindex ; not a musical note 3246 8bea 20 81 f2 jsr schedulesfx 3247 8bed a9 00 lda #0 3248 8bef 85 de sta sfxschedulelock 3249 8bf1 endif ; NOTIALOCKMUTE 3250 8bf1 .skip100then 3251 8bf1 .skip99then 3252 8bf1 .skipL0143 3253 8bf1 .L0144 ;; if menu_yposition = 7 && debounce_left = 6 && menu_option_level = 1 then menu_option_level = 2 : debounce_left = 0 : playsfx sfx_bling 3254 8bf1 3255 8bf1 ad 4d 01 LDA menu_yposition 3256 8bf4 c9 07 CMP #7 3257 8bf6 d0 31 BNE .skipL0144 3258 8bf8 .condpart102 3259 8bf8 ad 43 01 LDA debounce_left 3260 8bfb c9 06 CMP #6 3261 8bfd d0 2a BNE .skip102then 3262 8bff .condpart103 3263 8bff ad 50 01 LDA menu_option_level 3264 8c02 c9 01 CMP #1 3265 8c04 d0 23 BNE .skip103then 3266 8c06 .condpart104 3267 8c06 a9 02 LDA #2 3268 8c08 8d 50 01 STA menu_option_level 3269 8c0b a9 00 LDA #0 3270 8c0d 8d 43 01 STA debounce_left 3271 8c10 ifnconst NOTIALOCKMUTE 3272 8c10 a9 01 lda #1 3273 8c12 85 de sta sfxschedulelock 3274 8c14 a9 49 lda #sfx_bling 3277 8c1a 85 e1 sta sfxinstrumenthi 3278 8c1c a9 00 lda #0 3279 8c1e 85 e2 sta sfxpitchoffset ; no pitch modification 3280 8c20 85 e3 sta sfxnoteindex ; not a musical note 3281 8c22 20 81 f2 jsr schedulesfx 3282 8c25 a9 00 lda #0 3283 8c27 85 de sta sfxschedulelock 3284 8c29 endif ; NOTIALOCKMUTE 3285 8c29 .skip103then 3286 8c29 .skip102then 3287 8c29 .skipL0144 3288 8c29 .L0145 ;; if menu_yposition = 7 && debounce_left = 6 && menu_option_level = 2 then menu_option_level = 3 : debounce_left = 0 : playsfx sfx_bling 3289 8c29 3290 8c29 ad 4d 01 LDA menu_yposition 3291 8c2c c9 07 CMP #7 3292 8c2e d0 31 BNE .skipL0145 3293 8c30 .condpart105 3294 8c30 ad 43 01 LDA debounce_left 3295 8c33 c9 06 CMP #6 3296 8c35 d0 2a BNE .skip105then 3297 8c37 .condpart106 3298 8c37 ad 50 01 LDA menu_option_level 3299 8c3a c9 02 CMP #2 3300 8c3c d0 23 BNE .skip106then 3301 8c3e .condpart107 3302 8c3e a9 03 LDA #3 3303 8c40 8d 50 01 STA menu_option_level 3304 8c43 a9 00 LDA #0 3305 8c45 8d 43 01 STA debounce_left 3306 8c48 ifnconst NOTIALOCKMUTE 3307 8c48 a9 01 lda #1 3308 8c4a 85 de sta sfxschedulelock 3309 8c4c a9 49 lda #sfx_bling 3312 8c52 85 e1 sta sfxinstrumenthi 3313 8c54 a9 00 lda #0 3314 8c56 85 e2 sta sfxpitchoffset ; no pitch modification 3315 8c58 85 e3 sta sfxnoteindex ; not a musical note 3316 8c5a 20 81 f2 jsr schedulesfx 3317 8c5d a9 00 lda #0 3318 8c5f 85 de sta sfxschedulelock 3319 8c61 endif ; NOTIALOCKMUTE 3320 8c61 .skip106then 3321 8c61 .skip105then 3322 8c61 .skipL0145 3323 8c61 .L0146 ;; if menu_yposition = 7 && debounce_left = 6 && menu_option_level = 3 then menu_option_level = 1 : debounce_left = 0 : playsfx sfx_bling 3324 8c61 3325 8c61 ad 4d 01 LDA menu_yposition 3326 8c64 c9 07 CMP #7 3327 8c66 d0 31 BNE .skipL0146 3328 8c68 .condpart108 3329 8c68 ad 43 01 LDA debounce_left 3330 8c6b c9 06 CMP #6 3331 8c6d d0 2a BNE .skip108then 3332 8c6f .condpart109 3333 8c6f ad 50 01 LDA menu_option_level 3334 8c72 c9 03 CMP #3 3335 8c74 d0 23 BNE .skip109then 3336 8c76 .condpart110 3337 8c76 a9 01 LDA #1 3338 8c78 8d 50 01 STA menu_option_level 3339 8c7b a9 00 LDA #0 3340 8c7d 8d 43 01 STA debounce_left 3341 8c80 ifnconst NOTIALOCKMUTE 3342 8c80 a9 01 lda #1 3343 8c82 85 de sta sfxschedulelock 3344 8c84 a9 49 lda #sfx_bling 3347 8c8a 85 e1 sta sfxinstrumenthi 3348 8c8c a9 00 lda #0 3349 8c8e 85 e2 sta sfxpitchoffset ; no pitch modification 3350 8c90 85 e3 sta sfxnoteindex ; not a musical note 3351 8c92 20 81 f2 jsr schedulesfx 3352 8c95 a9 00 lda #0 3353 8c97 85 de sta sfxschedulelock 3354 8c99 endif ; NOTIALOCKMUTE 3355 8c99 .skip109then 3356 8c99 .skip108then 3357 8c99 .skipL0146 3358 8c99 . 3359 8c99 ;; 3360 8c99 3361 8c99 .L0147 ;; if menu_yposition = 8 && debounce_right = 6 && menu_option_time = 1 then menu_option_time = 2 : debounce_right = 0 : playsfx sfx_bling 3362 8c99 3363 8c99 ad 4d 01 LDA menu_yposition 3364 8c9c c9 08 CMP #8 3365 8c9e d0 31 BNE .skipL0147 3366 8ca0 .condpart111 3367 8ca0 ad 44 01 LDA debounce_right 3368 8ca3 c9 06 CMP #6 3369 8ca5 d0 2a BNE .skip111then 3370 8ca7 .condpart112 3371 8ca7 ad 51 01 LDA menu_option_time 3372 8caa c9 01 CMP #1 3373 8cac d0 23 BNE .skip112then 3374 8cae .condpart113 3375 8cae a9 02 LDA #2 3376 8cb0 8d 51 01 STA menu_option_time 3377 8cb3 a9 00 LDA #0 3378 8cb5 8d 44 01 STA debounce_right 3379 8cb8 ifnconst NOTIALOCKMUTE 3380 8cb8 a9 01 lda #1 3381 8cba 85 de sta sfxschedulelock 3382 8cbc a9 49 lda #sfx_bling 3385 8cc2 85 e1 sta sfxinstrumenthi 3386 8cc4 a9 00 lda #0 3387 8cc6 85 e2 sta sfxpitchoffset ; no pitch modification 3388 8cc8 85 e3 sta sfxnoteindex ; not a musical note 3389 8cca 20 81 f2 jsr schedulesfx 3390 8ccd a9 00 lda #0 3391 8ccf 85 de sta sfxschedulelock 3392 8cd1 endif ; NOTIALOCKMUTE 3393 8cd1 .skip112then 3394 8cd1 .skip111then 3395 8cd1 .skipL0147 3396 8cd1 .L0148 ;; if menu_yposition = 8 && debounce_right = 6 && menu_option_time = 2 then menu_option_time = 3 : debounce_right = 0 : playsfx sfx_bling 3397 8cd1 3398 8cd1 ad 4d 01 LDA menu_yposition 3399 8cd4 c9 08 CMP #8 3400 8cd6 d0 31 BNE .skipL0148 3401 8cd8 .condpart114 3402 8cd8 ad 44 01 LDA debounce_right 3403 8cdb c9 06 CMP #6 3404 8cdd d0 2a BNE .skip114then 3405 8cdf .condpart115 3406 8cdf ad 51 01 LDA menu_option_time 3407 8ce2 c9 02 CMP #2 3408 8ce4 d0 23 BNE .skip115then 3409 8ce6 .condpart116 3410 8ce6 a9 03 LDA #3 3411 8ce8 8d 51 01 STA menu_option_time 3412 8ceb a9 00 LDA #0 3413 8ced 8d 44 01 STA debounce_right 3414 8cf0 ifnconst NOTIALOCKMUTE 3415 8cf0 a9 01 lda #1 3416 8cf2 85 de sta sfxschedulelock 3417 8cf4 a9 49 lda #sfx_bling 3420 8cfa 85 e1 sta sfxinstrumenthi 3421 8cfc a9 00 lda #0 3422 8cfe 85 e2 sta sfxpitchoffset ; no pitch modification 3423 8d00 85 e3 sta sfxnoteindex ; not a musical note 3424 8d02 20 81 f2 jsr schedulesfx 3425 8d05 a9 00 lda #0 3426 8d07 85 de sta sfxschedulelock 3427 8d09 endif ; NOTIALOCKMUTE 3428 8d09 .skip115then 3429 8d09 .skip114then 3430 8d09 .skipL0148 3431 8d09 .L0149 ;; if menu_yposition = 8 && debounce_right = 6 && menu_option_time = 3 then menu_option_time = 1 : debounce_right = 0 : playsfx sfx_bling 3432 8d09 3433 8d09 ad 4d 01 LDA menu_yposition 3434 8d0c c9 08 CMP #8 3435 8d0e d0 31 BNE .skipL0149 3436 8d10 .condpart117 3437 8d10 ad 44 01 LDA debounce_right 3438 8d13 c9 06 CMP #6 3439 8d15 d0 2a BNE .skip117then 3440 8d17 .condpart118 3441 8d17 ad 51 01 LDA menu_option_time 3442 8d1a c9 03 CMP #3 3443 8d1c d0 23 BNE .skip118then 3444 8d1e .condpart119 3445 8d1e a9 01 LDA #1 3446 8d20 8d 51 01 STA menu_option_time 3447 8d23 a9 00 LDA #0 3448 8d25 8d 44 01 STA debounce_right 3449 8d28 ifnconst NOTIALOCKMUTE 3450 8d28 a9 01 lda #1 3451 8d2a 85 de sta sfxschedulelock 3452 8d2c a9 49 lda #sfx_bling 3455 8d32 85 e1 sta sfxinstrumenthi 3456 8d34 a9 00 lda #0 3457 8d36 85 e2 sta sfxpitchoffset ; no pitch modification 3458 8d38 85 e3 sta sfxnoteindex ; not a musical note 3459 8d3a 20 81 f2 jsr schedulesfx 3460 8d3d a9 00 lda #0 3461 8d3f 85 de sta sfxschedulelock 3462 8d41 endif ; NOTIALOCKMUTE 3463 8d41 .skip118then 3464 8d41 .skip117then 3465 8d41 .skipL0149 3466 8d41 .L0150 ;; if menu_yposition = 8 && debounce_left = 6 && menu_option_time = 1 then menu_option_time = 2 : debounce_left = 0 : playsfx sfx_bling 3467 8d41 3468 8d41 ad 4d 01 LDA menu_yposition 3469 8d44 c9 08 CMP #8 3470 8d46 d0 31 BNE .skipL0150 3471 8d48 .condpart120 3472 8d48 ad 43 01 LDA debounce_left 3473 8d4b c9 06 CMP #6 3474 8d4d d0 2a BNE .skip120then 3475 8d4f .condpart121 3476 8d4f ad 51 01 LDA menu_option_time 3477 8d52 c9 01 CMP #1 3478 8d54 d0 23 BNE .skip121then 3479 8d56 .condpart122 3480 8d56 a9 02 LDA #2 3481 8d58 8d 51 01 STA menu_option_time 3482 8d5b a9 00 LDA #0 3483 8d5d 8d 43 01 STA debounce_left 3484 8d60 ifnconst NOTIALOCKMUTE 3485 8d60 a9 01 lda #1 3486 8d62 85 de sta sfxschedulelock 3487 8d64 a9 49 lda #sfx_bling 3490 8d6a 85 e1 sta sfxinstrumenthi 3491 8d6c a9 00 lda #0 3492 8d6e 85 e2 sta sfxpitchoffset ; no pitch modification 3493 8d70 85 e3 sta sfxnoteindex ; not a musical note 3494 8d72 20 81 f2 jsr schedulesfx 3495 8d75 a9 00 lda #0 3496 8d77 85 de sta sfxschedulelock 3497 8d79 endif ; NOTIALOCKMUTE 3498 8d79 .skip121then 3499 8d79 .skip120then 3500 8d79 .skipL0150 3501 8d79 .L0151 ;; if menu_yposition = 8 && debounce_left = 6 && menu_option_time = 2 then menu_option_time = 3 : debounce_left = 0 : playsfx sfx_bling 3502 8d79 3503 8d79 ad 4d 01 LDA menu_yposition 3504 8d7c c9 08 CMP #8 3505 8d7e d0 31 BNE .skipL0151 3506 8d80 .condpart123 3507 8d80 ad 43 01 LDA debounce_left 3508 8d83 c9 06 CMP #6 3509 8d85 d0 2a BNE .skip123then 3510 8d87 .condpart124 3511 8d87 ad 51 01 LDA menu_option_time 3512 8d8a c9 02 CMP #2 3513 8d8c d0 23 BNE .skip124then 3514 8d8e .condpart125 3515 8d8e a9 03 LDA #3 3516 8d90 8d 51 01 STA menu_option_time 3517 8d93 a9 00 LDA #0 3518 8d95 8d 43 01 STA debounce_left 3519 8d98 ifnconst NOTIALOCKMUTE 3520 8d98 a9 01 lda #1 3521 8d9a 85 de sta sfxschedulelock 3522 8d9c a9 49 lda #sfx_bling 3525 8da2 85 e1 sta sfxinstrumenthi 3526 8da4 a9 00 lda #0 3527 8da6 85 e2 sta sfxpitchoffset ; no pitch modification 3528 8da8 85 e3 sta sfxnoteindex ; not a musical note 3529 8daa 20 81 f2 jsr schedulesfx 3530 8dad a9 00 lda #0 3531 8daf 85 de sta sfxschedulelock 3532 8db1 endif ; NOTIALOCKMUTE 3533 8db1 .skip124then 3534 8db1 .skip123then 3535 8db1 .skipL0151 3536 8db1 .L0152 ;; if menu_yposition = 8 && debounce_left = 6 && menu_option_time = 3 then menu_option_time = 1 : debounce_left = 0 : playsfx sfx_bling 3537 8db1 3538 8db1 ad 4d 01 LDA menu_yposition 3539 8db4 c9 08 CMP #8 3540 8db6 d0 31 BNE .skipL0152 3541 8db8 .condpart126 3542 8db8 ad 43 01 LDA debounce_left 3543 8dbb c9 06 CMP #6 3544 8dbd d0 2a BNE .skip126then 3545 8dbf .condpart127 3546 8dbf ad 51 01 LDA menu_option_time 3547 8dc2 c9 03 CMP #3 3548 8dc4 d0 23 BNE .skip127then 3549 8dc6 .condpart128 3550 8dc6 a9 01 LDA #1 3551 8dc8 8d 51 01 STA menu_option_time 3552 8dcb a9 00 LDA #0 3553 8dcd 8d 43 01 STA debounce_left 3554 8dd0 ifnconst NOTIALOCKMUTE 3555 8dd0 a9 01 lda #1 3556 8dd2 85 de sta sfxschedulelock 3557 8dd4 a9 49 lda #sfx_bling 3560 8dda 85 e1 sta sfxinstrumenthi 3561 8ddc a9 00 lda #0 3562 8dde 85 e2 sta sfxpitchoffset ; no pitch modification 3563 8de0 85 e3 sta sfxnoteindex ; not a musical note 3564 8de2 20 81 f2 jsr schedulesfx 3565 8de5 a9 00 lda #0 3566 8de7 85 de sta sfxschedulelock 3567 8de9 endif ; NOTIALOCKMUTE 3568 8de9 .skip127then 3569 8de9 .skip126then 3570 8de9 .skipL0152 3571 8de9 . 3572 8de9 ;; 3573 8de9 3574 8de9 .L0153 ;; if menu_yposition = 9 && debounce_right = 6 && menu_option_players = 1 then menu_option_players = 2 : debounce_right = 0 : playsfx sfx_bling 3575 8de9 3576 8de9 ad 4d 01 LDA menu_yposition 3577 8dec c9 09 CMP #9 3578 8dee d0 31 BNE .skipL0153 3579 8df0 .condpart129 3580 8df0 ad 44 01 LDA debounce_right 3581 8df3 c9 06 CMP #6 3582 8df5 d0 2a BNE .skip129then 3583 8df7 .condpart130 3584 8df7 ad 57 01 LDA menu_option_players 3585 8dfa c9 01 CMP #1 3586 8dfc d0 23 BNE .skip130then 3587 8dfe .condpart131 3588 8dfe a9 02 LDA #2 3589 8e00 8d 57 01 STA menu_option_players 3590 8e03 a9 00 LDA #0 3591 8e05 8d 44 01 STA debounce_right 3592 8e08 ifnconst NOTIALOCKMUTE 3593 8e08 a9 01 lda #1 3594 8e0a 85 de sta sfxschedulelock 3595 8e0c a9 49 lda #sfx_bling 3598 8e12 85 e1 sta sfxinstrumenthi 3599 8e14 a9 00 lda #0 3600 8e16 85 e2 sta sfxpitchoffset ; no pitch modification 3601 8e18 85 e3 sta sfxnoteindex ; not a musical note 3602 8e1a 20 81 f2 jsr schedulesfx 3603 8e1d a9 00 lda #0 3604 8e1f 85 de sta sfxschedulelock 3605 8e21 endif ; NOTIALOCKMUTE 3606 8e21 .skip130then 3607 8e21 .skip129then 3608 8e21 .skipL0153 3609 8e21 .L0154 ;; if menu_yposition = 9 && debounce_right = 6 && menu_option_players = 2 then menu_option_players = 1 : debounce_right = 0 : playsfx sfx_bling 3610 8e21 3611 8e21 ad 4d 01 LDA menu_yposition 3612 8e24 c9 09 CMP #9 3613 8e26 d0 31 BNE .skipL0154 3614 8e28 .condpart132 3615 8e28 ad 44 01 LDA debounce_right 3616 8e2b c9 06 CMP #6 3617 8e2d d0 2a BNE .skip132then 3618 8e2f .condpart133 3619 8e2f ad 57 01 LDA menu_option_players 3620 8e32 c9 02 CMP #2 3621 8e34 d0 23 BNE .skip133then 3622 8e36 .condpart134 3623 8e36 a9 01 LDA #1 3624 8e38 8d 57 01 STA menu_option_players 3625 8e3b a9 00 LDA #0 3626 8e3d 8d 44 01 STA debounce_right 3627 8e40 ifnconst NOTIALOCKMUTE 3628 8e40 a9 01 lda #1 3629 8e42 85 de sta sfxschedulelock 3630 8e44 a9 49 lda #sfx_bling 3633 8e4a 85 e1 sta sfxinstrumenthi 3634 8e4c a9 00 lda #0 3635 8e4e 85 e2 sta sfxpitchoffset ; no pitch modification 3636 8e50 85 e3 sta sfxnoteindex ; not a musical note 3637 8e52 20 81 f2 jsr schedulesfx 3638 8e55 a9 00 lda #0 3639 8e57 85 de sta sfxschedulelock 3640 8e59 endif ; NOTIALOCKMUTE 3641 8e59 .skip133then 3642 8e59 .skip132then 3643 8e59 .skipL0154 3644 8e59 .L0155 ;; if menu_yposition = 9 && debounce_left = 6 && menu_option_players = 1 then menu_option_players = 2 : debounce_left = 0 : playsfx sfx_bling 3645 8e59 3646 8e59 ad 4d 01 LDA menu_yposition 3647 8e5c c9 09 CMP #9 3648 8e5e d0 31 BNE .skipL0155 3649 8e60 .condpart135 3650 8e60 ad 43 01 LDA debounce_left 3651 8e63 c9 06 CMP #6 3652 8e65 d0 2a BNE .skip135then 3653 8e67 .condpart136 3654 8e67 ad 57 01 LDA menu_option_players 3655 8e6a c9 01 CMP #1 3656 8e6c d0 23 BNE .skip136then 3657 8e6e .condpart137 3658 8e6e a9 02 LDA #2 3659 8e70 8d 57 01 STA menu_option_players 3660 8e73 a9 00 LDA #0 3661 8e75 8d 43 01 STA debounce_left 3662 8e78 ifnconst NOTIALOCKMUTE 3663 8e78 a9 01 lda #1 3664 8e7a 85 de sta sfxschedulelock 3665 8e7c a9 49 lda #sfx_bling 3668 8e82 85 e1 sta sfxinstrumenthi 3669 8e84 a9 00 lda #0 3670 8e86 85 e2 sta sfxpitchoffset ; no pitch modification 3671 8e88 85 e3 sta sfxnoteindex ; not a musical note 3672 8e8a 20 81 f2 jsr schedulesfx 3673 8e8d a9 00 lda #0 3674 8e8f 85 de sta sfxschedulelock 3675 8e91 endif ; NOTIALOCKMUTE 3676 8e91 .skip136then 3677 8e91 .skip135then 3678 8e91 .skipL0155 3679 8e91 .L0156 ;; if menu_yposition = 9 && debounce_left = 6 && menu_option_players = 2 then menu_option_players = 1 : debounce_left = 0 : playsfx sfx_bling 3680 8e91 3681 8e91 ad 4d 01 LDA menu_yposition 3682 8e94 c9 09 CMP #9 3683 8e96 d0 31 BNE .skipL0156 3684 8e98 .condpart138 3685 8e98 ad 43 01 LDA debounce_left 3686 8e9b c9 06 CMP #6 3687 8e9d d0 2a BNE .skip138then 3688 8e9f .condpart139 3689 8e9f ad 57 01 LDA menu_option_players 3690 8ea2 c9 02 CMP #2 3691 8ea4 d0 23 BNE .skip139then 3692 8ea6 .condpart140 3693 8ea6 a9 01 LDA #1 3694 8ea8 8d 57 01 STA menu_option_players 3695 8eab a9 00 LDA #0 3696 8ead 8d 43 01 STA debounce_left 3697 8eb0 ifnconst NOTIALOCKMUTE 3698 8eb0 a9 01 lda #1 3699 8eb2 85 de sta sfxschedulelock 3700 8eb4 a9 49 lda #sfx_bling 3703 8eba 85 e1 sta sfxinstrumenthi 3704 8ebc a9 00 lda #0 3705 8ebe 85 e2 sta sfxpitchoffset ; no pitch modification 3706 8ec0 85 e3 sta sfxnoteindex ; not a musical note 3707 8ec2 20 81 f2 jsr schedulesfx 3708 8ec5 a9 00 lda #0 3709 8ec7 85 de sta sfxschedulelock 3710 8ec9 endif ; NOTIALOCKMUTE 3711 8ec9 .skip139then 3712 8ec9 .skip138then 3713 8ec9 .skipL0156 3714 8ec9 . 3715 8ec9 ;; 3716 8ec9 3717 8ec9 .L0157 ;; if menu_option_skill = 1 then plotchars 'beginner' 2 72 5 3718 8ec9 3719 8ec9 ad 4e 01 LDA menu_option_skill 3720 8ecc c9 01 CMP #1 3721 8ece d0 24 BNE .skipL0157 3722 8ed0 .condpart141 3723 8ed0 4c db 8e JMP skipalphadata21 3724 8ed3 alphadata21 3725 8ed3 4d .byte.b (alphadata21 3738 8ee1 85 43 sta temp2 3739 8ee3 3740 8ee3 a9 18 lda #24 ; width in two's complement 3741 8ee5 09 40 ora #64 ; palette left shifted 5 bits 3742 8ee7 85 44 sta temp3 3743 8ee9 a9 48 lda #72 3744 8eeb 85 45 sta temp4 3745 8eed 3746 8eed a9 05 lda #5 3747 8eef 3748 8eef 85 46 sta temp5 3749 8ef1 3750 8ef1 20 7a f3 jsr plotcharacters 3751 8ef4 .skipL0157 3752 8ef4 .L0158 ;; if menu_option_skill = 2 then plotchars 'fighter' 2 72 5 3753 8ef4 3754 8ef4 ad 4e 01 LDA menu_option_skill 3755 8ef7 c9 02 CMP #2 3756 8ef9 d0 23 BNE .skipL0158 3757 8efb .condpart142 3758 8efb 4c 05 8f JMP skipalphadata22 3759 8efe alphadata22 3760 8efe 51 .byte.b (alphadata22 3772 8f0b 85 43 sta temp2 3773 8f0d 3774 8f0d a9 19 lda #25 ; width in two's complement 3775 8f0f 09 40 ora #64 ; palette left shifted 5 bits 3776 8f11 85 44 sta temp3 3777 8f13 a9 48 lda #72 3778 8f15 85 45 sta temp4 3779 8f17 3780 8f17 a9 05 lda #5 3781 8f19 3782 8f19 85 46 sta temp5 3783 8f1b 3784 8f1b 20 7a f3 jsr plotcharacters 3785 8f1e .skipL0158 3786 8f1e .L0159 ;; if menu_option_skill = 3 then plotchars 'mistress' 2 72 5 3787 8f1e 3788 8f1e ad 4e 01 LDA menu_option_skill 3789 8f21 c9 03 CMP #3 3790 8f23 d0 24 BNE .skipL0159 3791 8f25 .condpart143 3792 8f25 4c 30 8f JMP skipalphadata23 3793 8f28 alphadata23 3794 8f28 58 .byte.b (alphadata23 3807 8f36 85 43 sta temp2 3808 8f38 3809 8f38 a9 18 lda #24 ; width in two's complement 3810 8f3a 09 40 ora #64 ; palette left shifted 5 bits 3811 8f3c 85 44 sta temp3 3812 8f3e a9 48 lda #72 3813 8f40 85 45 sta temp4 3814 8f42 3815 8f42 a9 05 lda #5 3816 8f44 3817 8f44 85 46 sta temp5 3818 8f46 3819 8f46 20 7a f3 jsr plotcharacters 3820 8f49 .skipL0159 3821 8f49 . 3822 8f49 ;; 3823 8f49 3824 8f49 .L0160 ;; if menu_option_lives = 1 then plotchars 'one^life' 2 72 6 3825 8f49 3826 8f49 ad 4f 01 LDA menu_option_lives 3827 8f4c c9 01 CMP #1 3828 8f4e d0 24 BNE .skipL0160 3829 8f50 .condpart144 3830 8f50 4c 5b 8f JMP skipalphadata24 3831 8f53 alphadata24 3832 8f53 5a .byte.b (alphadata24 3845 8f61 85 43 sta temp2 3846 8f63 3847 8f63 a9 18 lda #24 ; width in two's complement 3848 8f65 09 40 ora #64 ; palette left shifted 5 bits 3849 8f67 85 44 sta temp3 3850 8f69 a9 48 lda #72 3851 8f6b 85 45 sta temp4 3852 8f6d 3853 8f6d a9 06 lda #6 3854 8f6f 3855 8f6f 85 46 sta temp5 3856 8f71 3857 8f71 20 7a f3 jsr plotcharacters 3858 8f74 .skipL0160 3859 8f74 .L0161 ;; if menu_option_lives = 2 then plotchars 'two^lives' 2 72 6 3860 8f74 3861 8f74 ad 4f 01 LDA menu_option_lives 3862 8f77 c9 02 CMP #2 3863 8f79 d0 25 BNE .skipL0161 3864 8f7b .condpart145 3865 8f7b 4c 87 8f JMP skipalphadata25 3866 8f7e alphadata25 3867 8f7e 5f .byte.b (alphadata25 3881 8f8d 85 43 sta temp2 3882 8f8f 3883 8f8f a9 17 lda #23 ; width in two's complement 3884 8f91 09 40 ora #64 ; palette left shifted 5 bits 3885 8f93 85 44 sta temp3 3886 8f95 a9 48 lda #72 3887 8f97 85 45 sta temp4 3888 8f99 3889 8f99 a9 06 lda #6 3890 8f9b 3891 8f9b 85 46 sta temp5 3892 8f9d 3893 8f9d 20 7a f3 jsr plotcharacters 3894 8fa0 .skipL0161 3895 8fa0 .L0162 ;; if menu_option_lives = 3 then plotchars 'three^lives' 2 72 6 3896 8fa0 3897 8fa0 ad 4f 01 LDA menu_option_lives 3898 8fa3 c9 03 CMP #3 3899 8fa5 d0 27 BNE .skipL0162 3900 8fa7 .condpart146 3901 8fa7 4c b5 8f JMP skipalphadata26 3902 8faa alphadata26 3903 8faa 5f .byte.b (alphadata26 3919 8fbb 85 43 sta temp2 3920 8fbd 3921 8fbd a9 15 lda #21 ; width in two's complement 3922 8fbf 09 40 ora #64 ; palette left shifted 5 bits 3923 8fc1 85 44 sta temp3 3924 8fc3 a9 48 lda #72 3925 8fc5 85 45 sta temp4 3926 8fc7 3927 8fc7 a9 06 lda #6 3928 8fc9 3929 8fc9 85 46 sta temp5 3930 8fcb 3931 8fcb 20 7a f3 jsr plotcharacters 3932 8fce .skipL0162 3933 8fce . 3934 8fce ;; 3935 8fce 3936 8fce .L0163 ;; if menu_option_level = 1 then plotchars 'level^one' 2 72 7 3937 8fce 3938 8fce ad 50 01 LDA menu_option_level 3939 8fd1 c9 01 CMP #1 3940 8fd3 d0 25 BNE .skipL0163 3941 8fd5 .condpart147 3942 8fd5 4c e1 8f JMP skipalphadata27 3943 8fd8 alphadata27 3944 8fd8 57 .byte.b (alphadata27 3958 8fe7 85 43 sta temp2 3959 8fe9 3960 8fe9 a9 17 lda #23 ; width in two's complement 3961 8feb 09 40 ora #64 ; palette left shifted 5 bits 3962 8fed 85 44 sta temp3 3963 8fef a9 48 lda #72 3964 8ff1 85 45 sta temp4 3965 8ff3 3966 8ff3 a9 07 lda #7 3967 8ff5 3968 8ff5 85 46 sta temp5 3969 8ff7 3970 8ff7 20 7a f3 jsr plotcharacters 3971 8ffa .skipL0163 3972 8ffa .L0164 ;; if menu_option_level = 2 then plotchars 'level^two' 2 72 7 3973 8ffa 3974 8ffa ad 50 01 LDA menu_option_level 3975 8ffd c9 02 CMP #2 3976 8fff d0 25 BNE .skipL0164 3977 9001 .condpart148 3978 9001 4c 0d 90 JMP skipalphadata28 3979 9004 alphadata28 3980 9004 57 .byte.b (alphadata28 3994 9013 85 43 sta temp2 3995 9015 3996 9015 a9 17 lda #23 ; width in two's complement 3997 9017 09 40 ora #64 ; palette left shifted 5 bits 3998 9019 85 44 sta temp3 3999 901b a9 48 lda #72 4000 901d 85 45 sta temp4 4001 901f 4002 901f a9 07 lda #7 4003 9021 4004 9021 85 46 sta temp5 4005 9023 4006 9023 20 7a f3 jsr plotcharacters 4007 9026 .skipL0164 4008 9026 .L0165 ;; if menu_option_level = 3 then plotchars 'level^three' 2 72 7 4009 9026 4010 9026 ad 50 01 LDA menu_option_level 4011 9029 c9 03 CMP #3 4012 902b d0 27 BNE .skipL0165 4013 902d .condpart149 4014 902d 4c 3b 90 JMP skipalphadata29 4015 9030 alphadata29 4016 9030 57 .byte.b (alphadata29 4032 9041 85 43 sta temp2 4033 9043 4034 9043 a9 15 lda #21 ; width in two's complement 4035 9045 09 40 ora #64 ; palette left shifted 5 bits 4036 9047 85 44 sta temp3 4037 9049 a9 48 lda #72 4038 904b 85 45 sta temp4 4039 904d 4040 904d a9 07 lda #7 4041 904f 4042 904f 85 46 sta temp5 4043 9051 4044 9051 20 7a f3 jsr plotcharacters 4045 9054 .skipL0165 4046 9054 . 4047 9054 ;; 4048 9054 4049 9054 .L0166 ;; if menu_option_time = 1 then plotchars 'off' 2 72 8 4050 9054 4051 9054 ad 51 01 LDA menu_option_time 4052 9057 c9 01 CMP #1 4053 9059 d0 1f BNE .skipL0166 4054 905b .condpart150 4055 905b 4c 61 90 JMP skipalphadata30 4056 905e alphadata30 4057 905e 5a .byte.b (alphadata30 4065 9067 85 43 sta temp2 4066 9069 4067 9069 a9 1d lda #29 ; width in two's complement 4068 906b 09 40 ora #64 ; palette left shifted 5 bits 4069 906d 85 44 sta temp3 4070 906f a9 48 lda #72 4071 9071 85 45 sta temp4 4072 9073 4073 9073 a9 08 lda #8 4074 9075 4075 9075 85 46 sta temp5 4076 9077 4077 9077 20 7a f3 jsr plotcharacters 4078 907a .skipL0166 4079 907a .L0167 ;; if menu_option_time = 2 then plotchars 'two^minutes' 2 72 8 4080 907a 4081 907a ad 51 01 LDA menu_option_time 4082 907d c9 02 CMP #2 4083 907f d0 27 BNE .skipL0167 4084 9081 .condpart151 4085 9081 4c 8f 90 JMP skipalphadata31 4086 9084 alphadata31 4087 9084 5f .byte.b (alphadata31 4103 9095 85 43 sta temp2 4104 9097 4105 9097 a9 15 lda #21 ; width in two's complement 4106 9099 09 40 ora #64 ; palette left shifted 5 bits 4107 909b 85 44 sta temp3 4108 909d a9 48 lda #72 4109 909f 85 45 sta temp4 4110 90a1 4111 90a1 a9 08 lda #8 4112 90a3 4113 90a3 85 46 sta temp5 4114 90a5 4115 90a5 20 7a f3 jsr plotcharacters 4116 90a8 .skipL0167 4117 90a8 .L0168 ;; if menu_option_time = 3 then plotchars 'five^minutes' 2 72 8 4118 90a8 4119 90a8 ad 51 01 LDA menu_option_time 4120 90ab c9 03 CMP #3 4121 90ad d0 28 BNE .skipL0168 4122 90af .condpart152 4123 90af 4c be 90 JMP skipalphadata32 4124 90b2 alphadata32 4125 90b2 51 .byte.b (alphadata32 4142 90c4 85 43 sta temp2 4143 90c6 4144 90c6 a9 14 lda #20 ; width in two's complement 4145 90c8 09 40 ora #64 ; palette left shifted 5 bits 4146 90ca 85 44 sta temp3 4147 90cc a9 48 lda #72 4148 90ce 85 45 sta temp4 4149 90d0 4150 90d0 a9 08 lda #8 4151 90d2 4152 90d2 85 46 sta temp5 4153 90d4 4154 90d4 20 7a f3 jsr plotcharacters 4155 90d7 .skipL0168 4156 90d7 . 4157 90d7 ;; 4158 90d7 4159 90d7 .L0169 ;; if menu_option_players = 1 then plotchars 'one^player' 2 72 9 4160 90d7 4161 90d7 ad 57 01 LDA menu_option_players 4162 90da c9 01 CMP #1 4163 90dc d0 26 BNE .skipL0169 4164 90de .condpart153 4165 90de 4c eb 90 JMP skipalphadata33 4166 90e1 alphadata33 4167 90e1 5a .byte.b (alphadata33 4182 90f1 85 43 sta temp2 4183 90f3 4184 90f3 a9 16 lda #22 ; width in two's complement 4185 90f5 09 40 ora #64 ; palette left shifted 5 bits 4186 90f7 85 44 sta temp3 4187 90f9 a9 48 lda #72 4188 90fb 85 45 sta temp4 4189 90fd 4190 90fd a9 09 lda #9 4191 90ff 4192 90ff 85 46 sta temp5 4193 9101 4194 9101 20 7a f3 jsr plotcharacters 4195 9104 .skipL0169 4196 9104 .L0170 ;; if menu_option_players = 2 then plotchars 'two^players' 2 72 9 4197 9104 4198 9104 ad 57 01 LDA menu_option_players 4199 9107 c9 02 CMP #2 4200 9109 d0 27 BNE .skipL0170 4201 910b .condpart154 4202 910b 4c 19 91 JMP skipalphadata34 4203 910e alphadata34 4204 910e 5f .byte.b (alphadata34 4220 911f 85 43 sta temp2 4221 9121 4222 9121 a9 15 lda #21 ; width in two's complement 4223 9123 09 40 ora #64 ; palette left shifted 5 bits 4224 9125 85 44 sta temp3 4225 9127 a9 48 lda #72 4226 9129 85 45 sta temp4 4227 912b 4228 912b a9 09 lda #9 4229 912d 4230 912d 85 46 sta temp5 4231 912f 4232 912f 20 7a f3 jsr plotcharacters 4233 9132 .skipL0170 4234 9132 . 4235 9132 ;; 4236 9132 4237 9132 .L0171 ;; if menu_yposition = 10 && firedebounce = 6 then firedebounce = 0 : goto main 4238 9132 4239 9132 ad 4d 01 LDA menu_yposition 4240 9135 c9 0a CMP #10 4241 9137 d0 0f BNE .skipL0171 4242 9139 .condpart155 4243 9139 ad 45 01 LDA firedebounce 4244 913c c9 06 CMP #6 4245 913e d0 08 BNE .skip155then 4246 9140 .condpart156 4247 9140 a9 00 LDA #0 4248 9142 8d 45 01 STA firedebounce 4249 9145 4c 99 80 jmp .main 4250 9148 4251 9148 .skip155then 4252 9148 .skipL0171 4253 9148 .L0172 ;; if switchreset then reboot 4254 9148 4255 9148 20 49 f4 jsr checkresetswitch 4256 914b d0 03 BNE .skipL0172 4257 914d .condpart157 4258 914d 4c 40 f5 JMP START 4259 9150 .skipL0172 4260 9150 .L0173 ;; drawscreen 4261 9150 4262 9150 20 b3 f0 jsr drawscreen 4263 9153 .L0174 ;; goto menuscreen_loop 4264 9153 4265 9153 4c d9 83 jmp .menuscreen_loop 4266 9156 4267 9156 . 4268 9156 ;; 4269 9156 4270 9156 .titlescreen 4271 9156 ;; titlescreen 4272 9156 4273 9156 . 4274 9156 ;; 4275 9156 4276 9156 . 4277 9156 ;; 4278 9156 4279 9156 . 4280 9156 ;; 4281 9156 4282 9156 . 4283 9156 ;; 4284 9156 4285 9156 . 4286 9156 ;; 4287 9156 4288 9156 . 4289 9156 ;; 4290 9156 4291 9156 .titlescreenloop 4292 9156 ;; titlescreenloop 4293 9156 4294 9156 .L0175 ;; drawwait 4295 9156 4296 9156 20 d0 f1 jsr drawwait 4297 9159 .L0176 ;; clearscreen 4298 9159 4299 9159 20 7f f0 jsr clearscreen 4300 915c .L0177 ;; if switchreset then reboot 4301 915c 4302 915c 20 49 f4 jsr checkresetswitch 4303 915f d0 03 BNE .skipL0177 4304 9161 .condpart158 4305 9161 4c 40 f5 JMP START 4306 9164 .skipL0177 4307 9164 .L0178 ;; plotsprite heofonfir_logo_h 0 9 2 4308 9164 4309 9164 a9 10 lda #heofonfir_logo_h 4313 916a 85 43 sta temp2 4314 916c 4315 916c a9 1c lda #(0|heofonfir_logo_h_width_twoscompliment) 4316 916e 85 44 sta temp3 4317 9170 4318 9170 a9 09 lda #9 4319 9172 85 45 sta temp4 4320 9174 4321 9174 a9 02 lda #2 4322 9176 4323 9176 85 46 sta temp5 4324 9178 4325 9178 a9 40 lda #(heofonfir_logo_h_mode|%01000000) 4326 917a 85 47 sta temp6 4327 917c 4328 917c 20 c9 f2 jsr plotsprite 4329 917f ; +tall sprite replot 4330 917f 18 clc 4331 9180 a5 42 lda temp1 4332 9182 69 04 adc #heofonfir_logo_h_width 4333 9184 85 42 sta temp1 4334 9186 a5 46 lda temp5 4335 9188 69 10 adc #WZONEHEIGHT 4336 918a 85 46 sta temp5 4337 918c 20 c9 f2 jsr plotsprite 4338 918f .L0179 ;; plotsprite heofonfir_logo_e 0 26 2 4339 918f 4340 918f a9 00 lda #heofonfir_logo_e 4344 9195 85 43 sta temp2 4345 9197 4346 9197 a9 1c lda #(0|heofonfir_logo_e_width_twoscompliment) 4347 9199 85 44 sta temp3 4348 919b 4349 919b a9 1a lda #26 4350 919d 85 45 sta temp4 4351 919f 4352 919f a9 02 lda #2 4353 91a1 4354 91a1 85 46 sta temp5 4355 91a3 4356 91a3 a9 40 lda #(heofonfir_logo_e_mode|%01000000) 4357 91a5 85 47 sta temp6 4358 91a7 4359 91a7 20 c9 f2 jsr plotsprite 4360 91aa ; +tall sprite replot 4361 91aa 18 clc 4362 91ab a5 42 lda temp1 4363 91ad 69 04 adc #heofonfir_logo_e_width 4364 91af 85 42 sta temp1 4365 91b1 a5 46 lda temp5 4366 91b3 69 10 adc #WZONEHEIGHT 4367 91b5 85 46 sta temp5 4368 91b7 20 c9 f2 jsr plotsprite 4369 91ba .L0180 ;; plotsprite heofonfir_logo_o 0 42 2 4370 91ba 4371 91ba a9 28 lda #heofonfir_logo_o 4375 91c0 85 43 sta temp2 4376 91c2 4377 91c2 a9 1c lda #(0|heofonfir_logo_o_width_twoscompliment) 4378 91c4 85 44 sta temp3 4379 91c6 4380 91c6 a9 2a lda #42 4381 91c8 85 45 sta temp4 4382 91ca 4383 91ca a9 02 lda #2 4384 91cc 4385 91cc 85 46 sta temp5 4386 91ce 4387 91ce a9 40 lda #(heofonfir_logo_o_mode|%01000000) 4388 91d0 85 47 sta temp6 4389 91d2 4390 91d2 20 c9 f2 jsr plotsprite 4391 91d5 ; +tall sprite replot 4392 91d5 18 clc 4393 91d6 a5 42 lda temp1 4394 91d8 69 04 adc #heofonfir_logo_o_width 4395 91da 85 42 sta temp1 4396 91dc a5 46 lda temp5 4397 91de 69 10 adc #WZONEHEIGHT 4398 91e0 85 46 sta temp5 4399 91e2 20 c9 f2 jsr plotsprite 4400 91e5 .L0181 ;; plotsprite heofonfir_logo_f 0 58 2 4401 91e5 4402 91e5 a9 08 lda #heofonfir_logo_f 4406 91eb 85 43 sta temp2 4407 91ed 4408 91ed a9 1c lda #(0|heofonfir_logo_f_width_twoscompliment) 4409 91ef 85 44 sta temp3 4410 91f1 4411 91f1 a9 3a lda #58 4412 91f3 85 45 sta temp4 4413 91f5 4414 91f5 a9 02 lda #2 4415 91f7 4416 91f7 85 46 sta temp5 4417 91f9 4418 91f9 a9 40 lda #(heofonfir_logo_f_mode|%01000000) 4419 91fb 85 47 sta temp6 4420 91fd 4421 91fd 20 c9 f2 jsr plotsprite 4422 9200 ; +tall sprite replot 4423 9200 18 clc 4424 9201 a5 42 lda temp1 4425 9203 69 04 adc #heofonfir_logo_f_width 4426 9205 85 42 sta temp1 4427 9207 a5 46 lda temp5 4428 9209 69 10 adc #WZONEHEIGHT 4429 920b 85 46 sta temp5 4430 920d 20 c9 f2 jsr plotsprite 4431 9210 .L0182 ;; plotsprite heofonfir_logo_o 0 74 2 4432 9210 4433 9210 a9 28 lda #heofonfir_logo_o 4437 9216 85 43 sta temp2 4438 9218 4439 9218 a9 1c lda #(0|heofonfir_logo_o_width_twoscompliment) 4440 921a 85 44 sta temp3 4441 921c 4442 921c a9 4a lda #74 4443 921e 85 45 sta temp4 4444 9220 4445 9220 a9 02 lda #2 4446 9222 4447 9222 85 46 sta temp5 4448 9224 4449 9224 a9 40 lda #(heofonfir_logo_o_mode|%01000000) 4450 9226 85 47 sta temp6 4451 9228 4452 9228 20 c9 f2 jsr plotsprite 4453 922b ; +tall sprite replot 4454 922b 18 clc 4455 922c a5 42 lda temp1 4456 922e 69 04 adc #heofonfir_logo_o_width 4457 9230 85 42 sta temp1 4458 9232 a5 46 lda temp5 4459 9234 69 10 adc #WZONEHEIGHT 4460 9236 85 46 sta temp5 4461 9238 20 c9 f2 jsr plotsprite 4462 923b .L0183 ;; plotsprite heofonfir_logo_n 0 90 2 4463 923b 4464 923b a9 20 lda #heofonfir_logo_n 4468 9241 85 43 sta temp2 4469 9243 4470 9243 a9 1c lda #(0|heofonfir_logo_n_width_twoscompliment) 4471 9245 85 44 sta temp3 4472 9247 4473 9247 a9 5a lda #90 4474 9249 85 45 sta temp4 4475 924b 4476 924b a9 02 lda #2 4477 924d 4478 924d 85 46 sta temp5 4479 924f 4480 924f a9 40 lda #(heofonfir_logo_n_mode|%01000000) 4481 9251 85 47 sta temp6 4482 9253 4483 9253 20 c9 f2 jsr plotsprite 4484 9256 ; +tall sprite replot 4485 9256 18 clc 4486 9257 a5 42 lda temp1 4487 9259 69 04 adc #heofonfir_logo_n_width 4488 925b 85 42 sta temp1 4489 925d a5 46 lda temp5 4490 925f 69 10 adc #WZONEHEIGHT 4491 9261 85 46 sta temp5 4492 9263 20 c9 f2 jsr plotsprite 4493 9266 .L0184 ;; plotsprite heofonfir_logo_f 0 107 2 4494 9266 4495 9266 a9 08 lda #heofonfir_logo_f 4499 926c 85 43 sta temp2 4500 926e 4501 926e a9 1c lda #(0|heofonfir_logo_f_width_twoscompliment) 4502 9270 85 44 sta temp3 4503 9272 4504 9272 a9 6b lda #107 4505 9274 85 45 sta temp4 4506 9276 4507 9276 a9 02 lda #2 4508 9278 4509 9278 85 46 sta temp5 4510 927a 4511 927a a9 40 lda #(heofonfir_logo_f_mode|%01000000) 4512 927c 85 47 sta temp6 4513 927e 4514 927e 20 c9 f2 jsr plotsprite 4515 9281 ; +tall sprite replot 4516 9281 18 clc 4517 9282 a5 42 lda temp1 4518 9284 69 04 adc #heofonfir_logo_f_width 4519 9286 85 42 sta temp1 4520 9288 a5 46 lda temp5 4521 928a 69 10 adc #WZONEHEIGHT 4522 928c 85 46 sta temp5 4523 928e 20 c9 f2 jsr plotsprite 4524 9291 .L0185 ;; plotsprite heofonfir_logo_i 0 121 2 4525 9291 4526 9291 a9 18 lda #heofonfir_logo_i 4530 9297 85 43 sta temp2 4531 9299 4532 9299 a9 1c lda #(0|heofonfir_logo_i_width_twoscompliment) 4533 929b 85 44 sta temp3 4534 929d 4535 929d a9 79 lda #121 4536 929f 85 45 sta temp4 4537 92a1 4538 92a1 a9 02 lda #2 4539 92a3 4540 92a3 85 46 sta temp5 4541 92a5 4542 92a5 a9 40 lda #(heofonfir_logo_i_mode|%01000000) 4543 92a7 85 47 sta temp6 4544 92a9 4545 92a9 20 c9 f2 jsr plotsprite 4546 92ac ; +tall sprite replot 4547 92ac 18 clc 4548 92ad a5 42 lda temp1 4549 92af 69 04 adc #heofonfir_logo_i_width 4550 92b1 85 42 sta temp1 4551 92b3 a5 46 lda temp5 4552 92b5 69 10 adc #WZONEHEIGHT 4553 92b7 85 46 sta temp5 4554 92b9 20 c9 f2 jsr plotsprite 4555 92bc .L0186 ;; plotsprite heofonfir_logo_r 0 136 2 4556 92bc 4557 92bc a9 30 lda #heofonfir_logo_r 4561 92c2 85 43 sta temp2 4562 92c4 4563 92c4 a9 1c lda #(0|heofonfir_logo_r_width_twoscompliment) 4564 92c6 85 44 sta temp3 4565 92c8 4566 92c8 a9 88 lda #136 4567 92ca 85 45 sta temp4 4568 92cc 4569 92cc a9 02 lda #2 4570 92ce 4571 92ce 85 46 sta temp5 4572 92d0 4573 92d0 a9 40 lda #(heofonfir_logo_r_mode|%01000000) 4574 92d2 85 47 sta temp6 4575 92d4 4576 92d4 20 c9 f2 jsr plotsprite 4577 92d7 ; +tall sprite replot 4578 92d7 18 clc 4579 92d8 a5 42 lda temp1 4580 92da 69 04 adc #heofonfir_logo_r_width 4581 92dc 85 42 sta temp1 4582 92de a5 46 lda temp5 4583 92e0 69 10 adc #WZONEHEIGHT 4584 92e2 85 46 sta temp5 4585 92e4 20 c9 f2 jsr plotsprite 4586 92e7 .L0187 ;; plotsprite heofonfir_push_fire_banner 0 60 120 4587 92e7 4588 92e7 a9 38 lda #heofonfir_push_fire_banner 4592 92ed 85 43 sta temp2 4593 92ef 4594 92ef a9 16 lda #(0|heofonfir_push_fire_banner_width_twoscompliment) 4595 92f1 85 44 sta temp3 4596 92f3 4597 92f3 a9 3c lda #60 4598 92f5 85 45 sta temp4 4599 92f7 4600 92f7 a9 78 lda #120 4601 92f9 4602 92f9 85 46 sta temp5 4603 92fb 4604 92fb a9 40 lda #(heofonfir_push_fire_banner_mode|%01000000) 4605 92fd 85 47 sta temp6 4606 92ff 4607 92ff 20 c9 f2 jsr plotsprite 4608 9302 .L0188 ;; if joy0fire then firedebounce = 5 4609 9302 4610 9302 2c 02 21 bit sINPT1 4611 9305 10 05 BPL .skipL0188 4612 9307 .condpart159 4613 9307 a9 05 LDA #5 4614 9309 8d 45 01 STA firedebounce 4615 930c .skipL0188 4616 930c .L0189 ;; if !joy0fire && firedebounce = 5 then firedebounce = 6 4617 930c 4618 930c 2c 02 21 bit sINPT1 4619 930f 30 0c BMI .skipL0189 4620 9311 .condpart160 4621 9311 ad 45 01 LDA firedebounce 4622 9314 c9 05 CMP #5 4623 9316 d0 05 BNE .skip160then 4624 9318 .condpart161 4625 9318 a9 06 LDA #6 4626 931a 8d 45 01 STA firedebounce 4627 931d .skip160then 4628 931d .skipL0189 4629 931d .L0190 ;; if firedebounce = 6 then firedebounce = 0 : goto menuscreen 4630 931d 4631 931d ad 45 01 LDA firedebounce 4632 9320 c9 06 CMP #6 4633 9322 d0 08 BNE .skipL0190 4634 9324 .condpart162 4635 9324 a9 00 LDA #0 4636 9326 8d 45 01 STA firedebounce 4637 9329 4c 9d 83 jmp .menuscreen 4638 932c 4639 932c .skipL0190 4640 932c .L0191 ;; drawscreen 4641 932c 4642 932c 20 b3 f0 jsr drawscreen 4643 932f . 4644 932f ;; 4645 932f 4646 932f .L0192 ;; goto titlescreenloop 4647 932f 4648 932f 4c 56 91 jmp .titlescreenloop 4649 9332 4650 9332 . 4651 9332 ;; 4652 9332 4653 9332 . 4654 9332 ;; 4655 9332 4656 9332 .initialise_gamescreen 4657 9332 ;; initialise_gamescreen 4658 9332 4659 9332 .L0193 ;; clearscreen 4660 9332 4661 9332 20 7f f0 jsr clearscreen 4662 9335 .L0194 ;; BACKGRND = $00 4663 9335 4664 9335 a9 00 LDA #$00 4665 9337 85 20 STA BACKGRND 4666 9339 . 4667 9339 ;; 4668 9339 4669 9339 .L0195 ;; savescreen 4670 9339 4671 9339 20 a3 f0 jsr savescreen 4672 933c .L0196 ;; return 4673 933c 4674 933c ba tsx 4675 933d bd 02 01 lda $102,x 4676 9340 f0 01 beq bankswitchret36 4677 9342 60 RTS 4678 9343 bankswitchret36 4679 9343 4c 2c f4 JMP BS_return 4680 9346 . 4681 9346 ;; 4682 9346 4683 9346 .L0197 ;; data sfx_bling 4684 9346 4685 9346 4c 7f 93 JMP .skipL0197 4686 9349 sfx_bling 4687 9349 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4688 934c 4689 934c 1c 04 07 .byte.b $1c,$04,$07 4690 934f 4691 934f 1b 04 07 .byte.b $1b,$04,$07 4692 9352 4693 9352 04 0f 05 .byte.b $04,$0f,$05 4694 9355 4695 9355 15 04 09 .byte.b $15,$04,$09 4696 9358 4697 9358 16 04 07 .byte.b $16,$04,$07 4698 935b 4699 935b 03 0f 04 .byte.b $03,$0f,$04 4700 935e 4701 935e 11 04 08 .byte.b $11,$04,$08 4702 9361 4703 9361 11 04 08 .byte.b $11,$04,$08 4704 9364 4705 9364 11 04 04 .byte.b $11,$04,$04 4706 9367 4707 9367 0e 04 09 .byte.b $0e,$04,$09 4708 936a 4709 936a 0e 04 07 .byte.b $0e,$04,$07 4710 936d 4711 936d 0e 04 04 .byte.b $0e,$04,$04 4712 9370 4713 9370 1c 04 07 .byte.b $1c,$04,$07 4714 9373 4715 9373 1b 04 05 .byte.b $1b,$04,$05 4716 9376 4717 9376 1c 04 04 .byte.b $1c,$04,$04 4718 9379 4719 9379 1b 04 02 .byte.b $1b,$04,$02 4720 937c 4721 937c 00 00 00 .byte.b $00,$00,$00 4722 937f 4723 937f .skipL0197 4724 937f 00 36 sfx_bling_length = [. - sfx_bling] 4725 937f sfx_bling_lo SET #sfx_bling 4727 937f DMAHOLEEND0 SET . 4728 937f gameend 4729 937f DMAHOLEEND0 SET . 3201 bytes of ROM space left in the main area of bank 1. 4730 937f echo " ",[($A000 - .)]d , "bytes of ROM space left in the main area of bank 1." 4731 937f - if ($A000 - .) < 0 4732 937f -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 4733 937f endif 4734 937f - if START_OF_ROM = . ; avoid dasm empty start-rom truncation. 4735 937f - .byte 0 4736 937f endif 4737 937f START_OF_ROM SET 0 ; scuttle so we always fail subsequent banks 4738 937f 4739 a000 ORG $A000,0 ; ************* 4740 a000 4741 a000 RORG $A000 ; ************* 4742 a000 4743 a000 a0 00 heofonfir_logo_e = $A000 4744 a000 4745 a000 heofonfir_logo_e 4746 a000 15 00 01 00 HEX 15000100 4747 a000 a0 04 heofonfir_logo_e_tallsprite_00 = $A004 4748 a004 4749 a004 heofonfir_logo_e_tallsprite_00 4750 a004 00 00 00 00 HEX 00000000 4751 a004 a0 08 heofonfir_logo_f = $A008 4752 a008 4753 a008 heofonfir_logo_f 4754 a008 15 00 01 00 HEX 15000100 4755 a008 a0 0c heofonfir_logo_f_tallsprite_00 = $A00C 4756 a00c 4757 a00c heofonfir_logo_f_tallsprite_00 4758 a00c 00 00 00 00 HEX 00000000 4759 a00c a0 10 heofonfir_logo_h = $A010 4760 a010 4761 a010 heofonfir_logo_h 4762 a010 15 50 00 58 HEX 15500058 4763 a010 a0 14 heofonfir_logo_h_tallsprite_00 = $A014 4764 a014 4765 a014 heofonfir_logo_h_tallsprite_00 4766 a014 00 00 00 00 HEX 00000000 4767 a014 a0 18 heofonfir_logo_i = $A018 4768 a018 4769 a018 heofonfir_logo_i 4770 a018 00 05 80 00 HEX 00058000 4771 a018 a0 1c heofonfir_logo_i_tallsprite_00 = $A01C 4772 a01c 4773 a01c heofonfir_logo_i_tallsprite_00 4774 a01c 00 00 00 00 HEX 00000000 4775 a01c a0 20 heofonfir_logo_n = $A020 4776 a020 4777 a020 heofonfir_logo_n 4778 a020 15 00 40 58 HEX 15004058 4779 a020 a0 24 heofonfir_logo_n_tallsprite_00 = $A024 4780 a024 4781 a024 heofonfir_logo_n_tallsprite_00 4782 a024 00 00 00 00 HEX 00000000 4783 a024 a0 28 heofonfir_logo_o = $A028 4784 a028 4785 a028 heofonfir_logo_o 4786 a028 10 00 00 08 HEX 10000008 4787 a028 a0 2c heofonfir_logo_o_tallsprite_00 = $A02C 4788 a02c 4789 a02c heofonfir_logo_o_tallsprite_00 4790 a02c 00 00 00 00 HEX 00000000 4791 a02c a0 30 heofonfir_logo_r = $A030 4792 a030 4793 a030 heofonfir_logo_r 4794 a030 15 00 80 00 HEX 15008000 4795 a030 a0 34 heofonfir_logo_r_tallsprite_00 = $A034 4796 a034 4797 a034 heofonfir_logo_r_tallsprite_00 4798 a034 00 00 00 00 HEX 00000000 4799 a034 a0 38 heofonfir_push_fire_banner = $A038 4800 a038 4801 a038 heofonfir_push_fire_banner 4802 a038 00 00 00 00* HEX 00000000000000000000 4803 a038 a0 42 heofonfir_complete_font = $A042 4804 a042 4805 a042 heofonfir_complete_font 4806 a042 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4807 a062 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4808 a082 00 00 00 00* HEX 0000000000000000000000000000000000 4809 a093 4810 a100 ORG $A100,0 ; ************* 4811 a100 4812 a100 RORG $A100 ; ************* 4813 a100 4814 a100 ;heofonfir_logo_e 4815 a100 15 55 55 40 HEX 15555540 4816 a104 ;heofonfir_logo_e_tallsprite_00 4817 a104 00 00 00 00 HEX 00000000 4818 a108 ;heofonfir_logo_f 4819 a108 15 55 55 40 HEX 15555540 4820 a10c ;heofonfir_logo_f_tallsprite_00 4821 a10c 00 00 00 00 HEX 00000000 4822 a110 ;heofonfir_logo_h 4823 a110 15 95 00 58 HEX 15950058 4824 a114 ;heofonfir_logo_h_tallsprite_00 4825 a114 00 00 00 00 HEX 00000000 4826 a118 ;heofonfir_logo_i 4827 a118 00 05 80 00 HEX 00058000 4828 a11c ;heofonfir_logo_i_tallsprite_00 4829 a11c 00 00 00 00 HEX 00000000 4830 a120 ;heofonfir_logo_n 4831 a120 15 01 00 58 HEX 15010058 4832 a124 ;heofonfir_logo_n_tallsprite_00 4833 a124 00 00 00 00 HEX 00000000 4834 a128 ;heofonfir_logo_o 4835 a128 10 00 00 08 HEX 10000008 4836 a12c ;heofonfir_logo_o_tallsprite_00 4837 a12c 00 01 40 00 HEX 00014000 4838 a130 ;heofonfir_logo_r 4839 a130 15 01 00 00 HEX 15010000 4840 a134 ;heofonfir_logo_r_tallsprite_00 4841 a134 00 00 00 00 HEX 00000000 4842 a138 ;heofonfir_push_fire_banner 4843 a138 40 41 41 10* HEX 40414110004054401410 4844 a142 ;heofonfir_complete_font 4845 a142 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4846 a162 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4847 a182 00 00 00 00* HEX 0000000000000000000000000000000000 4848 a193 4849 a200 ORG $A200,0 ; ************* 4850 a200 4851 a200 RORG $A200 ; ************* 4852 a200 4853 a200 ;heofonfir_logo_e 4854 a200 15 aa aa a0 HEX 15aaaaa0 4855 a204 ;heofonfir_logo_e_tallsprite_00 4856 a204 01 00 00 00 HEX 01000000 4857 a208 ;heofonfir_logo_f 4858 a208 15 aa aa a0 HEX 15aaaaa0 4859 a20c ;heofonfir_logo_f_tallsprite_00 4860 a20c 01 00 00 00 HEX 01000000 4861 a210 ;heofonfir_logo_h 4862 a210 16 09 50 58 HEX 16095058 4863 a214 ;heofonfir_logo_h_tallsprite_00 4864 a214 01 00 00 08 HEX 01000008 4865 a218 ;heofonfir_logo_i 4866 a218 00 05 80 00 HEX 00058000 4867 a21c ;heofonfir_logo_i_tallsprite_00 4868 a21c 00 00 80 00 HEX 00008000 4869 a220 ;heofonfir_logo_n 4870 a220 15 01 00 58 HEX 15010058 4871 a224 ;heofonfir_logo_n_tallsprite_00 4872 a224 01 00 00 08 HEX 01000008 4873 a228 ;heofonfir_logo_o 4874 a228 10 00 00 08 HEX 10000008 4875 a22c ;heofonfir_logo_o_tallsprite_00 4876 a22c 00 16 54 00 HEX 00165400 4877 a230 ;heofonfir_logo_r 4878 a230 15 a9 00 00 HEX 15a90000 4879 a234 ;heofonfir_logo_r_tallsprite_00 4880 a234 01 00 00 80 HEX 01000080 4881 a238 ;heofonfir_push_fire_banner 4882 a238 41 10 11 10* HEX 41101110004010404000 4883 a242 ;heofonfir_complete_font 4884 a242 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4885 a262 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4886 a282 00 00 00 00* HEX 0000000000000000000000000000000000 4887 a293 4888 a300 ORG $A300,0 ; ************* 4889 a300 4890 a300 RORG $A300 ; ************* 4891 a300 4892 a300 ;heofonfir_logo_e 4893 a300 15 00 00 00 HEX 15000000 4894 a304 ;heofonfir_logo_e_tallsprite_00 4895 a304 01 00 00 00 HEX 01000000 4896 a308 ;heofonfir_logo_f 4897 a308 15 00 00 00 HEX 15000000 4898 a30c ;heofonfir_logo_f_tallsprite_00 4899 a30c 01 00 00 00 HEX 01000000 4900 a310 ;heofonfir_logo_h 4901 a310 16 00 95 58 HEX 16009558 4902 a314 ;heofonfir_logo_h_tallsprite_00 4903 a314 01 00 00 08 HEX 01000008 4904 a318 ;heofonfir_logo_i 4905 a318 00 05 80 00 HEX 00058000 4906 a31c ;heofonfir_logo_i_tallsprite_00 4907 a31c 00 00 80 00 HEX 00008000 4908 a320 ;heofonfir_logo_n 4909 a320 15 01 00 58 HEX 15010058 4910 a324 ;heofonfir_logo_n_tallsprite_00 4911 a324 01 00 00 08 HEX 01000008 4912 a328 ;heofonfir_logo_o 4913 a328 10 00 00 08 HEX 10000008 4914 a32c ;heofonfir_logo_o_tallsprite_00 4915 a32c 01 68 25 40 HEX 01682540 4916 a330 ;heofonfir_logo_r 4917 a330 16 00 94 00 HEX 16009400 4918 a334 ;heofonfir_logo_r_tallsprite_00 4919 a334 01 00 00 80 HEX 01000080 4920 a338 ;heofonfir_push_fire_banner 4921 a338 41 10 11 10* HEX 41101110004010404000 4922 a342 ;heofonfir_complete_font 4923 a342 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4924 a362 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4925 a382 00 00 00 00* HEX 0000000000000000000000000000000000 4926 a393 4927 a400 ORG $A400,0 ; ************* 4928 a400 4929 a400 RORG $A400 ; ************* 4930 a400 4931 a400 ;heofonfir_logo_e 4932 a400 15 00 00 00 HEX 15000000 4933 a404 ;heofonfir_logo_e_tallsprite_00 4934 a404 05 00 00 00 HEX 05000000 4935 a408 ;heofonfir_logo_f 4936 a408 15 00 00 00 HEX 15000000 4937 a40c ;heofonfir_logo_f_tallsprite_00 4938 a40c 05 00 00 00 HEX 05000000 4939 a410 ;heofonfir_logo_h 4940 a410 16 00 09 58 HEX 16000958 4941 a414 ;heofonfir_logo_h_tallsprite_00 4942 a414 05 00 00 18 HEX 05000018 4943 a418 ;heofonfir_logo_i 4944 a418 00 05 80 00 HEX 00058000 4945 a41c ;heofonfir_logo_i_tallsprite_00 4946 a41c 00 01 80 00 HEX 00018000 4947 a420 ;heofonfir_logo_n 4948 a420 15 04 00 58 HEX 15040058 4949 a424 ;heofonfir_logo_n_tallsprite_00 4950 a424 05 00 00 18 HEX 05000018 4951 a428 ;heofonfir_logo_o 4952 a428 10 00 00 08 HEX 10000008 4953 a42c ;heofonfir_logo_o_tallsprite_00 4954 a42c 01 80 01 40 HEX 01800140 4955 a430 ;heofonfir_logo_r 4956 a430 15 00 01 00 HEX 15000100 4957 a434 ;heofonfir_logo_r_tallsprite_00 4958 a434 05 00 00 80 HEX 05000080 4959 a438 ;heofonfir_push_fire_banner 4960 a438 41 10 51 10* HEX 41105110004010404010 4961 a442 ;heofonfir_complete_font 4962 a442 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4963 a462 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4964 a482 00 00 00 00* HEX 0000000000000000000000000000000000 4965 a493 4966 a500 ORG $A500,0 ; ************* 4967 a500 4968 a500 RORG $A500 ; ************* 4969 a500 4970 a500 ;heofonfir_logo_e 4971 a500 15 00 00 00 HEX 15000000 4972 a504 ;heofonfir_logo_e_tallsprite_00 4973 a504 05 00 00 00 HEX 05000000 4974 a508 ;heofonfir_logo_f 4975 a508 15 00 00 00 HEX 15000000 4976 a50c ;heofonfir_logo_f_tallsprite_00 4977 a50c 05 00 00 00 HEX 05000000 4978 a510 ;heofonfir_logo_h 4979 a510 16 00 00 58 HEX 16000058 4980 a514 ;heofonfir_logo_h_tallsprite_00 4981 a514 05 00 00 18 HEX 05000018 4982 a518 ;heofonfir_logo_i 4983 a518 00 05 80 00 HEX 00058000 4984 a51c ;heofonfir_logo_i_tallsprite_00 4985 a51c 00 01 80 00 HEX 00018000 4986 a520 ;heofonfir_logo_n 4987 a520 15 04 00 58 HEX 15040058 4988 a524 ;heofonfir_logo_n_tallsprite_00 4989 a524 05 00 00 18 HEX 05000018 4990 a528 ;heofonfir_logo_o 4991 a528 10 00 00 08 HEX 10000008 4992 a52c ;heofonfir_logo_o_tallsprite_00 4993 a52c 06 80 01 50 HEX 06800150 4994 a530 ;heofonfir_logo_r 4995 a530 15 00 00 40 HEX 15000040 4996 a534 ;heofonfir_logo_r_tallsprite_00 4997 a534 05 00 00 80 HEX 05000080 4998 a538 ;heofonfir_push_fire_banner 4999 a538 41 11 41 10* HEX 41114110004010405410 5000 a542 ;heofonfir_complete_font 5001 a542 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 5002 a562 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 5003 a582 00 00 00 00* HEX 0000000000000000000000000000000000 5004 a593 5005 a600 ORG $A600,0 ; ************* 5006 a600 5007 a600 RORG $A600 ; ************* 5008 a600 5009 a600 ;heofonfir_logo_e 5010 a600 15 00 00 00 HEX 15000000 5011 a604 ;heofonfir_logo_e_tallsprite_00 5012 a604 15 00 01 00 HEX 15000100 5013 a608 ;heofonfir_logo_f 5014 a608 15 00 00 00 HEX 15000000 5015 a60c ;heofonfir_logo_f_tallsprite_00 5016 a60c 15 00 00 00 HEX 15000000 5017 a610 ;heofonfir_logo_h 5018 a610 16 00 00 58 HEX 16000058 5019 a614 ;heofonfir_logo_h_tallsprite_00 5020 a614 15 00 00 58 HEX 15000058 5021 a618 ;heofonfir_logo_i 5022 a618 00 05 80 00 HEX 00058000 5023 a61c ;heofonfir_logo_i_tallsprite_00 5024 a61c 00 05 80 00 HEX 00058000 5025 a620 ;heofonfir_logo_n 5026 a620 15 04 00 58 HEX 15040058 5027 a624 ;heofonfir_logo_n_tallsprite_00 5028 a624 15 00 00 58 HEX 15000058 5029 a628 ;heofonfir_logo_o 5030 a628 10 00 00 08 HEX 10000008 5031 a62c ;heofonfir_logo_o_tallsprite_00 5032 a62c 08 00 00 10 HEX 08000010 5033 a630 ;heofonfir_logo_r 5034 a630 15 00 00 20 HEX 15000020 5035 a634 ;heofonfir_logo_r_tallsprite_00 5036 a634 15 00 02 00 HEX 15000200 5037 a638 ;heofonfir_push_fire_banner 5038 a638 41 11 01 10* HEX 41110110004010404410 5039 a642 ;heofonfir_complete_font 5040 a642 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 5041 a662 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 5042 a682 00 00 00 00* HEX 0000000000000000000000000000000000 5043 a693 5044 a700 ORG $A700,0 ; ************* 5045 a700 5046 a700 RORG $A700 ; ************* 5047 a700 5048 a700 ;heofonfir_logo_e 5049 a700 15 00 00 00 HEX 15000000 5050 a704 ;heofonfir_logo_e_tallsprite_00 5051 a704 15 55 55 40 HEX 15555540 5052 a708 ;heofonfir_logo_f 5053 a708 15 00 00 00 HEX 15000000 5054 a70c ;heofonfir_logo_f_tallsprite_00 5055 a70c 15 00 00 00 HEX 15000000 5056 a710 ;heofonfir_logo_h 5057 a710 16 00 00 58 HEX 16000058 5058 a714 ;heofonfir_logo_h_tallsprite_00 5059 a714 15 00 00 58 HEX 15000058 5060 a718 ;heofonfir_logo_i 5061 a718 00 05 80 00 HEX 00058000 5062 a71c ;heofonfir_logo_i_tallsprite_00 5063 a71c 00 05 80 00 HEX 00058000 5064 a720 ;heofonfir_logo_n 5065 a720 15 20 00 58 HEX 15200058 5066 a724 ;heofonfir_logo_n_tallsprite_00 5067 a724 15 00 01 58 HEX 15000158 5068 a728 ;heofonfir_logo_o 5069 a728 10 00 00 08 HEX 10000008 5070 a72c ;heofonfir_logo_o_tallsprite_00 5071 a72c 08 00 00 10 HEX 08000010 5072 a730 ;heofonfir_logo_r 5073 a730 15 00 00 20 HEX 15000020 5074 a734 ;heofonfir_logo_r_tallsprite_00 5075 a734 15 00 02 00 HEX 15000200 5076 a738 ;heofonfir_push_fire_banner 5077 a738 82 22 02 20* HEX 822202200080a0a08820 5078 a742 ;heofonfir_complete_font 5079 a742 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 5080 a762 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 5081 a782 00 00 00 00* HEX 0000000000000000000000000000000000 5082 a793 5083 a800 ORG $A800,0 ; ************* 5084 a800 5085 a800 RORG $A800 ; ************* 5086 a800 5087 a800 ;heofonfir_logo_e 5088 a800 15 00 00 00 HEX 15000000 5089 a804 ;heofonfir_logo_e_tallsprite_00 5090 a804 15 aa aa a0 HEX 15aaaaa0 5091 a808 ;heofonfir_logo_f 5092 a808 15 00 00 00 HEX 15000000 5093 a80c ;heofonfir_logo_f_tallsprite_00 5094 a80c 15 00 00 00 HEX 15000000 5095 a810 ;heofonfir_logo_h 5096 a810 16 00 00 58 HEX 16000058 5097 a814 ;heofonfir_logo_h_tallsprite_00 5098 a814 15 00 00 58 HEX 15000058 5099 a818 ;heofonfir_logo_i 5100 a818 00 05 80 00 HEX 00058000 5101 a81c ;heofonfir_logo_i_tallsprite_00 5102 a81c 00 05 80 00 HEX 00058000 5103 a820 ;heofonfir_logo_n 5104 a820 15 20 00 58 HEX 15200058 5105 a824 ;heofonfir_logo_n_tallsprite_00 5106 a824 15 00 04 58 HEX 15000458 5107 a828 ;heofonfir_logo_o 5108 a828 04 00 00 20 HEX 04000020 5109 a82c ;heofonfir_logo_o_tallsprite_00 5110 a82c 10 00 00 08 HEX 10000008 5111 a830 ;heofonfir_logo_r 5112 a830 15 00 00 20 HEX 15000020 5113 a834 ;heofonfir_logo_r_tallsprite_00 5114 a834 15 00 02 00 HEX 15000200 5115 a838 ;heofonfir_push_fire_banner 5116 a838 82 20 a2 80* HEX 8220a28000a820882020 5117 a842 ;heofonfir_complete_font 5118 a842 08 2a 2a 08* HEX 082a2a0802280802080822280a282a202a222a08222a22222a200a2228080808 5119 a862 22 22 08 2a* HEX 2222082a202020082020000a000000002002220808222a220000020808202a2a 5120 a882 22 0a 28 08* HEX 220a28082020202a08222a22082a08082a 5121 a893 5122 a900 ORG $A900,0 ; ************* 5123 a900 5124 a900 RORG $A900 ; ************* 5125 a900 5126 a900 ;heofonfir_logo_e 5127 a900 15 00 00 00 HEX 15000000 5128 a904 ;heofonfir_logo_e_tallsprite_00 5129 a904 15 00 00 00 HEX 15000000 5130 a908 ;heofonfir_logo_f 5131 a908 15 00 00 00 HEX 15000000 5132 a90c ;heofonfir_logo_f_tallsprite_00 5133 a90c 15 00 00 00 HEX 15000000 5134 a910 ;heofonfir_logo_h 5135 a910 16 00 00 58 HEX 16000058 5136 a914 ;heofonfir_logo_h_tallsprite_00 5137 a914 15 00 00 58 HEX 15000058 5138 a918 ;heofonfir_logo_i 5139 a918 00 15 80 00 HEX 00158000 5140 a91c ;heofonfir_logo_i_tallsprite_00 5141 a91c 00 05 80 00 HEX 00058000 5142 a920 ;heofonfir_logo_n 5143 a920 15 20 00 58 HEX 15200058 5144 a924 ;heofonfir_logo_n_tallsprite_00 5145 a924 15 00 04 58 HEX 15000458 5146 a928 ;heofonfir_logo_o 5147 a928 04 00 00 20 HEX 04000020 5148 a92c ;heofonfir_logo_o_tallsprite_00 5149 a92c 10 00 00 08 HEX 10000008 5150 a930 ;heofonfir_logo_r 5151 a930 15 40 00 20 HEX 15400020 5152 a934 ;heofonfir_logo_r_tallsprite_00 5153 a934 15 00 02 00 HEX 15000200 5154 a938 ;heofonfir_push_fire_banner 5155 a938 a0 00 02 00* HEX a0000200008000000020 5156 a942 ;heofonfir_complete_font 5157 a942 12 54 54 12* HEX 1254541206521206121266521452546056665412665466665660166652181218 5158 a962 66 66 18 54* HEX 66661854406040104060001408002a2248044412104454440000061210485456 5159 a982 65 16 52 11* HEX 6516521160606056126654661854181854 5160 a993 5161 aa00 ORG $AA00,0 ; ************* 5162 aa00 5163 aa00 RORG $AA00 ; ************* 5164 aa00 5165 aa00 ;heofonfir_logo_e 5166 aa00 15 00 00 00 HEX 15000000 5167 aa04 ;heofonfir_logo_e_tallsprite_00 5168 aa04 15 00 00 00 HEX 15000000 5169 aa08 ;heofonfir_logo_f 5170 aa08 15 00 00 00 HEX 15000000 5171 aa0c ;heofonfir_logo_f_tallsprite_00 5172 aa0c 15 00 00 00 HEX 15000000 5173 aa10 ;heofonfir_logo_h 5174 aa10 16 00 00 58 HEX 16000058 5175 aa14 ;heofonfir_logo_h_tallsprite_00 5176 aa14 15 00 00 58 HEX 15000058 5177 aa18 ;heofonfir_logo_i 5178 aa18 00 05 80 00 HEX 00058000 5179 aa1c ;heofonfir_logo_i_tallsprite_00 5180 aa1c 00 05 80 00 HEX 00058000 5181 aa20 ;heofonfir_logo_n 5182 aa20 15 80 00 58 HEX 15800058 5183 aa24 ;heofonfir_logo_n_tallsprite_00 5184 aa24 15 00 04 58 HEX 15000458 5185 aa28 ;heofonfir_logo_o 5186 aa28 04 00 00 20 HEX 04000020 5187 aa2c ;heofonfir_logo_o_tallsprite_00 5188 aa2c 10 00 00 08 HEX 10000008 5189 aa30 ;heofonfir_logo_r 5190 aa30 15 40 00 20 HEX 15400020 5191 aa34 ;heofonfir_logo_r_tallsprite_00 5192 aa34 15 00 08 00 HEX 15000800 5193 aa38 ;heofonfir_push_fire_banner 5194 aa38 88 00 02 00* HEX 88000200008020000020 5195 aa42 ;heofonfir_complete_font 5196 aa42 66 18 48 46* HEX 6618484606066606664666666066606066661846666066666660666606186612 5197 aa62 56 66 18 48* HEX 5666184800402008004000611800544412101044000000110000066460186006 5198 aa82 66 66 26 66* HEX 666626666a6860666666006612481a1812 5199 aa93 5200 ab00 ORG $AB00,0 ; ************* 5201 ab00 5202 ab00 RORG $AB00 ; ************* 5203 ab00 5204 ab00 ;heofonfir_logo_e 5205 ab00 15 00 01 00 HEX 15000100 5206 ab04 ;heofonfir_logo_e_tallsprite_00 5207 ab04 15 00 00 00 HEX 15000000 5208 ab08 ;heofonfir_logo_f 5209 ab08 15 00 01 00 HEX 15000100 5210 ab0c ;heofonfir_logo_f_tallsprite_00 5211 ab0c 15 00 00 00 HEX 15000000 5212 ab10 ;heofonfir_logo_h 5213 ab10 16 00 00 58 HEX 16000058 5214 ab14 ;heofonfir_logo_h_tallsprite_00 5215 ab14 15 00 00 58 HEX 15000058 5216 ab18 ;heofonfir_logo_i 5217 ab18 00 01 80 00 HEX 00018000 5218 ab1c ;heofonfir_logo_i_tallsprite_00 5219 ab1c 00 05 80 00 HEX 00058000 5220 ab20 ;heofonfir_logo_n 5221 ab20 15 80 00 58 HEX 15800058 5222 ab24 ;heofonfir_logo_n_tallsprite_00 5223 ab24 15 00 10 58 HEX 15001058 5224 ab28 ;heofonfir_logo_o 5225 ab28 01 40 01 80 HEX 01400180 5226 ab2c ;heofonfir_logo_o_tallsprite_00 5227 ab2c 10 00 00 08 HEX 10000008 5228 ab30 ;heofonfir_logo_r 5229 ab30 15 50 01 60 HEX 15500160 5230 ab34 ;heofonfir_logo_r_tallsprite_00 5231 ab34 15 00 08 00 HEX 15000800 5232 ab38 ;heofonfir_push_fire_banner 5233 ab38 88 00 02 00* HEX 88000200008000000020 5234 ab42 ;heofonfir_complete_font 5235 ab42 66 18 18 04* HEX 66181804260464064406666460666a6866661806646066666668666404186666 5236 ab62 56 44 1a 18* HEX 56441a1800006018000000441a2a001a04400000000000000000064860186006 5237 ab82 66 46 44 66* HEX 664644665652606666662a666612561a66 5238 ab93 5239 ac00 ORG $AC00,0 ; ************* 5240 ac00 5241 ac00 RORG $AC00 ; ************* 5242 ac00 5243 ac00 ;heofonfir_logo_e 5244 ac00 55 55 55 40 HEX 55555540 5245 ac04 ;heofonfir_logo_e_tallsprite_00 5246 ac04 15 00 00 00 HEX 15000000 5247 ac08 ;heofonfir_logo_f 5248 ac08 55 55 55 40 HEX 55555540 5249 ac0c ;heofonfir_logo_f_tallsprite_00 5250 ac0c 15 00 00 00 HEX 15000000 5251 ac10 ;heofonfir_logo_h 5252 ac10 56 00 01 58 HEX 56000158 5253 ac14 ;heofonfir_logo_h_tallsprite_00 5254 ac14 15 00 00 58 HEX 15000058 5255 ac18 ;heofonfir_logo_i 5256 ac18 00 00 80 00 HEX 00008000 5257 ac1c ;heofonfir_logo_i_tallsprite_00 5258 ac1c 00 05 80 00 HEX 00058000 5259 ac20 ;heofonfir_logo_n 5260 ac20 55 80 01 58 HEX 55800158 5261 ac24 ;heofonfir_logo_n_tallsprite_00 5262 ac24 15 00 10 58 HEX 15001058 5263 ac28 ;heofonfir_logo_o 5264 ac28 01 40 01 80 HEX 01400180 5265 ac2c ;heofonfir_logo_o_tallsprite_00 5266 ac2c 10 00 00 08 HEX 10000008 5267 ac30 ;heofonfir_logo_r 5268 ac30 55 54 16 80 HEX 55541680 5269 ac34 ;heofonfir_logo_r_tallsprite_00 5270 ac34 15 00 08 00 HEX 15000800 5271 ac38 ;heofonfir_push_fire_banner 5272 ac38 cc 00 03 00* HEX cc00030000c000000030 5273 ac42 ;heofonfir_complete_font 5274 ac42 66 18 12 58* HEX 6618125856505006121656526066545064561806526056666652665210186666 5275 ac62 66 12 56 18* HEX 6612561800006012000000125454005400000000000000002800061860186006 5276 ac82 55 16 12 65* HEX 5516126566666066564454666604565666 5277 ac93 5278 ad00 ORG $AD00,0 ; ************* 5279 ad00 5280 ad00 RORG $AD00 ; ************* 5281 ad00 5282 ad00 ;heofonfir_logo_e 5283 ad00 15 aa aa a0 HEX 15aaaaa0 5284 ad04 ;heofonfir_logo_e_tallsprite_00 5285 ad04 15 00 00 00 HEX 15000000 5286 ad08 ;heofonfir_logo_f 5287 ad08 15 aa aa a0 HEX 15aaaaa0 5288 ad0c ;heofonfir_logo_f_tallsprite_00 5289 ad0c 15 00 00 00 HEX 15000000 5290 ad10 ;heofonfir_logo_h 5291 ad10 16 00 00 58 HEX 16000058 5292 ad14 ;heofonfir_logo_h_tallsprite_00 5293 ad14 15 00 00 58 HEX 15000058 5294 ad18 ;heofonfir_logo_i 5295 ad18 00 00 00 00 HEX 00000000 5296 ad1c ;heofonfir_logo_i_tallsprite_00 5297 ad1c 00 05 80 00 HEX 00058000 5298 ad20 ;heofonfir_logo_n 5299 ad20 16 00 00 58 HEX 16000058 5300 ad24 ;heofonfir_logo_n_tallsprite_00 5301 ad24 15 00 10 58 HEX 15001058 5302 ad28 ;heofonfir_logo_o 5303 ad28 01 54 16 80 HEX 01541680 5304 ad2c ;heofonfir_logo_o_tallsprite_00 5305 ad2c 10 00 00 08 HEX 10000008 5306 ad30 ;heofonfir_logo_r 5307 ad30 16 15 68 00 HEX 16156800 5308 ad34 ;heofonfir_logo_r_tallsprite_00 5309 ad34 15 00 20 00 HEX 15002000 5310 ad38 ;heofonfir_push_fire_banner 5311 ad38 88 00 02 00* HEX 88000200008000000020 5312 ad42 ;heofonfir_complete_font 5313 ad42 66 18 26 12* HEX 6618261266606006666666666066606060661806666056666666666660186666 5314 ad62 66 66 66 12* HEX 66666612000060260000006618002a1200000000000000005202041060186006 5315 ad82 66 06 26 66* HEX 6606266654666044661800666610545666 5316 ad93 5317 ae00 ORG $AE00,0 ; ************* 5318 ae00 5319 ae00 RORG $AE00 ; ************* 5320 ae00 5321 ae00 ;heofonfir_logo_e 5322 ae00 06 00 00 00 HEX 06000000 5323 ae04 ;heofonfir_logo_e_tallsprite_00 5324 ae04 15 00 00 00 HEX 15000000 5325 ae08 ;heofonfir_logo_f 5326 ae08 06 00 00 00 HEX 06000000 5327 ae0c ;heofonfir_logo_f_tallsprite_00 5328 ae0c 15 00 00 00 HEX 15000000 5329 ae10 ;heofonfir_logo_h 5330 ae10 06 00 00 18 HEX 06000018 5331 ae14 ;heofonfir_logo_h_tallsprite_00 5332 ae14 15 00 00 58 HEX 15000058 5333 ae18 ;heofonfir_logo_i 5334 ae18 0a aa aa a0 HEX 0aaaaaa0 5335 ae1c ;heofonfir_logo_i_tallsprite_00 5336 ae1c 00 05 80 00 HEX 00058000 5337 ae20 ;heofonfir_logo_n 5338 ae20 06 00 00 18 HEX 06000018 5339 ae24 ;heofonfir_logo_n_tallsprite_00 5340 ae24 15 00 40 58 HEX 15004058 5341 ae28 ;heofonfir_logo_o 5342 ae28 00 15 68 00 HEX 00156800 5343 ae2c ;heofonfir_logo_o_tallsprite_00 5344 ae2c 10 00 00 08 HEX 10000008 5345 ae30 ;heofonfir_logo_r 5346 ae30 06 0a 80 00 HEX 060a8000 5347 ae34 ;heofonfir_logo_r_tallsprite_00 5348 ae34 15 00 20 00 HEX 15002000 5349 ae38 ;heofonfir_push_fire_banner 5350 ae38 88 00 00 00* HEX 88000000008000000020 5351 ae42 ;heofonfir_complete_font 5352 ae42 44 58 44 26* HEX 44584426666a4a26444444644a646a6a4a661a0666605664666444644a1a6666 5353 ae62 66 66 66 26* HEX 6666662600004044202000441000544400000000000000000406020848106a26 5354 ae82 64 16 44 44* HEX 6416444460666a1844182a66446a185644 5355 ae93 5356 af00 ORG $AF00,0 ; ************* 5357 af00 5358 af00 RORG $AF00 ; ************* 5359 af00 5360 af00 ;heofonfir_logo_e 5361 af00 02 00 00 00 HEX 02000000 5362 af04 ;heofonfir_logo_e_tallsprite_00 5363 af04 15 00 00 00 HEX 15000000 5364 af08 ;heofonfir_logo_f 5365 af08 02 00 00 00 HEX 02000000 5366 af0c ;heofonfir_logo_f_tallsprite_00 5367 af0c 15 00 00 00 HEX 15000000 5368 af10 ;heofonfir_logo_h 5369 af10 02 00 00 08 HEX 02000008 5370 af14 ;heofonfir_logo_h_tallsprite_00 5371 af14 15 00 00 58 HEX 15000058 5372 af18 ;heofonfir_logo_i 5373 af18 00 00 00 00 HEX 00000000 5374 af1c ;heofonfir_logo_i_tallsprite_00 5375 af1c 00 05 80 00 HEX 00058000 5376 af20 ;heofonfir_logo_n 5377 af20 02 00 00 08 HEX 02000008 5378 af24 ;heofonfir_logo_n_tallsprite_00 5379 af24 15 00 40 58 HEX 15004058 5380 af28 ;heofonfir_logo_o 5381 af28 00 02 80 00 HEX 00028000 5382 af2c ;heofonfir_logo_o_tallsprite_00 5383 af2c 10 00 00 08 HEX 10000008 5384 af30 ;heofonfir_logo_r 5385 af30 02 00 00 00 HEX 02000000 5386 af34 ;heofonfir_logo_r_tallsprite_00 5387 af34 15 00 80 00 HEX 15008000 5388 af38 ;heofonfir_push_fire_banner 5389 af38 50 00 00 00* HEX 50000000005400000010 5390 af42 ;heofonfir_complete_font 5391 af42 10 10 10 54* HEX 1010105444541454101010501450545414445404444044505450105014544444 5392 af62 44 44 44 54* HEX 4444445400000010404000100000000000000000000000001004041010405454 5393 af82 11 04 10 11* HEX 1104101140545410101054541054104410 5394 af93 5395 b000 ORG $B000,0 ; ************* 5396 b000 5397 b000 RORG $B000 ; ************* 5398 b000 - if SPACEOVERFLOW > 0 5399 b000 - echo "" 5400 b000 - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 5401 b000 - echo "######## look above for areas with negative ROM space left." 5402 b000 - echo "######## Aborting assembly." 5403 b000 - ERR 5404 b000 endif 5405 b000 5406 b000 5407 b000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5408 b000 5409 b000 - ifnconst bankswitchmode 5410 b000 - if ( * < $f000 ) 5411 b000 - ORG $F000 5412 b000 - endif 5413 b000 else 5414 b000 ifconst ROM128K 5415 b000 if ( * < $f000 ) 5416 27000 ORG $27000 5417 27000 RORG $F000 5418 27000 endif 5419 27000 endif 5420 27000 - ifconst ROM144K 5421 27000 - if ( * < $f000 ) 5422 27000 - ORG $27000 5423 27000 - RORG $F000 5424 27000 - endif 5425 27000 endif 5426 27000 - ifconst ROM256K 5427 27000 - if ( * < $f000 ) 5428 27000 - ORG $47000 5429 27000 - RORG $F000 5430 27000 - endif 5431 27000 endif 5432 27000 - ifconst ROM272K 5433 27000 - if ( * < $f000 ) 5434 27000 - ORG $47000 5435 27000 - RORG $F000 5436 27000 - endif 5437 27000 endif 5438 27000 - ifconst ROM512K 5439 27000 - if ( * < $f000 ) 5440 27000 - ORG $87000 5441 27000 - RORG $F000 5442 27000 - endif 5443 27000 endif 5444 27000 - ifconst ROM528K 5445 27000 - if ( * < $f000 ) 5446 27000 - ORG $87000 5447 27000 - RORG $F000 5448 27000 - endif 5449 27000 endif 5450 27000 endif 5451 27000 5452 27000 ; all of these "modules" have conditional clauses in them, so even though 5453 27000 ; they're always included here, they don't take up rom unless the user 5454 27000 ; explicitly enables support for the feature. 5455 27000 5456 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_v1.78b.asm 5458 27000 endif 5459 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_v1.78b.asm 5461 27000 endif 5462 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_v1.78b.asm 5464 27000 endif 5465 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_v1.78b.asm 5467 27000 endif 5468 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_v1.78b.asm 5470 27000 endif 5471 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_v1.78b.asm 5473 27000 endif 5474 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5475 27000 5476 27000 ;standard routimes needed for pretty much all games 5477 27000 5478 27000 ; some definitions used with "set debug color" 5479 27000 00 91 DEBUGCALC = $91 5480 27000 00 41 DEBUGWASTE = $41 5481 27000 00 c1 DEBUGDRAW = $C1 5482 27000 5483 27000 ;NMI and IRQ handlers 5484 27000 NMI 5485 27000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 5486 27000 48 pha ; save A 5487 27001 d8 cld 5488 27002 a5 4d lda visibleover 5489 27004 49 ff eor #255 5490 27006 85 4d sta visibleover 5491 27008 - ifconst DEBUGINTERRUPT 5492 27008 - and #$93 5493 27008 - sta BACKGRND 5494 27008 endif 5495 27008 8a txa ; save X 5496 27009 48 pha 5497 2700a 98 tya ; save Y 5498 2700b 48 pha 5499 2700c ce b2 01 dec interruptindex 5500 2700f d0 03 bne skipreallyoffvisible 5501 27011 4c 6b f0 jmp reallyoffvisible 5502 27014 skipreallyoffvisible 5503 27014 a5 4d lda visibleover 5504 27016 d0 03 bne carryontopscreenroutine 5505 27018 - ifconst .bottomscreenroutine 5506 27018 - lda interrupthold 5507 27018 - beq skipbottomroutine 5508 27018 - jsr .bottomscreenroutine 5509 27018 -skipbottomroutine 5510 27018 endif 5511 27018 4c 79 f0 jmp NMIexit 5512 2701b carryontopscreenroutine 5513 2701b - ifconst .topscreenroutine 5514 2701b - lda interrupthold 5515 2701b - beq skiptoproutine 5516 2701b - jsr .topscreenroutine 5517 2701b -skiptoproutine 5518 2701b endif 5519 2701b ifnconst CANARYOFF 5520 2701b ad c1 01 lda canary 5521 2701e f0 07 beq skipcanarytriggered 5522 27020 a9 45 lda #$45 5523 27022 85 20 sta BACKGRND 5524 27024 4c 63 f0 jmp skipbrkolorset ; common crash dump routine, if available 5525 27027 skipcanarytriggered 5526 27027 endif 5527 27027 5528 27027 ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 5529 2702a 5530 2702a ; ** Other important routines that need to regularly run, and can run onscreen. 5531 2702a ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 5532 2702a 5533 2702a - ifconst LONGCONTROLLERREAD 5534 2702a -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 5535 2702a - ldy port1control 5536 2702a - lda longreadtype,y 5537 2702a - beq LLRET1 5538 2702a - tay 5539 2702a - lda longreadroutinehiP1,y 5540 2702a - sta inttemp4 5541 2702a - lda longreadroutineloP1,y 5542 2702a - sta inttemp3 5543 2702a - jmp (inttemp3) 5544 2702a -LLRET1 5545 2702a - ldy port0control 5546 2702a - lda longreadtype,y 5547 2702a - beq LLRET0 5548 2702a - tay 5549 2702a - lda longreadroutinehiP0,y 5550 2702a - sta inttemp4 5551 2702a - lda longreadroutineloP0,y 5552 2702a - sta inttemp3 5553 2702a - jmp (inttemp3) 5554 2702a -LLRET0 5555 2702a - 5556 2702a - 5557 2702a - ifconst PADDLERANGE 5558 2702a -TIMEVAL = PADDLERANGE 5559 2702a - else 5560 2702a -TIMEVAL = 160 5561 2702a - endif 5562 2702a -TIMEOFFSET = 10 5563 2702a - 5564 2702a endif ; LONGCONTROLLERREAD 5565 2702a 5566 2702a 5567 2702a 20 e7 f1 jsr servicesfxchannels 5568 2702d - ifconst MUSICTRACKER 5569 2702d - jsr servicesong 5570 2702d endif ; MUSICTRACKER 5571 2702d - ifconst RMT 5572 2702d - lda rasterpause 5573 2702d - beq skiprasterupdate 5574 2702d - jsr RASTERMUSICTRACKER+3 5575 2702d -skiprasterupdate 5576 2702d -RMT_Iend 5577 2702d endif 5578 2702d 5579 2702d ee a4 01 inc framecounter 5580 27030 ad a4 01 lda framecounter 5581 27033 29 3f and #63 5582 27035 d0 08 bne skipcountdownseconds 5583 27037 ad a5 01 lda countdownseconds 5584 2703a f0 03 beq skipcountdownseconds 5585 2703c ce a5 01 dec countdownseconds 5586 2703f skipcountdownseconds 5587 2703f 5588 2703f a2 01 ldx #1 5589 27041 buttonreadloop 5590 27041 8a txa 5591 27042 48 pha 5592 27043 bc b7 01 ldy port0control,x 5593 27046 b9 c4 f1 lda buttonhandlerlo,y 5594 27049 85 da sta inttemp3 5595 2704b b9 b8 f1 lda buttonhandlerhi,y 5596 2704e 85 db sta inttemp4 5597 27050 05 da ora inttemp3 5598 27052 f0 03 beq buttonreadloopreturn 5599 27054 6c da 00 jmp (inttemp3) 5600 27057 buttonreadloopreturn 5601 27057 68 pla 5602 27058 aa tax 5603 27059 ca dex 5604 2705a 10 e5 bpl buttonreadloop 5605 2705c 5606 2705c ;ifconst KEYPADSUPPORT 5607 2705c ; jsr keypadrowselect 5608 2705c ;endif ; KEYPADSUPPORT 5609 2705c 5610 2705c 5611 2705c - ifconst DOUBLEBUFFER 5612 2705c - lda doublebufferminimumframeindex 5613 2705c - beq skipdoublebufferminimumframeindexadjust 5614 2705c - dec doublebufferminimumframeindex 5615 2705c -skipdoublebufferminimumframeindexadjust 5616 2705c endif 5617 2705c 5618 2705c 4c 79 f0 jmp NMIexit 5619 2705f 5620 2705f IRQ ; the only source of non-nmi interrupt should be the BRK opcode. 5621 2705f ifnconst BREAKPROTECTOFF 5622 2705f a9 1a lda #$1A 5623 27061 85 20 sta BACKGRND 5624 27063 skipbrkolorset 5625 27063 skipbrkdetected 5626 27063 a9 60 lda #$60 5627 27065 8d 07 21 sta sCTRL 5628 27068 85 3c sta CTRL 5629 2706a ifnconst hiscorefont 5630 2706a 02 .byte.b $02 ; KIL/JAM 5631 2706b - else ; hiscorefont is present 5632 2706b - ifconst CRASHDUMP 5633 2706b - bit MSTAT 5634 2706b - bpl skipbrkdetected ; wait for vblank to ensure we're clear of NMI 5635 2706b - 5636 2706b - ifconst dumpbankswitch 5637 2706b - lda dumpbankswitch 5638 2706b - pha 5639 2706b - endif 5640 2706b - 5641 2706b - ; bankswitch if needed, to get to the hiscore font 5642 2706b - ifconst bankswitchmode 5643 2706b - ifconst included.hiscore.asm.bank 5644 2706b - ifconst MCPDEVCART 5645 2706b - lda #($18 | included.hiscore.asm.bank) 5646 2706b - sta $3000 5647 2706b - else 5648 2706b - lda #(included.hiscore.asm.bank) 5649 2706b - sta $8000 5650 2706b - endif 5651 2706b - endif ; included.hiscore.asm.bank 5652 2706b - endif ; bankswitchmode 5653 2706b - 5654 2706b - ifconst DOUBLEBUFFER 5655 2706b - ;turn off double-buffering, if on... 5656 2706b - lda #>DLLMEM 5657 2706b - sta DPPH 5658 2706b - lda #hiscorefont 5702 2706b - sta CHARBASE 5703 2706b - sta sCHARBASE 5704 2706b - lda #%01000011 ;Enable DMA, mode=320A 5705 2706b - sta CTRL 5706 2706b - sta sCTRL 5707 2706b - .byte $02 ; KIL/JAM 5708 2706b -hiscorehexlut 5709 2706b - ; 0 1 2 3 4 5 6 7 8 9 A B C D E F 5710 2706b - .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 5711 2706b -show2700 5712 2706b - ; lo mode hi width=29 x EODL 5713 2706b - .byte $00, %01100000, $27, 3, 20, 0,0,0 5714 2706b - else ; CRASHDUMP 5715 2706b - .byte $02 ; KIL/JAM 5716 2706b - endif ; crashdump 5717 2706b endif ; hiscorefont 5718 2706b - else 5719 2706b - RTI 5720 2706b endif 5721 2706b 5722 2706b - ifconst LONGCONTROLLERREAD 5723 2706b - 5724 2706b -longreadtype 5725 2706b - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 5726 2706b - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 5727 2706b - .byte 3, 3, 0, 0 ; STMOUSE AMOUSE ATARIVOX SNES 5728 2706b - 5729 2706b -longreadroutineloP0 5730 2706b - .byte LLRET0 ; 0 = no routine 5737 2706b - .byte >paddleport0update ; 1 = paddle 5738 2706b - .byte >trakball0update ; 2 = trackball 5739 2706b - .byte >mouse0update ; 3 = mouse 5740 2706b - 5741 2706b -longreadroutineloP1 5742 2706b - .byte LLRET1 ; 0 = no routine 5749 2706b - .byte >paddleport1update ; 1 = paddle 5750 2706b - .byte >trakball1update ; 2 = trackball 5751 2706b - .byte >mouse1update ; 3 = mouse 5752 2706b - 5753 2706b - 5754 2706b -SETTIM64T 5755 2706b - bne skipdefaulttime 5756 2706b - ifnconst PADDLESMOOTHINGOFF 5757 2706b - lda #(TIMEVAL+TIMEOFFSET+1) 5758 2706b - else 5759 2706b - lda #(TIMEVAL+TIMEOFFSET) 5760 2706b - endif 5761 2706b -skipdefaulttime 5762 2706b - tay 5763 2706b - dey 5764 2706b -.setTIM64Tloop 5765 2706b - sta TIM64T 5766 2706b - cpy INTIM 5767 2706b - bne .setTIM64Tloop 5768 2706b - rts 5769 2706b endif ; LONGCONTROLLERREAD 5770 2706b 5771 2706b reallyoffvisible 5772 2706b 85 24 sta WSYNC 5773 2706d 5774 2706d a9 00 lda #0 5775 2706f 85 4d sta visibleover 5776 27071 - ifconst DEBUGINTERRUPT 5777 27071 - sta BACKGRND 5778 27071 endif 5779 27071 5780 27071 a9 03 lda #3 5781 27073 8d b2 01 sta interruptindex 5782 27076 5783 27076 20 59 f1 jsr uninterruptableroutines 5784 27079 5785 27079 - ifconst .userinterrupt 5786 27079 - lda interrupthold 5787 27079 - beq skipuserintroutine 5788 27079 - jsr .userinterrupt 5789 27079 -skipuserintroutine 5790 27079 endif 5791 27079 5792 27079 - ifconst KEYPADSUPPORT 5793 27079 - jsr keypadcolumnread 5794 27079 - jsr keypadrowselect 5795 27079 endif 5796 27079 5797 27079 NMIexit 5798 27079 68 pla 5799 2707a a8 tay 5800 2707b 68 pla 5801 2707c aa tax 5802 2707d 68 pla 5803 2707e 40 RTI 5804 2707f 5805 2707f clearscreen 5806 2707f a2 0b ldx #(WZONECOUNT-1) 5807 27081 a9 00 lda #0 5808 27083 clearscreenloop 5809 27083 95 65 sta dlend,x 5810 27085 ca dex 5811 27086 10 fb bpl clearscreenloop 5812 27088 a9 00 lda #0 5813 2708a 8d ad 01 sta valbufend ; clear the bcd value buffer 5814 2708d 8d ae 01 sta valbufendsave 5815 27090 60 rts 5816 27091 5817 27091 restorescreen 5818 27091 a2 0b ldx #(WZONECOUNT-1) 5819 27093 a9 00 lda #0 5820 27095 restorescreenloop 5821 27095 b5 82 lda dlendsave,x 5822 27097 95 65 sta dlend,x 5823 27099 ca dex 5824 2709a 10 f9 bpl restorescreenloop 5825 2709c ad ae 01 lda valbufendsave 5826 2709f 8d ad 01 sta valbufend 5827 270a2 60 rts 5828 270a3 5829 270a3 savescreen 5830 270a3 a2 0b ldx #(WZONECOUNT-1) 5831 270a5 savescreenloop 5832 270a5 b5 65 lda dlend,x 5833 270a7 95 82 sta dlendsave,x 5834 270a9 ca dex 5835 270aa 10 f9 bpl savescreenloop 5836 270ac ad ad 01 lda valbufend 5837 270af 8d ae 01 sta valbufendsave 5838 270b2 - ifconst DOUBLEBUFFER 5839 270b2 - lda doublebufferstate 5840 270b2 - beq savescreenrts 5841 270b2 - lda #1 5842 270b2 - sta doublebufferbufferdirty 5843 270b2 -savescreenrts 5844 270b2 endif ; DOUBLEBUFFER 5845 270b2 60 rts 5846 270b3 5847 270b3 drawscreen 5848 270b3 5849 270b3 - ifconst interrupthold 5850 270b3 - lda #$FF 5851 270b3 - sta interrupthold ; if the user called drawscreen, we're ready for interrupts 5852 270b3 endif 5853 270b3 5854 270b3 a9 00 lda #0 5855 270b5 85 42 sta temp1 ; not B&W if we're here... 5856 270b7 5857 270b7 drawscreenwait 5858 270b7 a5 4d lda visibleover 5859 270b9 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 5860 270bb 5861 270bb ;restore some registers in case the game changed them mid-screen... 5862 270bb ad 07 21 lda sCTRL 5863 270be 05 42 ora temp1 5864 270c0 85 3c sta CTRL 5865 270c2 ad 0b 21 lda sCHARBASE 5866 270c5 85 34 sta CHARBASE 5867 270c7 5868 270c7 ;ensure all of the display list is terminated... 5869 270c7 20 3f f1 jsr terminatedisplaylist 5870 270ca 5871 270ca ifnconst pauseroutineoff 5872 270ca 20 d5 f0 jsr pauseroutine 5873 270cd endif ; pauseroutineoff 5874 270cd 5875 270cd ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 5876 270cd ; delaying a full frame, but still allowing time for basic calculations. 5877 270cd visiblescreenstartedwait 5878 270cd a5 4d lda visibleover 5879 270cf f0 fc beq visiblescreenstartedwait 5880 270d1 visiblescreenstartedwaitdone 5881 270d1 ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 5882 270d4 60 rts 5883 270d5 5884 270d5 ifnconst pauseroutineoff 5885 270d5 ; check to see if pause was pressed and released 5886 270d5 pauseroutine 5887 270d5 ad b3 01 lda pausedisable 5888 270d8 d0 55 bne leavepauseroutine 5889 270da a9 08 lda #8 5890 270dc 2c 82 02 bit SWCHB 5891 270df f0 30 beq pausepressed 5892 270e1 5893 270e1 ifnconst SOFTPAUSEOFF 5894 270e1 ifnconst SOFTRESETASPAUSEOFF 5895 270e1 ifnconst MOUSESUPPORT 5896 270e1 ifnconst TRAKBALLSUPPORT 5897 270e1 ad b7 01 lda port0control 5898 270e4 c9 0b cmp #11 5899 270e6 d0 07 bne skipsoftpause 5900 270e8 ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 5901 270eb 29 70 and #%01110000 ; _LDU 5902 270ed f0 22 beq pausepressed 5903 270ef skipsoftpause 5904 270ef endif 5905 270ef endif 5906 270ef endif 5907 270ef endif 5908 270ef - ifconst SNES0PAUSE 5909 270ef - lda port0control 5910 270ef - cmp #11 5911 270ef - bne skipsnes0pause 5912 270ef - lda snesdetected0 5913 270ef - beq skipsnes0pause 5914 270ef - lda snes2atari0hi 5915 270ef - and #%00010000 5916 270ef - beq pausepressed 5917 270ef -skipsnes0pause 5918 270ef endif 5919 270ef - ifconst SNES1PAUSE 5920 270ef - 5921 270ef - lda port1control 5922 270ef - cmp #11 5923 270ef - bne skipsnes1pause 5924 270ef - lda snesdetected1 5925 270ef - beq skipsnes1pause 5926 270ef - lda snes2atari1hi 5927 270ef - and #%00010000 5928 270ef - beq pausepressed 5929 270ef -skipsnes1pause 5930 270ef endif 5931 270ef - ifconst SNESNPAUSE 5932 270ef - ldx snesport 5933 270ef - lda port0control,x 5934 270ef - cmp #11 5935 270ef - bne skipsnesNpause 5936 270ef - lda snesdetected0,x 5937 270ef - beq skipsnesNpause 5938 270ef - lda snes2atari0hi,x 5939 270ef - and #%00010000 5940 270ef - beq pausepressed 5941 270ef -skipsnesNpause 5942 270ef endif 5943 270ef 5944 270ef ;pause isn't pressed 5945 270ef a9 00 lda #0 5946 270f1 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 5947 270f4 5948 270f4 ;check if we're in an already paused state 5949 270f4 ad 00 21 lda pausestate 5950 270f7 f0 36 beq leavepauseroutine ; nope, leave 5951 270f9 5952 270f9 c9 01 cmp #1 ; last frame was the start of pausing 5953 270fb f0 2b beq enterpausestate2 ; move from state 1 to 2 5954 270fd 5955 270fd c9 02 cmp #2 5956 270ff f0 34 beq carryonpausing 5957 27101 5958 27101 ;pausestate must be >2, which means we're ending an unpause 5959 27101 a9 00 lda #0 5960 27103 8d ac 01 sta pausebuttonflag 5961 27106 8d 00 21 sta pausestate 5962 27109 ad 07 21 lda sCTRL 5963 2710c 85 3c sta CTRL 5964 2710e 4c 2f f1 jmp leavepauseroutine 5965 27111 5966 27111 pausepressed 5967 27111 ;pause is pressed 5968 27111 ad ac 01 lda pausebuttonflag 5969 27114 c9 ff cmp #$ff 5970 27116 f0 1d beq carryonpausing 5971 27118 5972 27118 ;its a new press, increment the state 5973 27118 ee 00 21 inc pausestate 5974 2711b 5975 2711b ;silence volume at the start and end of pausing 5976 2711b a9 00 lda #0 5977 2711d 85 19 sta AUDV0 5978 2711f 85 1a sta AUDV1 5979 27121 5980 27121 - ifconst pokeysupport 5981 27121 - ldy #7 5982 27121 -pausesilencepokeyaudioloop 5983 27121 - sta (pokeybase),y 5984 27121 - dey 5985 27121 - bpl pausesilencepokeyaudioloop 5986 27121 endif ; pokeysupport 5987 27121 5988 27121 a9 ff lda #$ff 5989 27123 8d ac 01 sta pausebuttonflag 5990 27126 d0 0d bne carryonpausing 5991 27128 5992 27128 enterpausestate2 5993 27128 a9 02 lda #2 5994 2712a 8d 00 21 sta pausestate 5995 2712d d0 06 bne carryonpausing 5996 2712f leavepauseroutine 5997 2712f ad 07 21 lda sCTRL 5998 27132 85 3c sta CTRL 5999 27134 60 rts 6000 27135 carryonpausing 6001 27135 - ifconst .pause 6002 27135 - jsr .pause 6003 27135 endif ; .pause 6004 27135 ad 07 21 lda sCTRL 6005 27138 09 80 ora #%10000000 ; turn off colorburst during pause... 6006 2713a 85 3c sta CTRL 6007 2713c 4c d5 f0 jmp pauseroutine 6008 2713f endif ; pauseroutineoff 6009 2713f 6010 2713f 6011 2713f - ifconst DOUBLEBUFFER 6012 2713f -skipterminatedisplaylistreturn 6013 2713f - rts 6014 2713f endif ; DOUBLEBUFFER 6015 2713f terminatedisplaylist 6016 2713f - ifconst DOUBLEBUFFER 6017 2713f - lda doublebufferstate 6018 2713f - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 6019 2713f endif ; DOUBLEBUFFER 6020 2713f terminatedisplaybuffer 6021 2713f ;add DL end entry on each DL 6022 2713f a2 0b ldx #(WZONECOUNT-1) 6023 27141 dlendloop 6024 27141 bd cf f5 lda DLPOINTL,x 6025 27144 - ifconst DOUBLEBUFFER 6026 27144 - clc 6027 27144 - adc doublebufferdloffset 6028 27144 endif ; DOUBLEBUFFER 6029 27144 85 63 sta dlpnt 6030 27146 bd c3 f5 lda DLPOINTH,x 6031 27149 - ifconst DOUBLEBUFFER 6032 27149 - adc #0 6033 27149 endif ; DOUBLEBUFFER 6034 27149 85 64 sta dlpnt+1 6035 2714b b4 65 ldy dlend,x 6036 2714d a9 00 lda #$00 6037 2714f dlendmoreloops 6038 2714f c8 iny 6039 27150 91 63 sta (dlpnt),y 6040 27152 - ifconst FRAMESKIPGLITCHFIXWEAK 6041 27152 - cpy #DLLASTOBJ+1 6042 27152 - beq dlendthiszonedone 6043 27152 - iny 6044 27152 - iny 6045 27152 - iny 6046 27152 - iny 6047 27152 - iny 6048 27152 - sta (dlpnt),y 6049 27152 -dlendthiszonedone 6050 27152 endif FRAMESKIPGLITCHFIXWEAK 6051 27152 - ifconst FRAMESKIPGLITCHFIX 6052 27152 - iny 6053 27152 - iny 6054 27152 - iny 6055 27152 - iny 6056 27152 - cpy #DLLASTOBJ-1 6057 27152 - bcc dlendmoreloops 6058 27152 endif ; FRAMESKIPGLITCHFIX 6059 27152 ca dex 6060 27153 10 ec bpl dlendloop 6061 27155 6062 27155 ifnconst pauseroutineoff 6063 27155 20 d5 f0 jsr pauseroutine 6064 27158 endif ; pauseroutineoff 6065 27158 60 rts 6066 27159 6067 27159 uninterruptableroutines 6068 27159 ; this is for routines that must happen off the visible screen, each frame. 6069 27159 6070 27159 - ifconst AVOXVOICE 6071 27159 - jsr serviceatarivoxqueue 6072 27159 endif 6073 27159 6074 27159 a9 00 lda #0 6075 2715b 8d b6 01 sta palfastframe 6076 2715e ad 09 21 lda paldetected 6077 27161 f0 10 beq skippalframeadjusting 6078 27163 ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 6079 27163 ae b5 01 ldx palframes 6080 27166 e8 inx 6081 27167 e0 05 cpx #5 6082 27169 d0 05 bne palframeskipdone 6083 2716b ee b6 01 inc palfastframe 6084 2716e a2 00 ldx #0 6085 27170 palframeskipdone 6086 27170 8e b5 01 stx palframes 6087 27173 skippalframeadjusting 6088 27173 6089 27173 - ifconst MUSICTRACKER 6090 27173 - ; We normally run the servicesong routine from the top-screen interrupt, but if it 6091 27173 - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 6092 27173 - ; If that happens, we try again here. Chances are very small we'll run into the same 6093 27173 - ; problem twice, and if we do, we just drop a musical note or two. 6094 27173 - lda sfxschedulemissed 6095 27173 - beq servicesongwasnotmissed 6096 27173 - jsr servicesong 6097 27173 -servicesongwasnotmissed 6098 27173 endif ; MUSICTRACKER 6099 27173 6100 27173 - ifconst RMT 6101 27173 - lda palfastframe 6102 27173 - beq skiprasterupdate2 6103 27173 - lda rasterpause 6104 27173 - beq skiprasterupdate2 6105 27173 - jsr RASTERMUSICTRACKER+3 6106 27173 -skiprasterupdate2 6107 27173 endif 6108 27173 6109 27173 6110 27173 60 rts 6111 27174 6112 27174 serviceatarivoxqueue 6113 27174 - ifconst AVOXVOICE 6114 27174 - lda voxlock 6115 27174 - bne skipvoxprocessing ; the vox is in the middle of speech address update 6116 27174 -skipvoxqueuesizedec 6117 27174 - jmp processavoxvoice 6118 27174 -skipvoxprocessing 6119 27174 - rts 6120 27174 - 6121 27174 -processavoxvoice 6122 27174 - lda avoxenable 6123 27174 - bne avoxfixport 6124 27174 - SPKOUT tempavox 6125 27174 - rts 6126 27174 -avoxfixport 6127 27174 - lda #0 ; restore the port to all bits as inputs... 6128 27174 - sta CTLSWA 6129 27174 - rts 6130 27174 -silenceavoxvoice 6131 27174 - SPEAK avoxsilentdata 6132 27174 - rts 6133 27174 -avoxsilentdata 6134 27174 - .byte 31,255 6135 27174 else 6136 27174 60 rts 6137 27175 endif ; AVOXVOICE 6138 27175 6139 27175 joybuttonhandler 6140 27175 8a txa 6141 27176 0a asl 6142 27177 a8 tay 6143 27178 b9 08 00 lda INPT0,y 6144 2717b 4a lsr 6145 2717c 9d 02 21 sta sINPT1,x 6146 2717f b9 09 00 lda INPT1,y 6147 27182 29 80 and #%10000000 6148 27184 1d 02 21 ora sINPT1,x 6149 27187 9d 02 21 sta sINPT1,x 6150 2718a 6151 2718a b5 0c lda INPT4,x 6152 2718c 30 19 bmi .skip1bjoyfirecheck 6153 2718e ;one button joystick is down 6154 2718e 49 80 eor #%10000000 6155 27190 9d 02 21 sta sINPT1,x 6156 27193 6157 27193 ad b1 01 lda joybuttonmode 6158 27196 3d aa f1 and twobuttonmask,x 6159 27199 f0 0c beq .skip1bjoyfirecheck 6160 2719b ad b1 01 lda joybuttonmode 6161 2719e 1d aa f1 ora twobuttonmask,x 6162 271a1 8d b1 01 sta joybuttonmode 6163 271a4 8d 82 02 sta SWCHB 6164 271a7 .skip1bjoyfirecheck 6165 271a7 4c 57 f0 jmp buttonreadloopreturn 6166 271aa 6167 271aa twobuttonmask 6168 271aa 04 10 .byte.b %00000100,%00010000 6169 271ac 6170 271ac - ifconst SNES2ATARISUPPORT 6171 271ac - 6172 271ac -SNES_CLOCK_PORT_BIT 6173 271ac - .byte $10,$01 6174 271ac -SNES_CTLSWA_MASK 6175 271ac - .byte $30,$03 6176 271ac -SNES_CTLSWA_SIGNAL 6177 271ac - .byte $C0,$0C 6178 271ac -SWCHA_DIRMASK 6179 271ac - .byte $F0,$0F 6180 271ac -SWCHA_INVDIRMASK 6181 271ac - .byte $0F,$F0 6182 271ac - 6183 271ac - ; Probe each port for SNES, and see if autodetection succeeds anywhere. 6184 271ac -SNES_AUTODETECT 6185 271ac - ldx #1 6186 271ac -SNES_AUTODETECT_LOOP 6187 271ac - lda #1 ; proline 6188 271ac - sta port0control,x 6189 271ac - jsr setportforinput 6190 271ac - jsr setonebuttonmode 6191 271ac - jsr SNES_READ 6192 271ac - lda snesdetected0,x 6193 271ac - bne SNES_AUTODETECT_FOUND 6194 271ac - ; detection failed 6195 271ac - jsr setportforinput 6196 271ac - jsr settwobuttonmode 6197 271ac - dex 6198 271ac - bpl SNES_AUTODETECT_LOOP 6199 271ac - rts 6200 271ac -SNES_AUTODETECT_FOUND 6201 271ac - lda #11 ; formally set the snes controller 6202 271ac - sta port0control,x 6203 271ac - stx snesport 6204 271ac - rts 6205 271ac endif ; SNES2ATARISUPPORT 6206 271ac 6207 271ac snes2atarihandler 6208 271ac - ifconst SNES2ATARISUPPORT 6209 271ac -SNES2ATARI 6210 271ac - jsr SNES_READ 6211 271ac - jmp buttonreadloopreturn 6212 271ac - 6213 271ac -SNES_READ 6214 271ac - ; x=0 for left port, x=1 for right 6215 271ac - 6216 271ac - ; Start by checking if any port directions are pressed. 6217 271ac - ; Abort the autodetect for this port if so, as snes2atari doesn't ground any 6218 271ac - ; direction pins. if directions are pressed and the port is changed to output, 6219 271ac - ; that means the output is direct-shorted, and nobody seems to know if riot's 6220 271ac - ; output mode has current protection. 6221 271ac - 6222 271ac - lda SWCHA 6223 271ac - ora SWCHA_INVDIRMASK,x 6224 271ac - eor SWCHA_DIRMASK,x 6225 271ac - beq SNES_ABORT 6226 271ac - 6227 271ac - lda port0control,x 6228 271ac - cmp #11 ; snes 6229 271ac - bne snes2atari_signal_go ; if this is a first auto-detection read, go ahead and signal 6230 271ac - lda snesdetected0,x 6231 271ac - bne snes2atari_signal_skip ; if snes was available in previous frames, skip signalling 6232 271ac -snes2atari_signal_go 6233 271ac - jsr SNES2ATARI_SIGNAL 6234 271ac -snes2atari_signal_skip 6235 271ac - 6236 271ac - lda SNES_CTLSWA_MASK,x 6237 271ac - sta CTLSWA ; enable pins UP/DOWN to work as outputs 6238 271ac - sta SWCHA ; latch+clock high 6239 271ac - nop 6240 271ac - nop 6241 271ac - nop 6242 271ac - nop 6243 271ac - nop 6244 271ac - nop 6245 271ac - nop 6246 271ac - lda #$0 6247 271ac - sta SWCHA ; latch and clock low 6248 271ac - ldy #16 ; 16 bits 6249 271ac -SNES2ATARILOOP 6250 271ac - rol INPT4,x ; sample data into carry 6251 271ac - lda SNES_CLOCK_PORT_BIT,x 6252 271ac - sta SWCHA ; clock low 6253 271ac - rol snes2atari0lo,x 6254 271ac - rol snes2atari0hi,x 6255 271ac - lda #0 6256 271ac - sta SWCHA ; clock high 6257 271ac - dey ; next bit 6258 271ac - bne SNES2ATARILOOP 6259 271ac - rol INPT4,x ; 17th bit should be lo if controller is there. 6260 271ac - rol ; 17th snes bit into A low bit 6261 271ac - eor snes2atari0lo,x ; 16th bit should be hi if controller is there. 6262 271ac - and #1 6263 271ac - sta snesdetected0,x 6264 271ac - beq SNES_STOP_CLOCK ; if snes isn't detected, leave port in default state 6265 271ac - stx snesport ; snesport keeps the index of the latest autodetected controller 6266 271ac - lda SNES_CLOCK_PORT_BIT,x 6267 271ac -SNES_STOP_CLOCK 6268 271ac - sta SWCHA ; clock low 6269 271ac - sta CTLSWA ; set port bits to input avoid conflict with other drivers 6270 271ac - rts 6271 271ac -SNES_ABORT 6272 271ac - sta snesdetected0,x 6273 271ac - rts 6274 271ac -SNES2ATARI_SIGNAL 6275 271ac - ; signal to SNES2ATARI++ that we want SNES mode... 6276 271ac - lda SNES_CTLSWA_SIGNAL,x 6277 271ac - sta CTLSWA 6278 271ac - lda #0 6279 271ac - sta SWCHA 6280 271ac - ldy #0 6281 271ac -SNES_SIGNAL_LOOP 6282 271ac - dey 6283 271ac - bne SNES_SIGNAL_LOOP 6284 271ac - lda #$FF 6285 271ac - sta SWCHA 6286 271ac - rts 6287 271ac endif 6288 271ac 6289 271ac gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 6290 271ac - ifconst LIGHTGUNSUPPORT 6291 271ac - cpx #0 6292 271ac - bne secondportgunhandler 6293 271ac -firstportgunhandler 6294 271ac - lda SWCHA 6295 271ac - asl 6296 271ac - asl 6297 271ac - asl ; shift D4 to D7 6298 271ac - and #%10000000 6299 271ac - eor #%10000000 6300 271ac - sta sINPT1 6301 271ac - jmp buttonreadloopreturn 6302 271ac -secondportgunhandler 6303 271ac - lda SWCHA 6304 271ac - lsr ; shift D0 into carry 6305 271ac - lsr ; shift carry into D7 6306 271ac - and #%10000000 6307 271ac - eor #%10000000 6308 271ac - sta sINPT3 6309 271ac - jmp buttonreadloopreturn 6310 271ac endif ; LIGHTGUNSUPPORT 6311 271ac 6312 271ac controlsusing2buttoncode 6313 271ac 00 .byte.b 0 ; 00=no controller plugged in 6314 271ad 01 .byte.b 1 ; 01=proline joystick 6315 271ae 00 .byte.b 0 ; 02=lightgun 6316 271af 00 .byte.b 0 ; 03=paddle 6317 271b0 01 .byte.b 1 ; 04=trakball 6318 271b1 01 .byte.b 1 ; 05=vcs joystick 6319 271b2 01 .byte.b 1 ; 06=driving control 6320 271b3 00 .byte.b 0 ; 07=keypad control 6321 271b4 00 .byte.b 0 ; 08=st mouse/cx80 6322 271b5 00 .byte.b 0 ; 09=amiga mouse 6323 271b6 01 .byte.b 1 ; 10=atarivox 6324 271b7 00 .byte.b 0 ; 11=snes2atari 6325 271b8 6326 271b8 buttonhandlerhi 6327 271b8 00 .byte.b 0 ; 00=no controller plugged in 6328 271b9 f1 .byte.b >joybuttonhandler ; 01=proline joystick 6329 271ba f1 .byte.b >gunbuttonhandler ; 02=lightgun 6330 271bb f5 .byte.b >paddlebuttonhandler ; 03=paddle 6331 271bc f1 .byte.b >joybuttonhandler ; 04=trakball 6332 271bd f1 .byte.b >joybuttonhandler ; 05=vcs joystick 6333 271be f1 .byte.b >joybuttonhandler ; 06=driving control 6334 271bf 00 .byte.b 0 ; 07=keypad 6335 271c0 f5 .byte.b >mousebuttonhandler ; 08=st mouse 6336 271c1 f5 .byte.b >mousebuttonhandler ; 09=amiga mouse 6337 271c2 f1 .byte.b >joybuttonhandler ; 10=atarivox 6338 271c3 f1 .byte.b >snes2atarihandler ; 11=snes 6339 271c4 buttonhandlerlo 6340 271c4 00 .byte.b 0 ; 00=no controller plugged in 6341 271c5 75 .byte.b $0F means the sound is looped while priority is active 6481 2724f 6482 2724f 05 d9 ora inttemp2 6483 27251 05 d8 ora inttemp1 ; check if F|C|V=0 6484 27253 f0 23 beq zerosfx ; if so, we're at the end of the sound. 6485 27255 6486 27255 advancesfxpointer 6487 27255 ; advance the pointer to the next sound chunk 6488 27255 c8 iny 6489 27256 84 da sty inttemp3 6490 27258 18 clc 6491 27259 b5 4e lda sfx1pointlo,x 6492 2725b 65 da adc inttemp3 6493 2725d 95 4e sta sfx1pointlo,x 6494 2725f b5 50 lda sfx1pointhi,x 6495 27261 69 00 adc #0 6496 27263 95 50 sta sfx1pointhi,x 6497 27265 4c e9 f1 jmp servicesfxchannelsloop 6498 27268 6499 27268 sfxsoundloop 6500 27268 48 pha 6501 27269 b5 52 lda sfx1priority,x 6502 2726b d0 04 bne sfxsoundloop_carryon 6503 2726d 68 pla ; fix the stack before we go 6504 2726e 4c 55 f2 jmp advancesfxpointer 6505 27271 sfxsoundloop_carryon 6506 27271 68 pla 6507 27272 29 f0 and #$F0 6508 27274 4a lsr 6509 27275 4a lsr 6510 27276 4a lsr 6511 27277 4a lsr 6512 27278 6513 27278 zerosfx 6514 27278 95 4e sta sfx1pointlo,x 6515 2727a 95 50 sta sfx1pointhi,x 6516 2727c 95 52 sta sfx1priority,x 6517 2727e 4c e9 f1 jmp servicesfxchannelsloop 6518 27281 6519 27281 6520 27281 schedulesfx 6521 27281 ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 6522 27281 a0 00 ldy #0 6523 27283 b1 e0 lda (sfxinstrumentlo),y 6524 27285 - ifconst pokeysupport 6525 27285 - cmp #$20 ; POKEY? 6526 27285 - bne scheduletiasfx 6527 27285 - jmp schedulepokeysfx 6528 27285 endif 6529 27285 scheduletiasfx 6530 27285 ;cmp #$10 ; TIA? 6531 27285 ;beq continuescheduletiasfx 6532 27285 ; rts ; unhandled!!! 6533 27285 continuescheduletiasfx 6534 27285 ifnconst TIASFXMONO 6535 27285 a5 4e lda sfx1pointlo 6536 27287 05 50 ora sfx1pointhi 6537 27289 f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 6538 2728b a5 4f lda sfx2pointlo 6539 2728d 05 51 ora sfx2pointhi 6540 2728f f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 6541 27291 ; Both channels are scheduled. 6542 27291 a0 01 ldy #1 6543 27293 b1 e0 lda (sfxinstrumentlo),y 6544 27295 d0 01 bne interruptsfx 6545 27297 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 6546 27298 interruptsfx 6547 27298 ;Compare which active sound has a lower priority. We'll interrupt the lower one. 6548 27298 a5 52 lda sfx1priority 6549 2729a c5 53 cmp sfx2priority 6550 2729c b0 04 bcs schedulesfx2 6551 2729e endif ; !TIASFXMONO 6552 2729e 6553 2729e schedulesfx1 6554 2729e a2 00 ldx #0 ; channel 1 6555 272a0 ifnconst TIASFXMONO 6556 272a0 f0 02 beq skipschedulesfx2 6557 272a2 schedulesfx2 6558 272a2 a2 01 ldx #1 ; channel 2 6559 272a4 skipschedulesfx2 6560 272a4 endif ; !TIASFXMONO 6561 272a4 6562 272a4 - ifconst MUSICTRACKER 6563 272a4 - lda sfxnoteindex 6564 272a4 - bpl skipdrumkitoverride 6565 272a4 - and #$7F ; subtract 128 6566 272a4 - sec 6567 272a4 - sbc #4 ; drums start at 132, i.e. octave 10 6568 272a4 - asl 6569 272a4 - tay 6570 272a4 - lda tiadrumkitdefinition,y 6571 272a4 - sta sfxinstrumentlo 6572 272a4 - iny 6573 272a4 - lda tiadrumkitdefinition,y 6574 272a4 - sta sfxinstrumenthi 6575 272a4 - lda #0 6576 272a4 - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 6577 272a4 -skipdrumkitoverride 6578 272a4 endif ; MUSICTRACKER 6579 272a4 a0 01 ldy #1 ; get priority and sound-resolution (in frames) 6580 272a6 b1 e0 lda (sfxinstrumentlo),y 6581 272a8 95 52 sta sfx1priority,x 6582 272aa c8 iny 6583 272ab b1 e0 lda (sfxinstrumentlo),y 6584 272ad 95 56 sta sfx1frames,x 6585 272af a5 e0 lda sfxinstrumentlo 6586 272b1 18 clc 6587 272b2 69 03 adc #3 6588 272b4 95 4e sta sfx1pointlo,x 6589 272b6 a5 e1 lda sfxinstrumenthi 6590 272b8 69 00 adc #0 6591 272ba 95 50 sta sfx1pointhi,x 6592 272bc a5 e2 lda sfxpitchoffset 6593 272be 95 54 sta sfx1poffset,x 6594 272c0 a9 00 lda #0 6595 272c2 95 58 sta sfx1tick,x 6596 272c4 a5 e3 lda sfxnoteindex 6597 272c6 95 cd sta sfx1notedata,x 6598 272c8 60 rts 6599 272c9 6600 272c9 plotsprite 6601 272c9 ifnconst NODRAWWAIT 6602 272c9 - ifconst DOUBLEBUFFER 6603 272c9 - lda doublebufferstate 6604 272c9 - bne skipplotspritewait 6605 272c9 endif ; DOUBLEBUFFER 6606 272c9 - ifconst DEBUGWAITCOLOR 6607 272c9 - lda #$41 6608 272c9 - sta BACKGRND 6609 272c9 endif 6610 272c9 plotspritewait 6611 272c9 a5 4d lda visibleover 6612 272cb d0 fc bne plotspritewait 6613 272cd skipplotspritewait 6614 272cd - ifconst DEBUGWAITCOLOR 6615 272cd - lda #$0 6616 272cd - sta BACKGRND 6617 272cd endif 6618 272cd endif 6619 272cd 6620 272cd ;arguments: 6621 272cd ; temp1=lo graphicdata 6622 272cd ; temp2=hi graphicdata 6623 272cd ; temp3=palette | width byte 6624 272cd ; temp4=x 6625 272cd ; temp5=y 6626 272cd ; temp6=mode 6627 272cd a5 46 lda temp5 ;Y position 6628 272cf 4a lsr ; 2 - Divide by 8 or 16 6629 272d0 4a lsr ; 2 6630 272d1 4a lsr ; 2 6631 272d2 if WZONEHEIGHT = 16 6632 272d2 4a lsr ; 2 6633 272d3 endif 6634 272d3 6635 272d3 aa tax 6636 272d4 6637 272d4 ifnconst NOLIMITCHECKING 6638 272d4 6639 272d4 ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 6640 272d4 6641 272d4 c9 0c cmp #WZONECOUNT 6642 272d6 6643 272d6 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 6644 272d8 ; otherwise, check to see if the bottom half is in zone 0... 6645 272d8 6646 272d8 if WZONEHEIGHT = 16 6647 272d8 c9 0f cmp #15 6648 272da - else 6649 272da - cmp #31 6650 272da endif 6651 272da 6652 272da d0 05 bne exitplotsprite1 6653 272dc a2 00 ldx #0 6654 272de 4c 17 f3 jmp continueplotsprite2 6655 272e1 exitplotsprite1 6656 272e1 60 rts 6657 272e2 6658 272e2 continueplotsprite1 6659 272e2 endif 6660 272e2 6661 272e2 bd cf f5 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 6662 272e5 - ifconst DOUBLEBUFFER 6663 272e5 - clc 6664 272e5 - adc doublebufferdloffset 6665 272e5 endif ; DOUBLEBUFFER 6666 272e5 85 63 sta dlpnt 6667 272e7 bd c3 f5 lda DLPOINTH,x 6668 272ea - ifconst DOUBLEBUFFER 6669 272ea - adc #0 6670 272ea endif ; DOUBLEBUFFER 6671 272ea 85 64 sta dlpnt+1 6672 272ec 6673 272ec ;Create DL entry for upper part of sprite 6674 272ec 6675 272ec b4 65 ldy dlend,x ;Get the index to the end of this DL 6676 272ee 6677 272ee - ifconst CHECKOVERWRITE 6678 272ee - cpy #DLLASTOBJ 6679 272ee - beq checkcontinueplotsprite2 6680 272ee -continueplotsprite1a 6681 272ee endif 6682 272ee 6683 272ee a5 42 lda temp1 ; graphic data, lo byte 6684 272f0 91 63 sta (dlpnt),y ;Low byte of data address 6685 272f2 6686 272f2 ifnconst ATOMICSPRITEUPDATE 6687 272f2 c8 iny 6688 272f3 a5 47 lda temp6 6689 272f5 91 63 sta (dlpnt),y 6690 272f7 - else 6691 272f7 - iny 6692 272f7 - sty temp8 6693 272f7 endif 6694 272f7 6695 272f7 c8 iny 6696 272f8 6697 272f8 a5 46 lda temp5 ;Y position 6698 272fa 29 0f and #(WZONEHEIGHT - 1) 6699 272fc c9 01 cmp #1 ; clear carry if our sprite is just in this zone 6700 272fe 05 43 ora temp2 ; graphic data, hi byte 6701 27300 91 63 sta (dlpnt),y 6702 27302 6703 27302 6704 27302 c8 iny 6705 27303 a5 44 lda temp3 ;palette|width 6706 27305 91 63 sta (dlpnt),y 6707 27307 6708 27307 c8 iny 6709 27308 a5 45 lda temp4 ;Horizontal position 6710 2730a 91 63 sta (dlpnt),y 6711 2730c 6712 2730c c8 iny 6713 2730d 94 65 sty dlend,x 6714 2730f 6715 2730f - ifconst ALWAYSTERMINATE 6716 2730f - iny 6717 2730f - lda #0 6718 2730f - sta (dlpnt),y 6719 2730f endif 6720 2730f 6721 2730f - ifconst ATOMICSPRITEUPDATE 6722 2730f - ldy temp8 6723 2730f - lda temp6 6724 2730f - sta (dlpnt),y 6725 2730f endif 6726 2730f 6727 2730f checkcontinueplotsprite2 6728 2730f 6729 2730f 90 33 bcc doneSPDL ;branch if the sprite was fully in the last zone 6730 27311 6731 27311 ;Create DL entry for lower part of sprite 6732 27311 6733 27311 e8 inx ;Next region 6734 27312 6735 27312 ifnconst NOLIMITCHECKING 6736 27312 e0 0c cpx #WZONECOUNT 6737 27314 6738 27314 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 6739 27316 60 rts 6740 27317 continueplotsprite2 6741 27317 endif 6742 27317 6743 27317 bd cf f5 lda DLPOINTL,x ;Get pointer to next DL 6744 2731a - ifconst DOUBLEBUFFER 6745 2731a - clc 6746 2731a - adc doublebufferdloffset 6747 2731a endif ; DOUBLEBUFFER 6748 2731a 85 63 sta dlpnt 6749 2731c bd c3 f5 lda DLPOINTH,x 6750 2731f - ifconst DOUBLEBUFFER 6751 2731f - adc #0 6752 2731f endif ; DOUBLEBUFFER 6753 2731f 85 64 sta dlpnt+1 6754 27321 b4 65 ldy dlend,x ;Get the index to the end of this DL 6755 27323 6756 27323 - ifconst CHECKOVERWRITE 6757 27323 - cpy #DLLASTOBJ 6758 27323 - bne continueplotsprite2a 6759 27323 - rts 6760 27323 -continueplotsprite2a 6761 27323 endif 6762 27323 6763 27323 a5 42 lda temp1 ; graphic data, lo byte 6764 27325 91 63 sta (dlpnt),y 6765 27327 6766 27327 ifnconst ATOMICSPRITEUPDATE 6767 27327 c8 iny 6768 27328 a5 47 lda temp6 6769 2732a 91 63 sta (dlpnt),y 6770 2732c - else 6771 2732c - iny 6772 2732c - sty temp8 6773 2732c endif 6774 2732c 6775 2732c c8 iny 6776 2732d 6777 2732d a5 46 lda temp5 ;Y position 6778 2732f 0b 0f anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 6779 27331 05 43 ora temp2 ; graphic data, hi byte 6780 27333 e9 0f sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 6781 27335 91 63 sta (dlpnt),y 6782 27337 6783 27337 c8 iny 6784 27338 6785 27338 a5 44 lda temp3 ;palette|width 6786 2733a 91 63 sta (dlpnt),y 6787 2733c 6788 2733c c8 iny 6789 2733d 6790 2733d a5 45 lda temp4 ;Horizontal position 6791 2733f 91 63 sta (dlpnt),y 6792 27341 6793 27341 c8 iny 6794 27342 94 65 sty dlend,x 6795 27344 6796 27344 - ifconst ALWAYSTERMINATE 6797 27344 - iny 6798 27344 - lda #0 6799 27344 - sta (dlpnt),y 6800 27344 endif 6801 27344 6802 27344 - ifconst ATOMICSPRITEUPDATE 6803 27344 - ldy temp8 6804 27344 - lda temp6 6805 27344 - sta (dlpnt),y 6806 27344 endif 6807 27344 6808 27344 doneSPDL 6809 27344 60 rts 6810 27345 6811 27345 6812 27345 lockzonex 6813 27345 - ifconst ZONELOCKS 6814 27345 - ldy dlend,x 6815 27345 - cpy #DLLASTOBJ 6816 27345 - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 6817 27345 - lda DLPOINTL,x 6818 27345 - ifconst DOUBLEBUFFER 6819 27345 - clc 6820 27345 - adc doublebufferdloffset 6821 27345 - endif ; DOUBLEBUFFER 6822 27345 - sta dlpnt 6823 27345 - lda DLPOINTH,x 6824 27345 - ifconst DOUBLEBUFFER 6825 27345 - adc #0 6826 27345 - endif ; DOUBLEBUFFER 6827 27345 - sta dlpnt+1 6828 27345 - iny 6829 27345 - lda #0 6830 27345 - sta (dlpnt),y 6831 27345 - dey 6832 27345 - tya 6833 27345 - ldy #(DLLASTOBJ-1) 6834 27345 - sta (dlpnt),y 6835 27345 - iny 6836 27345 - sty dlend,x 6837 27345 -lockzonexreturn 6838 27345 - rts 6839 27345 endif ; ZONELOCKS 6840 27345 unlockzonex 6841 27345 - ifconst ZONELOCKS 6842 27345 - ldy dlend,x 6843 27345 - cpy #DLLASTOBJ 6844 27345 - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 6845 27345 - lda DLPOINTL,x 6846 27345 - ifconst DOUBLEBUFFER 6847 27345 - clc 6848 27345 - adc doublebufferdloffset 6849 27345 - endif ; DOUBLEBUFFER 6850 27345 - sta dlpnt 6851 27345 - lda DLPOINTH,x 6852 27345 - ifconst DOUBLEBUFFER 6853 27345 - adc #0 6854 27345 - endif ; DOUBLEBUFFER 6855 27345 - sta dlpnt+1 6856 27345 - dey 6857 27345 - ;ldy #(DLLASTOBJ-1) 6858 27345 - lda (dlpnt),y 6859 27345 - tay 6860 27345 - sty dlend,x 6861 27345 -unlockzonexreturn 6862 27345 endif ; ZONELOCKS 6863 27345 60 rts 6864 27346 6865 27346 plotcharloop 6866 27346 ; ** read from a data indirectly pointed to from temp8,temp9 6867 27346 ; ** format is: lo_data, hi_data, palette|width, x, y 6868 27346 ; ** format ends with lo_data | hi_data = 0 6869 27346 6870 27346 - ifconst DOUBLEBUFFER 6871 27346 - lda doublebufferstate 6872 27346 - bne skipplotcharloopwait 6873 27346 endif ; DOUBLEBUFFER 6874 27346 - ifconst DEBUGWAITCOLOR 6875 27346 - lda #$61 6876 27346 - sta BACKGRND 6877 27346 endif 6878 27346 plotcharloopwait 6879 27346 a5 4d lda visibleover 6880 27348 d0 fc bne plotcharloopwait 6881 2734a - ifconst DEBUGWAITCOLOR 6882 2734a - lda #0 6883 2734a - sta BACKGRND 6884 2734a endif 6885 2734a skipplotcharloopwait 6886 2734a plotcharlooploop 6887 2734a a0 00 ldy #0 6888 2734c b1 49 lda (temp8),y 6889 2734e 85 42 sta temp1 6890 27350 c8 iny 6891 27351 b1 49 lda (temp8),y 6892 27353 85 43 sta temp2 6893 27355 05 42 ora temp1 6894 27357 d0 01 bne plotcharloopcontinue 6895 27359 ;the pointer=0, so return 6896 27359 60 rts 6897 2735a plotcharloopcontinue 6898 2735a c8 iny 6899 2735b b1 49 lda (temp8),y 6900 2735d 85 44 sta temp3 6901 2735f c8 iny 6902 27360 b1 49 lda (temp8),y 6903 27362 85 45 sta temp4 6904 27364 c8 iny 6905 27365 b1 49 lda (temp8),y 6906 27367 ;sta temp5 ; not needed with our late entry. 6907 27367 20 80 f3 jsr plotcharactersskipentry 6908 2736a a5 49 lda temp8 6909 2736c 18 clc 6910 2736d 69 05 adc #5 6911 2736f 85 49 sta temp8 6912 27371 a5 4a lda temp9 6913 27373 69 00 adc #0 6914 27375 85 4a sta temp9 6915 27377 4c 4a f3 jmp plotcharlooploop 6916 2737a 6917 2737a plotcharacters 6918 2737a - ifconst DOUBLEBUFFER 6919 2737a - lda doublebufferstate 6920 2737a - bne skipplotcharacterswait 6921 2737a endif ; DOUBLEBUFFER 6922 2737a - ifconst DEBUGWAITCOLOR 6923 2737a - lda #$41 6924 2737a - sta BACKGRND 6925 2737a endif 6926 2737a plotcharacterswait 6927 2737a a5 4d lda visibleover 6928 2737c d0 fc bne plotcharacterswait 6929 2737e - ifconst DEBUGWAITCOLOR 6930 2737e - sta BACKGRND 6931 2737e endif 6932 2737e skipplotcharacterswait 6933 2737e ;arguments: 6934 2737e ; temp1=lo charactermap 6935 2737e ; temp2=hi charactermap 6936 2737e ; temp3=palette | width byte 6937 2737e ; temp4=x 6938 2737e ; temp5=y 6939 2737e 6940 2737e a5 46 lda temp5 ;Y position 6941 27380 6942 27380 plotcharactersskipentry 6943 27380 6944 27380 ;ifconst ZONEHEIGHT 6945 27380 ; if ZONEHEIGHT = 16 6946 27380 ; and #$0F 6947 27380 ; endif 6948 27380 ; if ZONEHEIGHT = 8 6949 27380 ; and #$1F 6950 27380 ; endif 6951 27380 ;else 6952 27380 ; and #$0F 6953 27380 ;endif 6954 27380 6955 27380 aa tax 6956 27381 bd cf f5 lda DLPOINTL,x ;Get pointer to DL that the characters are in 6957 27384 - ifconst DOUBLEBUFFER 6958 27384 - clc 6959 27384 - adc doublebufferdloffset 6960 27384 endif ; DOUBLEBUFFER 6961 27384 85 63 sta dlpnt 6962 27386 bd c3 f5 lda DLPOINTH,x 6963 27389 - ifconst DOUBLEBUFFER 6964 27389 - adc #0 6965 27389 endif ; DOUBLEBUFFER 6966 27389 85 64 sta dlpnt+1 6967 2738b 6968 2738b ;Create DL entry for the characters 6969 2738b 6970 2738b b4 65 ldy dlend,x ;Get the index to the end of this DL 6971 2738d 6972 2738d - ifconst CHECKOVERWRITE 6973 2738d - cpy #DLLASTOBJ 6974 2738d - bne continueplotcharacters 6975 2738d - rts 6976 2738d -continueplotcharacters 6977 2738d endif 6978 2738d 6979 2738d a5 42 lda temp1 ; character map data, lo byte 6980 2738f 91 63 sta (dlpnt),y ;(1) store low address 6981 27391 6982 27391 c8 iny 6983 27392 ad 06 21 lda charactermode 6984 27395 91 63 sta (dlpnt),y ;(2) store mode 6985 27397 6986 27397 c8 iny 6987 27398 a5 43 lda temp2 ; character map, hi byte 6988 2739a 91 63 sta (dlpnt),y ;(3) store high address 6989 2739c 6990 2739c c8 iny 6991 2739d a5 44 lda temp3 ;palette|width 6992 2739f 91 63 sta (dlpnt),y ;(4) store palette|width 6993 273a1 6994 273a1 c8 iny 6995 273a2 a5 45 lda temp4 ;Horizontal position 6996 273a4 91 63 sta (dlpnt),y ;(5) store horizontal position 6997 273a6 6998 273a6 c8 iny 6999 273a7 94 65 sty dlend,x ; save display list end byte 7000 273a9 60 rts 7001 273aa 7002 273aa 7003 273aa - ifconst plotvalueonscreen 7004 273aa -plotcharacterslive 7005 273aa - ; a version of plotcharacters that draws live and minimally disrupts the screen... 7006 273aa - 7007 273aa - ;arguments: 7008 273aa - ; temp1=lo charactermap 7009 273aa - ; temp2=hi charactermap 7010 273aa - ; temp3=palette | width byte 7011 273aa - ; temp4=x 7012 273aa - ; temp5=y 7013 273aa - 7014 273aa - lda temp5 ;Y position 7015 273aa - 7016 273aa - tax 7017 273aa - lda DLPOINTL,x ;Get pointer to DL that the characters are in 7018 273aa - ifconst DOUBLEBUFFER 7019 273aa - clc 7020 273aa - adc doublebufferdloffset 7021 273aa - endif ; DOUBLEBUFFER 7022 273aa - sta dlpnt 7023 273aa - lda DLPOINTH,x 7024 273aa - ifconst DOUBLEBUFFER 7025 273aa - adc #0 7026 273aa - endif ; DOUBLEBUFFER 7027 273aa - sta dlpnt+1 7028 273aa - 7029 273aa - ;Create DL entry for the characters 7030 273aa - 7031 273aa - ldy dlend,x ;Get the index to the end of this DL 7032 273aa - 7033 273aa - ifconst CHECKOVERWRITE 7034 273aa - cpy #DLLASTOBJ 7035 273aa - bne continueplotcharacterslive 7036 273aa - rts 7037 273aa -continueplotcharacterslive 7038 273aa - endif 7039 273aa - 7040 273aa - lda temp1 ; character map data, lo byte 7041 273aa - sta (dlpnt),y ;(1) store low address 7042 273aa - 7043 273aa - iny 7044 273aa - ; we don't add the second byte yet, since the charmap could briefly 7045 273aa - ; render without a proper character map address, width, or position. 7046 273aa - lda charactermode 7047 273aa - sta (dlpnt),y ;(2) store mode 7048 273aa - 7049 273aa - iny 7050 273aa - lda temp2 ; character map, hi byte 7051 273aa - sta (dlpnt),y ;(3) store high address 7052 273aa - 7053 273aa - iny 7054 273aa - lda temp3 ;palette|width 7055 273aa - sta (dlpnt),y ;(4) store palette|width 7056 273aa - 7057 273aa - iny 7058 273aa - lda temp4 ;Horizontal position 7059 273aa - sta (dlpnt),y ;(5) store horizontal position 7060 273aa - 7061 273aa - iny 7062 273aa - sty dlend,x ; save display list end byte 7063 273aa - 7064 273aa - rts 7065 273aa endif ;plotcharacterslive 7066 273aa 7067 273aa - ifconst USED_PLOTVALUE 7068 273aa -plotvalue 7069 273aa - ; calling 7800basic command: 7070 273aa - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 7071 273aa - ; ...displays the variable as BCD digits 7072 273aa - ; 7073 273aa - ; asm sub arguments: 7074 273aa - ; temp1=lo charactermap 7075 273aa - ; temp2=hi charactermap 7076 273aa - ; temp3=palette | width byte 7077 273aa - ; temp4=x 7078 273aa - ; temp5=y 7079 273aa - ; temp6=number of digits 7080 273aa - ; temp7=lo variable 7081 273aa - ; temp8=hi variable 7082 273aa - ; temp9=character mode 7083 273aa - 7084 273aa -plotdigitcount = temp6 7085 273aa - 7086 273aa - ifconst ZONELOCKS 7087 273aa - ldx temp5 7088 273aa - ldy dlend,x 7089 273aa - cpy #DLLASTOBJ 7090 273aa - bne carryonplotvalue 7091 273aa - rts 7092 273aa -carryonplotvalue 7093 273aa - endif 7094 273aa - 7095 273aa - lda #0 7096 273aa - tay 7097 273aa - ldx valbufend 7098 273aa - 7099 273aa - lda plotdigitcount 7100 273aa - and #1 7101 273aa - beq pvnibble2char 7102 273aa - lda #0 7103 273aa - sta VALBUFFER,x ; just in case we skip this digit 7104 273aa - beq pvnibble2char_skipnibble 7105 273aa - 7106 273aa -pvnibble2char 7107 273aa - ; high nibble... 7108 273aa - lda (temp7),y 7109 273aa - and #$f0 7110 273aa - lsr 7111 273aa - lsr 7112 273aa - lsr 7113 273aa - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 7114 273aa - lsr 7115 273aa - endif 7116 273aa - 7117 273aa - clc 7118 273aa - adc temp1 ; add the offset to character graphics to our value 7119 273aa - sta VALBUFFER,x 7120 273aa - inx 7121 273aa - dec plotdigitcount 7122 273aa - 7123 273aa -pvnibble2char_skipnibble 7124 273aa - ; low nibble... 7125 273aa - lda (temp7),y 7126 273aa - and #$0f 7127 273aa - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 7128 273aa - asl 7129 273aa - endif 7130 273aa - clc 7131 273aa - adc temp1 ; add the offset to character graphics to our value 7132 273aa - sta VALBUFFER,x 7133 273aa - inx 7134 273aa - iny 7135 273aa - 7136 273aa - dec plotdigitcount 7137 273aa - bne pvnibble2char 7138 273aa - 7139 273aa - ;point to the start of our valuebuffer 7140 273aa - clc 7141 273aa - lda #VALBUFFER 7145 273aa - adc #0 7146 273aa - sta temp2 7147 273aa - 7148 273aa - ;advance valbufend to the end of our value buffer 7149 273aa - stx valbufend 7150 273aa - 7151 273aa - ifnconst plotvalueonscreen 7152 273aa - jmp plotcharacters 7153 273aa - else 7154 273aa - jmp plotcharacterslive 7155 273aa - endif 7156 273aa - 7157 273aa endif ; USED_PLOTVALUE 7158 273aa 7159 273aa 7160 273aa - ifconst USED_PLOTVALUEEXTRA 7161 273aa -plotdigitcount = temp6 7162 273aa -plotvalueextra 7163 273aa - ; calling 7800basic command: 7164 273aa - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 7165 273aa - ; ...displays the variable as BCD digits 7166 273aa - ; 7167 273aa - ; asm sub arguments: 7168 273aa - ; temp1=lo charactermap 7169 273aa - ; temp2=hi charactermap 7170 273aa - ; temp3=palette | width byte 7171 273aa - ; temp4=x 7172 273aa - ; temp5=y 7173 273aa - ; temp6=number of digits 7174 273aa - ; temp7=lo variable 7175 273aa - ; temp8=hi variable 7176 273aa - 7177 273aa - lda #0 7178 273aa - tay 7179 273aa - ldx valbufend 7180 273aa - ifnconst plotvalueonscreen 7181 273aa - sta VALBUFFER,x 7182 273aa - endif 7183 273aa - 7184 273aa - lda plotdigitcount 7185 273aa - and #1 7186 273aa - 7187 273aa - bne pvnibble2char_skipnibbleextra 7188 273aa - 7189 273aa -pvnibble2charextra 7190 273aa - ; high nibble... 7191 273aa - lda (temp7),y 7192 273aa - and #$f0 7193 273aa - lsr 7194 273aa - lsr 7195 273aa - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 7196 273aa - lsr 7197 273aa - endif 7198 273aa - clc 7199 273aa - adc temp1 ; add the offset to character graphics to our value 7200 273aa - sta VALBUFFER,x 7201 273aa - inx 7202 273aa - 7203 273aa - ; second half of the digit 7204 273aa - clc 7205 273aa - adc #1 7206 273aa - sta VALBUFFER,x 7207 273aa - inx 7208 273aa - 7209 273aa -pvnibble2char_skipnibbleextra 7210 273aa - ; low nibble... 7211 273aa - lda (temp7),y 7212 273aa - and #$0f 7213 273aa - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 7214 273aa - asl 7215 273aa - endif 7216 273aa - asl 7217 273aa - 7218 273aa - clc 7219 273aa - adc temp1 ; add the offset to character graphics to our value 7220 273aa - sta VALBUFFER,x 7221 273aa - inx 7222 273aa - 7223 273aa - clc 7224 273aa - adc #1 7225 273aa - sta VALBUFFER,x 7226 273aa - inx 7227 273aa - iny 7228 273aa - 7229 273aa - dec plotdigitcount 7230 273aa - bne pvnibble2charextra 7231 273aa - 7232 273aa - ;point to the start of our valuebuffer 7233 273aa - clc 7234 273aa - lda #VALBUFFER 7238 273aa - adc #0 7239 273aa - sta temp2 7240 273aa - 7241 273aa - ;advance valbufend to the end of our value buffer 7242 273aa - stx valbufend 7243 273aa - 7244 273aa - ifnconst plotvalueonscreen 7245 273aa - jmp plotcharacters 7246 273aa - else 7247 273aa - jmp plotcharacterslive 7248 273aa - endif 7249 273aa endif ; USED_PLOTVALUEEXTRA 7250 273aa 7251 273aa boxcollision 7252 273aa - ifconst BOXCOLLISION 7253 273aa - ; the worst case cycle-time for the code below is 43 cycles. 7254 273aa - ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 7255 273aa - 7256 273aa - ;__boxx1 = accumulator 7257 273aa - ;__boxy1 = y 7258 273aa -__boxw1 = temp3 7259 273aa -__boxh1 = temp4 7260 273aa - 7261 273aa -__boxx2 = temp5 7262 273aa -__boxy2 = temp6 7263 273aa -__boxw2 = temp7 7264 273aa -__boxh2 = temp8 7265 273aa - 7266 273aa -DoXCollisionCheck 7267 273aa - ;lda __boxx1 ; skipped. already in the accumulator 7268 273aa - cmp __boxx2 ;3 7269 273aa - bcs X1isbiggerthanX2 ;2/3 7270 273aa -X2isbiggerthanX1 7271 273aa - ; carry is clear 7272 273aa - adc __boxw1 ;3 7273 273aa - cmp __boxx2 ;3 7274 273aa - bcs DoYCollisionCheck ;3/2 7275 273aa - rts ;6 - carry clear, no collision 7276 273aa -X1isbiggerthanX2 7277 273aa - clc ;2 7278 273aa - sbc __boxw2 ;3 7279 273aa - cmp __boxx2 ;3 7280 273aa - bcs noboxcollision ;3/2 7281 273aa -DoYCollisionCheck 7282 273aa - tya ; 2 ; use to be "lda __boxy1" 7283 273aa - cmp __boxy2 ;3 7284 273aa - bcs Y1isbiggerthanY2 ;3/2 7285 273aa -Y2isbiggerthanY1 7286 273aa - ; carry is clear 7287 273aa - adc __boxh1 ;3 7288 273aa - cmp __boxy2 ;3 7289 273aa - rts ;6 7290 273aa -Y1isbiggerthanY2 7291 273aa - clc ;2 7292 273aa - sbc __boxh2 ;3 7293 273aa - cmp __boxy2 ;3 7294 273aa - bcs noboxcollision ;3/2 7295 273aa -yesboxcollision 7296 273aa - sec ;2 7297 273aa - rts ;6 7298 273aa -noboxcollision 7299 273aa - clc ;2 7300 273aa - rts ;6 7301 273aa endif ; BOXCOLLISION 7302 273aa 7303 273aa randomize 7304 273aa a5 40 lda rand 7305 273ac 4a lsr 7306 273ad 26 41 rol rand16 7307 273af 90 02 bcc noeor 7308 273b1 49 b4 eor #$B4 7309 273b3 noeor 7310 273b3 85 40 sta rand 7311 273b5 45 41 eor rand16 7312 273b7 60 rts 7313 273b8 7314 273b8 ; *** bcd conversion routine courtesy Omegamatrix 7315 273b8 ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 7316 273b8 converttobcd 7317 273b8 ;value to convert is in the accumulator 7318 273b8 85 42 sta temp1 7319 273ba 4a lsr 7320 273bb 65 42 adc temp1 7321 273bd 6a ror 7322 273be 4a lsr 7323 273bf 4a lsr 7324 273c0 65 42 adc temp1 7325 273c2 6a ror 7326 273c3 65 42 adc temp1 7327 273c5 6a ror 7328 273c6 4a lsr 7329 273c7 29 3c and #$3C 7330 273c9 85 43 sta temp2 7331 273cb 4a lsr 7332 273cc 65 43 adc temp2 7333 273ce 65 42 adc temp1 7334 273d0 60 rts ; return the result in the accumulator 7335 273d1 7336 273d1 ; Y and A contain multiplicands, result in A 7337 273d1 mul8 7338 273d1 84 42 sty temp1 7339 273d3 85 43 sta temp2 7340 273d5 a9 00 lda #0 7341 273d7 reptmul8 7342 273d7 46 43 lsr temp2 7343 273d9 90 03 bcc skipmul8 7344 273db 18 clc 7345 273dc 65 42 adc temp1 7346 273de ;bcs donemul8 might save cycles? 7347 273de skipmul8 7348 273de ;beq donemul8 might save cycles? 7349 273de 06 42 asl temp1 7350 273e0 d0 f5 bne reptmul8 7351 273e2 donemul8 7352 273e2 60 rts 7353 273e3 7354 273e3 div8 7355 273e3 ; A=numerator Y=denominator, result in A 7356 273e3 c0 02 cpy #2 7357 273e5 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 7358 273e7 84 42 sty temp1 7359 273e9 a0 ff ldy #$ff 7360 273eb div8loop 7361 273eb e5 42 sbc temp1 7362 273ed c8 iny 7363 273ee b0 fb bcs div8loop 7364 273f0 div8end 7365 273f0 98 tya 7366 273f1 ; result in A 7367 273f1 60 rts 7368 273f2 7369 273f2 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 7370 273f2 mul16 7371 273f2 84 42 sty temp1 7372 273f4 85 43 sta temp2 7373 273f6 7374 273f6 a9 00 lda #0 7375 273f8 a2 08 ldx #8 7376 273fa 46 42 lsr temp1 7377 273fc mul16_1 7378 273fc 90 03 bcc mul16_2 7379 273fe 18 clc 7380 273ff 65 43 adc temp2 7381 27401 mul16_2 7382 27401 6a ror 7383 27402 66 42 ror temp1 7384 27404 ca dex 7385 27405 d0 f5 bne mul16_1 7386 27407 85 43 sta temp2 7387 27409 60 rts 7388 2740a 7389 2740a ; div int/int 7390 2740a ; numerator in A, denom in temp1 7391 2740a ; returns with quotient in A, remainder in temp1 7392 2740a div16 7393 2740a 85 43 sta temp2 7394 2740c 84 42 sty temp1 7395 2740e a9 00 lda #0 7396 27410 a2 08 ldx #8 7397 27412 06 43 asl temp2 7398 27414 div16_1 7399 27414 2a rol 7400 27415 c5 42 cmp temp1 7401 27417 90 02 bcc div16_2 7402 27419 e5 42 sbc temp1 7403 2741b div16_2 7404 2741b 26 43 rol temp2 7405 2741d ca dex 7406 2741e d0 f4 bne div16_1 7407 27420 85 42 sta temp1 7408 27422 a5 43 lda temp2 7409 27424 60 rts 7410 27425 7411 27425 ifconst bankswitchmode 7412 27425 BS_jsr 7413 27425 - ifconst dumpbankswitch 7414 27425 - sta dumpbankswitch 7415 27425 endif 7416 27425 - ifconst MCPDEVCART 7417 27425 - ora #$18 7418 27425 - sta $3000 7419 27425 else 7420 27425 8d 00 80 sta $8000 7421 27428 endif 7422 27428 68 pla 7423 27429 aa tax 7424 2742a 68 pla 7425 2742b 60 rts 7426 2742c 7427 2742c BS_return 7428 2742c 68 pla ; bankswitch bank 7429 2742d - ifconst dumpbankswitch 7430 2742d - sta dumpbankswitch 7431 2742d endif 7432 2742d - ifconst BANKRAM 7433 2742d - sta currentbank 7434 2742d - ora currentrambank 7435 2742d endif 7436 2742d - ifconst MCPDEVCART 7437 2742d - ora #$18 7438 2742d - sta $3000 7439 2742d else 7440 2742d 8d 00 80 sta $8000 7441 27430 endif 7442 27430 68 pla ; bankswitch $0 flag 7443 27431 60 rts 7444 27432 endif 7445 27432 7446 27432 checkselectswitch 7447 27432 ad 82 02 lda SWCHB ; first check the real select switch... 7448 27435 29 02 and #%00000010 7449 27437 ifnconst SOFTPAUSEOFF 7450 27437 ifnconst MOUSESUPPORT 7451 27437 ifnconst TRAKBALLSUPPORT 7452 27437 f0 0f beq checkselectswitchreturn ; switch is pressed 7453 27439 ad b7 01 lda port0control 7454 2743c c9 0b cmp #11 7455 2743e d0 03 bne checkselectsoftswitch 7456 27440 a9 ff lda #$ff 7457 27442 60 rts 7458 27443 checkselectsoftswitch 7459 27443 ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 7460 27446 29 b0 and #%10110000 ; R_DU 7461 27448 endif ; TRAKBALLSUPPORT 7462 27448 endif ; MOUSESUPPORT 7463 27448 endif ; SOFTPAUSEOFF 7464 27448 checkselectswitchreturn 7465 27448 60 rts 7466 27449 7467 27449 checkresetswitch 7468 27449 ad 82 02 lda SWCHB ; first check the real reset switch... 7469 2744c 29 01 and #%00000001 7470 2744e ifnconst SOFTPAUSEOFF 7471 2744e ifnconst MOUSESUPPORT 7472 2744e ifnconst TRAKBALLSUPPORT 7473 2744e f0 0f beq checkresetswitchreturn ; switch is pressed 7474 27450 ad b7 01 lda port0control 7475 27453 c9 0b cmp #11 7476 27455 d0 03 bne checkresetsoftswitch 7477 27457 a9 ff lda #$ff 7478 27459 60 rts 7479 2745a checkresetsoftswitch 7480 2745a ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 7481 2745d 29 70 and #%01110000 ; _LDU 7482 2745f endif ; TRAKBALLSUPPORT 7483 2745f endif ; MOUSESUPPORT 7484 2745f endif ; SOFTPAUSEOFF 7485 2745f checkresetswitchreturn 7486 2745f 60 rts 7487 27460 7488 27460 - ifconst FINESCROLLENABLED 7489 27460 -finescrolldlls 7490 27460 - ldx temp1 ; first DLL index x3 7491 27460 - lda DLLMEM,x 7492 27460 - and #%11110000 7493 27460 - ora finescrolly 7494 27460 - sta DLLMEM,x 7495 27460 - 7496 27460 - ldx temp2 ; last DLL index x3 7497 27460 - lda DLLMEM,x 7498 27460 - and #%11110000 7499 27460 - ora finescrolly 7500 27460 - eor #(WZONEHEIGHT-1) 7501 27460 - sta DLLMEM,x 7502 27460 - rts 7503 27460 endif ; FINESCROLLENABLED 7504 27460 7505 27460 - ifconst USED_ADJUSTVISIBLE 7506 27460 -adjustvisible 7507 27460 - ; called with temp1=first visible zone *3, temp2=last visible zone *3 7508 27460 - jsr waitforvblankstart ; ensure vblank just started 7509 27460 - ldx visibleDLLstart 7510 27460 -findfirstinterrupt 7511 27460 - lda DLLMEM,x 7512 27460 - bmi foundfirstinterrupt 7513 27460 - inx 7514 27460 - inx 7515 27460 - inx 7516 27460 - bne findfirstinterrupt 7517 27460 -foundfirstinterrupt 7518 27460 - and #%01111111 ; clear the interrupt bit 7519 27460 - sta DLLMEM,x 7520 27460 - ifconst DOUBLEBUFFER 7521 27460 - sta DLLMEM+DBOFFSET,x 7522 27460 - endif ; DOUBLEBUFFER 7523 27460 - ldx overscanDLLstart 7524 27460 -findlastinterrupt 7525 27460 - lda DLLMEM,x 7526 27460 - bmi foundlastinterrupt 7527 27460 - dex 7528 27460 - dex 7529 27460 - dex 7530 27460 - bne findlastinterrupt 7531 27460 -foundlastinterrupt 7532 27460 - and #%01111111 ; clear the interrupt bit 7533 27460 - sta DLLMEM,x 7534 27460 - ifconst DOUBLEBUFFER 7535 27460 - sta DLLMEM+DBOFFSET,x 7536 27460 - endif ; DOUBLEBUFFER 7537 27460 - ;now we need to set the new interrupts 7538 27460 - clc 7539 27460 - lda temp1 7540 27460 - adc visibleDLLstart 7541 27460 - tax 7542 27460 - lda DLLMEM,x 7543 27460 - ora #%10000000 7544 27460 - sta DLLMEM,x 7545 27460 - ifconst DOUBLEBUFFER 7546 27460 - sta DLLMEM+DBOFFSET,x 7547 27460 - endif ; DOUBLEBUFFER 7548 27460 - clc 7549 27460 - lda temp2 7550 27460 - adc visibleDLLstart 7551 27460 - tax 7552 27460 - lda DLLMEM,x 7553 27460 - ora #%10000000 7554 27460 - sta DLLMEM,x 7555 27460 - ifconst DOUBLEBUFFER 7556 27460 - sta DLLMEM+DBOFFSET,x 7557 27460 - endif ; DOUBLEBUFFER 7558 27460 - jsr vblankresync 7559 27460 - rts 7560 27460 endif ; USED_ADJUSTVISIBLE 7561 27460 7562 27460 vblankresync 7563 27460 20 fe f4 jsr waitforvblankstart ; ensure vblank just started 7564 27463 a9 00 lda #0 7565 27465 85 4d sta visibleover 7566 27467 a9 03 lda #3 7567 27469 8d b2 01 sta interruptindex 7568 2746c 60 rts 7569 2746d 7570 2746d createallgamedlls 7571 2746d a2 00 ldx #0 7572 2746f a9 19 lda #NVLINES 7573 27471 ac 09 21 ldy paldetected 7574 27474 f0 03 beq skipcreatePALpadding 7575 27476 18 clc 7576 27477 69 15 adc #21 7577 27479 skipcreatePALpadding 7578 27479 20 ae f4 jsr createnonvisibledlls 7579 2747c 8e 3c 21 stx visibleDLLstart 7580 2747f 20 df f4 jsr createvisiblezones 7581 27482 8e 3d 21 stx overscanDLLstart 7582 27485 createallgamedllscontinue 7583 27485 a9 50 lda #(NVLINES+55) ; extras for PAL 7584 27487 20 ae f4 jsr createnonvisibledlls 7585 2748a 7586 2748a ae 3c 21 ldx visibleDLLstart 7587 2748d bd 00 18 lda DLLMEM,x 7588 27490 09 80 ora #%10000000 ; NMI 1 - start of visible screen 7589 27492 9d 00 18 sta DLLMEM,x 7590 27495 - ifconst DOUBLEBUFFER 7591 27495 - sta DLLMEM+DBOFFSET,x 7592 27495 endif ; DOUBLEBUFFER 7593 27495 7594 27495 ae 3d 21 ldx overscanDLLstart 7595 27498 bd 00 18 lda DLLMEM,x 7596 2749b 09 83 ora #%10000011 ; NMI 2 - end of visible screen 7597 2749d 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 7598 2749f 9d 00 18 sta DLLMEM,x 7599 274a2 - ifconst DOUBLEBUFFER 7600 274a2 - sta DLLMEM+DBOFFSET,x 7601 274a2 endif ; DOUBLEBUFFER 7602 274a2 7603 274a2 e8 inx 7604 274a3 e8 inx 7605 274a4 e8 inx 7606 274a5 7607 274a5 bd 00 18 lda DLLMEM,x 7608 274a8 09 80 ora #%10000000 ; NMI 3 - deeper overscan 7609 274aa 9d 00 18 sta DLLMEM,x 7610 274ad - ifconst DOUBLEBUFFER 7611 274ad - sta DLLMEM+DBOFFSET,x 7612 274ad endif ; DOUBLEBUFFER 7613 274ad 7614 274ad 60 rts 7615 274ae 7616 274ae createnonvisibledlls 7617 274ae 85 42 sta temp1 7618 274b0 4a lsr 7619 274b1 4a lsr 7620 274b2 4a lsr 7621 274b3 4a lsr ; /16 7622 274b4 f0 09 beq skipcreatenonvisibledlls1loop 7623 274b6 a8 tay 7624 274b7 createnonvisibledlls1loop 7625 274b7 a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 7626 274b9 20 ce f4 jsr createblankdllentry 7627 274bc 88 dey 7628 274bd d0 f8 bne createnonvisibledlls1loop 7629 274bf skipcreatenonvisibledlls1loop 7630 274bf a5 42 lda temp1 7631 274c1 29 0f and #%00001111 7632 274c3 f0 08 beq createnonvisibledllsreturn 7633 274c5 38 sec 7634 274c6 e9 01 sbc #1 7635 274c8 09 40 ora #%01000000 7636 274ca 20 ce f4 jsr createblankdllentry 7637 274cd createnonvisibledllsreturn 7638 274cd 60 rts 7639 274ce 7640 274ce createblankdllentry 7641 274ce 9d 00 18 sta DLLMEM,x 7642 274d1 - ifconst DOUBLEBUFFER 7643 274d1 - sta DLLMEM+DBOFFSET,x 7644 274d1 endif ; DOUBLEBUFFER 7645 274d1 e8 inx 7646 274d2 a9 21 lda #$21 ; blank 7647 274d4 9d 00 18 sta DLLMEM,x 7648 274d7 - ifconst DOUBLEBUFFER 7649 274d7 - sta DLLMEM+DBOFFSET,x 7650 274d7 endif ; DOUBLEBUFFER 7651 274d7 e8 inx 7652 274d8 a9 00 lda #$00 7653 274da 9d 00 18 sta DLLMEM,x 7654 274dd - ifconst DOUBLEBUFFER 7655 274dd - sta DLLMEM+DBOFFSET,x 7656 274dd endif ; DOUBLEBUFFER 7657 274dd e8 inx 7658 274de 60 rts 7659 274df 7660 274df createvisiblezones 7661 274df a0 00 ldy #0 7662 274e1 createvisiblezonesloop 7663 274e1 b9 db f5 lda.w DLHEIGHT,y 7664 274e4 09 40 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 7665 274e6 9d 00 18 sta DLLMEM,x 7666 274e9 - ifconst DOUBLEBUFFER 7667 274e9 - sta DLLMEM+DBOFFSET,x 7668 274e9 endif ; DOUBLEBUFFER 7669 274e9 e8 inx 7670 274ea b9 c3 f5 lda DLPOINTH,y 7671 274ed - ifconst BANKSET_DL_IN_CARTRAM 7672 274ed - ; with bankset cart ram, we added $8000 to the DL address so plot functions would hit the write-address 7673 274ed - ; but now we need to subtract that $8000 location to give Maria the normal address 7674 274ed - sec 7675 274ed - sbc #$80 7676 274ed endif ; BANKSET_DL_IN_CARTRAM 7677 274ed 9d 00 18 sta DLLMEM,x 7678 274f0 - ifconst DOUBLEBUFFER 7679 274f0 - sta DLLMEM+DBOFFSET,x 7680 274f0 endif ; DOUBLEBUFFER 7681 274f0 e8 inx 7682 274f1 b9 cf f5 lda DLPOINTL,y 7683 274f4 9d 00 18 sta DLLMEM,x 7684 274f7 - ifconst DOUBLEBUFFER 7685 274f7 - clc 7686 274f7 - adc #DOUBLEBUFFEROFFSET 7687 274f7 - sta DLLMEM+DBOFFSET,x 7688 274f7 - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 7689 274f7 - inc DLLMEM+DBOFFSET-1,x 7690 274f7 -skiphidoublebufferadjust 7691 274f7 endif ; DOUBLEBUFFER 7692 274f7 e8 inx 7693 274f8 c8 iny 7694 274f9 c0 0c cpy #WZONECOUNT 7695 274fb d0 e4 bne createvisiblezonesloop 7696 274fd 60 rts 7697 274fe 7698 274fe waitforvblankstart 7699 274fe vblankendwait 7700 274fe 24 28 BIT MSTAT 7701 27500 30 fc bmi vblankendwait 7702 27502 vblankstartwait 7703 27502 24 28 BIT MSTAT 7704 27504 10 fc bpl vblankstartwait 7705 27506 60 rts 7706 27507 7707 27507 - ifconst DOUBLEBUFFER 7708 27507 -flipdisplaybufferreturn 7709 27507 - rts 7710 27507 -flipdisplaybuffer 7711 27507 - ifconst interrupthold 7712 27507 - lda #$FF 7713 27507 - sta interrupthold 7714 27507 - endif 7715 27507 - lda doublebufferstate 7716 27507 - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 7717 27507 - 7718 27507 - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 7719 27507 - 7720 27507 - lda doublebufferstate 7721 27507 - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 7722 27507 - tax 7723 27507 - 7724 27507 - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 7725 27507 - 7726 27507 -flipdisplaybufferwait1 7727 27507 - lda visibleover 7728 27507 - beq flipdisplaybufferwait1 7729 27507 - 7730 27507 -flipdisplaybufferwait 7731 27507 - lda visibleover 7732 27507 - bne flipdisplaybufferwait 7733 27507 - 7734 27507 - lda doublebufferminimumframetarget 7735 27507 - beq skipminimumframecode 7736 27507 - lda doublebufferminimumframeindex 7737 27507 - bne flipdisplaybufferwait1 7738 27507 - lda doublebufferminimumframetarget 7739 27507 - sta doublebufferminimumframeindex 7740 27507 -skipminimumframecode 7741 27507 - 7742 27507 - lda DLLMEMLutHi,x 7743 27507 - sta DPPH 7744 27507 - lda DLLMEMLutLo,x 7745 27507 - sta DPPL 7746 27507 - 7747 27507 - lda NewPageflipstate,x 7748 27507 - sta doublebufferstate 7749 27507 - lda NewPageflipoffset,x 7750 27507 - sta doublebufferdloffset 7751 27507 - 7752 27507 - ifnconst BANKSET_DL_IN_CARTRAM 7753 27507 - lda doublebufferbufferdirty 7754 27507 - beq flipdisplaybufferreturn 7755 27507 - 7756 27507 - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 7757 27507 - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 7758 27507 - ; from the displayed buffer to the working buffer... 7759 27507 - 7760 27507 - lda doublebufferdloffset 7761 27507 - eor #DOUBLEBUFFEROFFSET 7762 27507 - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 7763 27507 - 7764 27507 - ldx #(WZONECOUNT-1) 7765 27507 -copybufferzoneloop 7766 27507 - 7767 27507 - lda DLPOINTL,x 7768 27507 - clc 7769 27507 - adc doublebufferdloffset 7770 27507 - sta temp1 7771 27507 - lda DLPOINTH,x 7772 27507 - adc #0 7773 27507 - sta temp2 7774 27507 - 7775 27507 - lda DLPOINTL,x 7776 27507 - clc 7777 27507 - adc temp6 7778 27507 - sta temp3 7779 27507 - lda DLPOINTH,x 7780 27507 - adc #0 7781 27507 - sta temp4 7782 27507 - 7783 27507 - lda dlendsave,x 7784 27507 - tay 7785 27507 -copybuffercharsloop 7786 27507 - lda (temp3),y 7787 27507 - sta (temp1),y 7788 27507 - dey 7789 27507 - bpl copybuffercharsloop 7790 27507 - dex 7791 27507 - bpl copybufferzoneloop 7792 27507 - lda #0 7793 27507 - sta doublebufferbufferdirty 7794 27507 - endif ; ! BANKSET_DL_IN_CARTRAM 7795 27507 - rts 7796 27507 - 7797 27507 -doublebufferoff 7798 27507 - lda #1 7799 27507 - sta doublebufferstate 7800 27507 - jsr flipdisplaybuffer 7801 27507 - lda #0 7802 27507 - sta doublebufferstate 7803 27507 - sta doublebufferdloffset 7804 27507 - rts 7805 27507 - 7806 27507 -DLLMEMLutLo 7807 27507 - .byte DLLMEM,>(DLLMEM+DBOFFSET) 7810 27507 -NewPageflipstate 7811 27507 - .byte 3,1 7812 27507 -NewPageflipoffset 7813 27507 - .byte DOUBLEBUFFEROFFSET,0 7814 27507 - 7815 27507 endif ; DOUBLEBUFFER 7816 27507 7817 27507 - ifconst MOUSESUPPORT 7818 27507 - 7819 27507 -rotationalcompare 7820 27507 - ; old = 00 01 10 11 7821 27507 - .byte $00, $01, $ff, $00 ; new=00 7822 27507 - .byte $ff, $00, $00, $01 ; new=01 7823 27507 - .byte $01, $00, $00, $ff ; new=10 7824 27507 - .byte $00, $ff, $01, $00 ; new=11 7825 27507 - 7826 27507 - ; 0000YyXx st mouse 7827 27507 - 7828 27507 - ; 0000xyXY amiga mouse 7829 27507 - 7830 27507 - ifconst MOUSEXONLY 7831 27507 -amigatoataribits ; swap bits 1 and 4... 7832 27507 - .byte %0000, %0000, %0010, %0010 7833 27507 - .byte %0000, %0000, %0010, %0010 7834 27507 - .byte %0001, %0001, %0011, %0011 7835 27507 - .byte %0001, %0001, %0011, %0011 7836 27507 - 7837 27507 - ; null change bits 7838 27507 - .byte %0000, %0001, %0010, %0011 7839 27507 - .byte %0000, %0001, %0010, %0011 7840 27507 - .byte %0000, %0001, %0010, %0011 7841 27507 - .byte %0000, %0001, %0010, %0011 7842 27507 - 7843 27507 - else ; !MOUSEXONLY 7844 27507 - 7845 27507 -amigatoataribits ; swap bits 1 and 4... 7846 27507 - .byte %0000, %1000, %0010, %1010 7847 27507 - .byte %0100, %1100, %0110, %1110 7848 27507 - .byte %0001, %1001, %0011, %1011 7849 27507 - .byte %0101, %1101, %0111, %1111 7850 27507 - ; null change bits 7851 27507 - .byte %0000, %0001, %0010, %0011 7852 27507 - .byte %0100, %0101, %0110, %0111 7853 27507 - .byte %1000, %1001, %1010, %1011 7854 27507 - .byte %1100, %1101, %1110, %1111 7855 27507 - endif ; !MOUSEXONLY 7856 27507 - 7857 27507 endif ; MOUSESUPPORT 7858 27507 7859 27507 mouse0update 7860 27507 - ifconst MOUSE0SUPPORT 7861 27507 - 7862 27507 -mousetableselect = inttemp2 7863 27507 -mousexdelta = inttemp3 7864 27507 -mouseydelta = inttemp4 7865 27507 -lastSWCHA = inttemp6 7866 27507 - 7867 27507 - ; 0000YyXx st mouse 7868 27507 - ; 0000xyXY amiga mouse 7869 27507 - 7870 27507 - lda #$ff 7871 27507 - sta lastSWCHA 7872 27507 - 7873 27507 - ldy port0control 7874 27507 - 7875 27507 - lda #%00010000 7876 27507 - cpy #9 ; AMIGA? 7877 27507 - bne skipamigabitsfix0 7878 27507 - lda #0 7879 27507 -skipamigabitsfix0 7880 27507 - sta mousetableselect 7881 27507 - ifconst DRIVINGBOOST 7882 27507 - cpy #6 ; DRIVING? 7883 27507 - bne skipdriving0setup 7884 27507 - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 7885 27507 - ; trails the actual mousex0, so we can smoothly interpolate toward 7886 27507 - ; the actual position. This actual position is stored in mousey0 7887 27507 - ; after the driver has run. 7888 27507 - ldx mousex0 7889 27507 - lda mousey0 7890 27507 - stx mousey0 7891 27507 - sta mousex0 7892 27507 -skipdriving0setup 7893 27507 - endif ; DRIVINGBOOST 7894 27507 - 7895 27507 - lda #0 7896 27507 - sta mousexdelta 7897 27507 - sta mouseydelta 7898 27507 - 7899 27507 - ifnconst MOUSETIME 7900 27507 - ifnconst MOUSEXONLY 7901 27507 - lda #180 ; minimum for x+y 7902 27507 - else 7903 27507 - lda #100 ; minimum for just x 7904 27507 - endif 7905 27507 - else 7906 27507 - lda #MOUSETIME 7907 27507 - endif 7908 27507 - jsr SETTIM64T ; INTIM is in Y 7909 27507 - 7910 27507 -mouse0updateloop 7911 27507 - lda SWCHA 7912 27507 - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 7913 27507 - cmp lastSWCHA 7914 27507 - beq mouse0loopcondition 7915 27507 - sta lastSWCHA 7916 27507 - lsr 7917 27507 - lsr 7918 27507 - lsr 7919 27507 - 7920 27507 - ora mousetableselect ; atari/amiga decoding table selection 7921 27507 - 7922 27507 - ; st mice encode on different bits/joystick-lines than amiga mice... 7923 27507 - ; 0000YyXx st mouse 7924 27507 - ; 0000xyXY amiga mouse 7925 27507 - ; ...so can shuffle the amiga bits to reuse the st driver. 7926 27507 - tay 7927 27507 - lax amigatoataribits,y 7928 27507 - 7929 27507 - ifnconst MOUSEXONLY 7930 27507 - ; first the Y... 7931 27507 - and #%00001100 7932 27507 - ora mousecodey0 7933 27507 - tay 7934 27507 - lda rotationalcompare,y 7935 27507 - clc 7936 27507 - adc mouseydelta 7937 27507 - sta mouseydelta 7938 27507 - tya 7939 27507 - lsr 7940 27507 - lsr 7941 27507 - sta mousecodey0 7942 27507 - txa 7943 27507 - ; ...then the X... 7944 27507 - and #%00000011 7945 27507 - tax 7946 27507 - endif ; !MOUSEXONLY 7947 27507 - 7948 27507 - asl 7949 27507 - asl 7950 27507 - ora mousecodex0 7951 27507 - tay 7952 27507 - lda rotationalcompare,y 7953 27507 - adc mousexdelta ; carry was clear by previous ASL 7954 27507 - sta mousexdelta 7955 27507 - stx mousecodex0 7956 27507 -mouse0loopcondition 7957 27507 - lda TIMINT 7958 27507 - bpl mouse0updateloop 7959 27507 - 7960 27507 - ; *** adapt to selected device resolution. 7961 27507 - ldx port0control 7962 27507 - 7963 27507 - ifconst PRECISIONMOUSING 7964 27507 - ldy port0resolution 7965 27507 - bne mouse0halveddone 7966 27507 - cpx #6 ; half-resolution is no good for driving wheels 7967 27507 - beq mouse0halveddone 7968 27507 - ; resolution=0 is half mouse resolution, necessary for precision 7969 27507 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7970 27507 - 7971 27507 - lda mousexdelta 7972 27507 - cmp #$80 7973 27507 - ror ; do a signed divide by 2. 7974 27507 - clc 7975 27507 - adc mousex0 7976 27507 - sta mousex0 7977 27507 - ifnconst MOUSEXONLY 7978 27507 - lda mouseydelta 7979 27507 - clc 7980 27507 - adc mousey0 7981 27507 - sta mousey0 7982 27507 - endif 7983 27507 - ; at half resolution we just exit after updating x and y 7984 27507 - jmp LLRET0 7985 27507 -mouse0halveddone 7986 27507 - endif ; PRECISIONMOUSING 7987 27507 - 7988 27507 - ifnconst MOUSEXONLY 7989 27507 - asl mouseydelta ; *2 because Y resolution is finer 7990 27507 - ldy port0resolution 7991 27507 - dey 7992 27507 - lda #0 7993 27507 -mousey0resolutionfix 7994 27507 - clc 7995 27507 - adc mouseydelta 7996 27507 - dey 7997 27507 - bpl mousey0resolutionfix 7998 27507 - clc 7999 27507 - adc mousey0 8000 27507 - sta mousey0 8001 27507 - endif ; MOUSEXONLY 8002 27507 - 8003 27507 - ldy port0resolution 8004 27507 - dey 8005 27507 - lda #0 8006 27507 -mousex0resolutionfix 8007 27507 - clc 8008 27507 - adc mousexdelta 8009 27507 - dey 8010 27507 - bpl mousex0resolutionfix 8011 27507 - ifnconst DRIVINGBOOST 8012 27507 - clc 8013 27507 - adc mousex0 8014 27507 - sta mousex0 8015 27507 - else 8016 27507 - cpx #6 8017 27507 - beq carryonmouse0boost 8018 27507 - clc 8019 27507 - adc mousex0 8020 27507 - sta mousex0 8021 27507 - jmp LLRET0 8022 27507 -carryonmouse0boost 8023 27507 - sta mousexdelta 8024 27507 - clc 8025 27507 - adc mousecodey0 8026 27507 - sta mousecodey0 8027 27507 - clc 8028 27507 - adc mousex0 8029 27507 - tay ; save the target X 8030 27507 - adc mousey0 ; average in the smoothly-trailing X 8031 27507 - ror 8032 27507 - sta mousex0 ; mousex0 now has the smoothly trailing X 8033 27507 - sty mousey0 ; and mousey0 has the the target X 8034 27507 - 8035 27507 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 8036 27507 - ; A has mousex0, the smoothly trailing X 8037 27507 - sbc mousey0 ; less the target X 8038 27507 - bpl skipabsolutedrive0 8039 27507 - eor #$ff 8040 27507 -skipabsolutedrive0 8041 27507 - cmp #64 ; just an unreasonably large change 8042 27507 - bcc skipdrivewrapfix0 8043 27507 - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 8044 27507 -skipdrivewrapfix0 8045 27507 - 8046 27507 - ; get rid of the tweening if the distance travelled was very small 8047 27507 - lda mousexdelta 8048 27507 - cmp port0resolution 8049 27507 - bcs skipbetweenfix0 8050 27507 - lda mousex0 8051 27507 - sta mousey0 8052 27507 -skipbetweenfix0 8053 27507 - 8054 27507 -drivingboostreductioncheck0 8055 27507 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 8056 27507 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 8057 27507 - ; negated again because truncation during BCD math results in 8058 27507 - ; differing magnitudes, depending if the value is +ve or -ve. 8059 27507 -driving0fix 8060 27507 - lax mousecodey0 8061 27507 - cmp #$80 8062 27507 - bcs driving0skipnegate1 8063 27507 - eor #$FF 8064 27507 - adc #1 8065 27507 - sta mousecodey0 8066 27507 -driving0skipnegate1 8067 27507 - cmp #$80 8068 27507 - ror 8069 27507 - cmp #$80 8070 27507 - ror 8071 27507 - cmp #$80 8072 27507 - ror 8073 27507 - sta inttemp1 8074 27507 - lda mousecodey0 8075 27507 - sec 8076 27507 - sbc inttemp1 8077 27507 - cpx #$80 8078 27507 - bcs driving0skipnegate2 8079 27507 - eor #$FF 8080 27507 - adc #1 8081 27507 -driving0skipnegate2 8082 27507 - sta mousecodey0 8083 27507 -drivingboostdone0 8084 27507 - endif ; DRIVINGBOOST 8085 27507 - 8086 27507 - jmp LLRET0 8087 27507 - 8088 27507 endif ; MOUSE0SUPPORT 8089 27507 8090 27507 mouse1update 8091 27507 - ifconst MOUSE1SUPPORT 8092 27507 - 8093 27507 -mousetableselect = inttemp2 8094 27507 -mousexdelta = inttemp3 8095 27507 -mouseydelta = inttemp4 8096 27507 -lastSWCHA = inttemp6 8097 27507 - 8098 27507 - ; 0000YyXx st mouse 8099 27507 - ; 0000xyXY amiga mouse 8100 27507 - 8101 27507 - lda #$ff 8102 27507 - sta lastSWCHA 8103 27507 - 8104 27507 - ldy port1control 8105 27507 - 8106 27507 - lda #%00010000 8107 27507 - cpy #9 ; AMIGA? 8108 27507 - bne skipamigabitsfix1 8109 27507 - lda #0 8110 27507 -skipamigabitsfix1 8111 27507 - sta mousetableselect 8112 27507 - ifconst DRIVINGBOOST 8113 27507 - cpy #6 ; DRIVING? 8114 27507 - bne skipdriving1setup 8115 27507 - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 8116 27507 - ; trails the actual mousex1, so we can smoothly interpolate toward 8117 27507 - ; the actual position. This actual position is stored in mousey1 8118 27507 - ; after the driver has run. 8119 27507 - ldx mousex1 8120 27507 - lda mousey1 8121 27507 - stx mousey1 8122 27507 - sta mousex1 8123 27507 -skipdriving1setup 8124 27507 - endif ; DRIVINGBOOST 8125 27507 - 8126 27507 - lda #0 8127 27507 - sta mousexdelta 8128 27507 - sta mouseydelta 8129 27507 - 8130 27507 - ifnconst MOUSETIME 8131 27507 - ifnconst MOUSEXONLY 8132 27507 - lda #180 ; minimum for x+y 8133 27507 - else 8134 27507 - lda #100 ; minimum for just x 8135 27507 - endif 8136 27507 - else 8137 27507 - lda #MOUSETIME 8138 27507 - endif 8139 27507 - jsr SETTIM64T ; INTIM is in Y 8140 27507 - 8141 27507 -mouse1updateloop 8142 27507 - lda SWCHA 8143 27507 - and #%00001111 8144 27507 - cmp lastSWCHA 8145 27507 - beq mouse1loopcondition 8146 27507 - sta lastSWCHA 8147 27507 - 8148 27507 - ora mousetableselect ; atari/amiga decoding table selection 8149 27507 - 8150 27507 - ; st mice encode on different bits/joystick-lines than amiga mice... 8151 27507 - ; 0000YyXx st mouse 8152 27507 - ; 0000xyXY amiga mouse 8153 27507 - ; ...so can shuffle the amiga bits to reuse the st driver. 8154 27507 - tay 8155 27507 - lax amigatoataribits,y 8156 27507 - 8157 27507 - ifnconst MOUSEXONLY 8158 27507 - ; first the Y... 8159 27507 - and #%00001100 8160 27507 - ora mousecodey1 8161 27507 - tay 8162 27507 - lda rotationalcompare,y 8163 27507 - clc 8164 27507 - adc mouseydelta 8165 27507 - sta mouseydelta 8166 27507 - tya 8167 27507 - lsr 8168 27507 - lsr 8169 27507 - sta mousecodey1 8170 27507 - txa 8171 27507 - ; ...then the X... 8172 27507 - and #%00000011 8173 27507 - tax 8174 27507 - endif ; !MOUSEXONLY 8175 27507 - 8176 27507 - asl 8177 27507 - asl 8178 27507 - ora mousecodex1 8179 27507 - tay 8180 27507 - lda rotationalcompare,y 8181 27507 - adc mousexdelta ; carry was clear by previous ASL 8182 27507 - sta mousexdelta 8183 27507 - stx mousecodex1 8184 27507 -mouse1loopcondition 8185 27507 - lda TIMINT 8186 27507 - bpl mouse1updateloop 8187 27507 - 8188 27507 - ; *** adapt to selected device resolution. 8189 27507 - ldx port1control 8190 27507 - 8191 27507 - ifconst PRECISIONMOUSING 8192 27507 - ldy port1resolution 8193 27507 - bne mouse1halveddone 8194 27507 - cpx #6 ; half-resolution is no good for driving wheels 8195 27507 - beq mouse1halveddone 8196 27507 - ; resolution=0 is half mouse resolution, necessary for precision 8197 27507 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 8198 27507 - 8199 27507 - lda mousexdelta 8200 27507 - cmp #$80 8201 27507 - ror ; do a signed divide by 2. 8202 27507 - clc 8203 27507 - adc mousex1 8204 27507 - sta mousex1 8205 27507 - ifnconst MOUSEXONLY 8206 27507 - lda mouseydelta 8207 27507 - clc 8208 27507 - adc mousey1 8209 27507 - sta mousey1 8210 27507 - endif 8211 27507 - ; at half resolution we just exit after updating x and y 8212 27507 - jmp LLRET1 8213 27507 -mouse1halveddone 8214 27507 - endif ; PRECISIONMOUSING 8215 27507 - 8216 27507 - ifnconst MOUSEXONLY 8217 27507 - asl mouseydelta ; *2 because Y resolution is finer 8218 27507 - ldy port1resolution 8219 27507 - dey 8220 27507 - lda #0 8221 27507 -mousey1resolutionfix 8222 27507 - clc 8223 27507 - adc mouseydelta 8224 27507 - dey 8225 27507 - bpl mousey1resolutionfix 8226 27507 - clc 8227 27507 - adc mousey1 8228 27507 - sta mousey1 8229 27507 - endif ; MOUSEXONLY 8230 27507 - 8231 27507 - ldy port1resolution 8232 27507 - dey 8233 27507 - lda #0 8234 27507 -mousex1resolutionfix 8235 27507 - clc 8236 27507 - adc mousexdelta 8237 27507 - dey 8238 27507 - bpl mousex1resolutionfix 8239 27507 - ifnconst DRIVINGBOOST 8240 27507 - clc 8241 27507 - adc mousex1 8242 27507 - sta mousex1 8243 27507 - else 8244 27507 - cpx #6 8245 27507 - beq carryonmouse1boost 8246 27507 - clc 8247 27507 - adc mousex1 8248 27507 - sta mousex1 8249 27507 - jmp LLRET1 8250 27507 -carryonmouse1boost 8251 27507 - sta mousexdelta 8252 27507 - clc 8253 27507 - adc mousecodey1 8254 27507 - sta mousecodey1 8255 27507 - clc 8256 27507 - adc mousex1 8257 27507 - tay ; save the target X 8258 27507 - adc mousey1 ; average in the smoothly-trailing X 8259 27507 - ror 8260 27507 - sta mousex1 ; mousex0 now has the smoothly trailing X 8261 27507 - sty mousey1 ; and mousey0 has the the target X 8262 27507 - 8263 27507 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 8264 27507 - ; A has mousex1, the smoothly trailing X 8265 27507 - sbc mousey1 ; less the target X 8266 27507 - bpl skipabsolutedrive1 8267 27507 - eor #$ff 8268 27507 -skipabsolutedrive1 8269 27507 - cmp #64 ; just an unreasonably large change 8270 27507 - bcc skipdrivewrapfix1 8271 27507 - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 8272 27507 -skipdrivewrapfix1 8273 27507 - 8274 27507 - ; get rid of the tweening if the distance travelled was very small 8275 27507 - lda mousexdelta 8276 27507 - cmp port1resolution 8277 27507 - bcs skipbetweenfix1 8278 27507 - lda mousex1 8279 27507 - sta mousey1 8280 27507 -skipbetweenfix1 8281 27507 - 8282 27507 -drivingboostreductioncheck1 8283 27507 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 8284 27507 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 8285 27507 - ; negated again because truncation during BCD math results in 8286 27507 - ; differing magnitudes, depending if the value is +ve or -ve. 8287 27507 -driving1fix 8288 27507 - lax mousecodey1 8289 27507 - cmp #$80 8290 27507 - bcs driving0skipnegate1 8291 27507 - eor #$FF 8292 27507 - adc #1 8293 27507 - sta mousecodey1 8294 27507 -driving0skipnegate1 8295 27507 - cmp #$80 8296 27507 - ror 8297 27507 - cmp #$80 8298 27507 - ror 8299 27507 - cmp #$80 8300 27507 - ror 8301 27507 - sta inttemp1 8302 27507 - lda mousecodey1 8303 27507 - sec 8304 27507 - sbc inttemp1 8305 27507 - cpx #$80 8306 27507 - bcs driving1skipnegate2 8307 27507 - eor #$FF 8308 27507 - adc #1 8309 27507 -driving1skipnegate2 8310 27507 - sta mousecodey1 8311 27507 -drivingboostdone1 8312 27507 - endif ; DRIVINGBOOST 8313 27507 - 8314 27507 - jmp LLRET1 8315 27507 - 8316 27507 endif ; MOUSE1SUPPORT 8317 27507 8318 27507 8319 27507 trakball0update 8320 27507 - ifconst TRAKBALL0SUPPORT 8321 27507 - ifnconst TRAKTIME 8322 27507 - ifnconst TRAKXONLY 8323 27507 - lda #180 ; minimum for x+y 8324 27507 - else ; !TRAKXONLY 8325 27507 - lda #100 ; minimum for just x 8326 27507 - endif ; !TRAKXONLY 8327 27507 - else ; !TRAKTIME 8328 27507 - lda #TRAKTIME 8329 27507 - endif ; !TRAKTIME 8330 27507 - jsr SETTIM64T ; INTIM is in Y 8331 27507 - ldx #0 8332 27507 - ifnconst TRAKXONLY 8333 27507 - ldy #0 8334 27507 - endif ; TRAKXONLY 8335 27507 -trakball0updateloop 8336 27507 - lda SWCHA 8337 27507 - and #%00110000 8338 27507 - cmp trakballcodex0 8339 27507 - sta trakballcodex0 8340 27507 - beq trakball0movementXdone 8341 27507 - and #%00010000 8342 27507 - beq trakball0negativeX 8343 27507 -trakball0positiveX 8344 27507 - ;(2 from beq) 8345 27507 - inx ; 2 8346 27507 - jmp trakball0movementXdone ; 3 8347 27507 -trakball0negativeX 8348 27507 - ;(3 from beq) 8349 27507 - dex ; 2 8350 27507 - nop ; 2 8351 27507 -trakball0movementXdone 8352 27507 - 8353 27507 - ifnconst TRAKXONLY 8354 27507 - lda SWCHA 8355 27507 - and #%11000000 8356 27507 - cmp trakballcodey0 8357 27507 - sta trakballcodey0 8358 27507 - beq trakball0movementYdone 8359 27507 - and #%01000000 8360 27507 - beq trakball0negativeY 8361 27507 -trakball0positiveY 8362 27507 - ;(2 from beq) 8363 27507 - iny ; 2 8364 27507 - jmp trakball0movementYdone ; 3 8365 27507 -trakball0negativeY 8366 27507 - ;(3 from beq) 8367 27507 - dey ; 2 8368 27507 - nop ; 2 8369 27507 -trakball0movementYdone 8370 27507 - endif ; !TRAKXONLY 8371 27507 - 8372 27507 - lda TIMINT 8373 27507 - bpl trakball0updateloop 8374 27507 - lda #0 8375 27507 - cpx #0 8376 27507 - beq trakball0skipXadjust 8377 27507 - clc 8378 27507 -trakball0Xloop 8379 27507 - adc port0resolution 8380 27507 - dex 8381 27507 - bne trakball0Xloop 8382 27507 - clc 8383 27507 - adc trakballx0 8384 27507 - sta trakballx0 8385 27507 -trakball0skipXadjust 8386 27507 - ifnconst TRAKXONLY 8387 27507 - lda #0 8388 27507 - cpy #0 8389 27507 - beq trakball0skipYadjust 8390 27507 - clc 8391 27507 -trakball0yloop 8392 27507 - adc port0resolution 8393 27507 - dey 8394 27507 - bne trakball0yloop 8395 27507 - clc 8396 27507 - adc trakbally0 8397 27507 - sta trakbally0 8398 27507 -trakball0skipYadjust 8399 27507 - endif ; !TRAKXONLY 8400 27507 - 8401 27507 - jmp LLRET0 8402 27507 endif 8403 27507 8404 27507 8405 27507 8406 27507 trakball1update 8407 27507 - ifconst TRAKBALL1SUPPORT 8408 27507 - ifnconst TRAKTIME 8409 27507 - ifnconst TRAKXONLY 8410 27507 - lda #180 ; minimum for x+y 8411 27507 - else ; !TRAKXONLY 8412 27507 - lda #100 ; minimum for just x 8413 27507 - endif ; !TRAKXONLY 8414 27507 - else ; !TRAKTIME 8415 27507 - lda #TRAKTIME 8416 27507 - endif ; !TRAKTIME 8417 27507 - jsr SETTIM64T ; INTIM is in Y 8418 27507 - ldx #0 8419 27507 - ifnconst TRAKXONLY 8420 27507 - ldy #0 8421 27507 - endif ; TRAKXONLY 8422 27507 -trakball1updateloop 8423 27507 - lda SWCHA 8424 27507 - and #%00000011 8425 27507 - cmp trakballcodex1 8426 27507 - sta trakballcodex1 8427 27507 - beq trakball1movementXdone 8428 27507 - and #%00000001 8429 27507 - beq trakball1negativeX 8430 27507 -trakball1positiveX 8431 27507 - ;(2 from beq) 8432 27507 - inx ; 2 8433 27507 - jmp trakball1movementXdone ; 3 8434 27507 -trakball1negativeX 8435 27507 - ;(3 from beq) 8436 27507 - dex ; 2 8437 27507 - nop ; 2 8438 27507 -trakball1movementXdone 8439 27507 - 8440 27507 - ifnconst TRAKXONLY 8441 27507 - lda SWCHA 8442 27507 - and #%00001100 8443 27507 - cmp trakballcodey1 8444 27507 - sta trakballcodey1 8445 27507 - beq trakball1movementYdone 8446 27507 - and #%00000100 8447 27507 - beq trakball1negativeY 8448 27507 -trakball1positiveY 8449 27507 - ;(2 from beq) 8450 27507 - iny ; 2 8451 27507 - jmp trakball1movementYdone ; 3 8452 27507 -trakball1negativeY 8453 27507 - ;(3 from beq) 8454 27507 - dey ; 2 8455 27507 - nop ; 2 8456 27507 -trakball1movementYdone 8457 27507 - endif ; !TRAKXONLY 8458 27507 - 8459 27507 - lda TIMINT 8460 27507 - bpl trakball1updateloop 8461 27507 - lda #0 8462 27507 - cpx #0 8463 27507 - beq trakball1skipXadjust 8464 27507 - clc 8465 27507 -trakball1Xloop 8466 27507 - adc port1resolution 8467 27507 - dex 8468 27507 - bne trakball1Xloop 8469 27507 - clc 8470 27507 - adc trakballx1 8471 27507 - sta trakballx1 8472 27507 -trakball1skipXadjust 8473 27507 - ifnconst TRAKXONLY 8474 27507 - lda #0 8475 27507 - cpy #0 8476 27507 - beq trakball1skipYadjust 8477 27507 - clc 8478 27507 -trakball1yloop 8479 27507 - adc port1resolution 8480 27507 - dey 8481 27507 - bne trakball1yloop 8482 27507 - clc 8483 27507 - adc trakbally1 8484 27507 - sta trakbally1 8485 27507 -trakball1skipYadjust 8486 27507 - endif ; !TRAKXONLY 8487 27507 - 8488 27507 - jmp LLRET1 8489 27507 endif 8490 27507 8491 27507 8492 27507 paddleport0update 8493 27507 - ifconst PADDLE0SUPPORT 8494 27507 - lda #6 8495 27507 - sta VBLANK ; start charging the paddle caps 8496 27507 - lda #0 ; use PADDLE timing 8497 27507 - jsr SETTIM64T ; INTIM is in Y 8498 27507 - 8499 27507 -paddleport0updateloop 8500 27507 - lda INPT0 8501 27507 - bmi skippaddle0setposition 8502 27507 - sty paddleposition0 8503 27507 -skippaddle0setposition 8504 27507 - ifconst TWOPADDLESUPPORT 8505 27507 - lda INPT1 8506 27507 - bmi skippaddle1setposition 8507 27507 - sty paddleposition1 8508 27507 -skippaddle1setposition 8509 27507 - endif 8510 27507 - ldy INTIM 8511 27507 - cpy #TIMEOFFSET 8512 27507 - bcs paddleport0updateloop 8513 27507 - 8514 27507 - lda #%10000110 8515 27507 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8516 27507 - sec 8517 27507 - lda paddleposition0 8518 27507 - sbc #TIMEOFFSET 8519 27507 - ifconst PADDLESCALEX2 8520 27507 - asl 8521 27507 - endif 8522 27507 - 8523 27507 - ifnconst PADDLESMOOTHINGOFF 8524 27507 - clc 8525 27507 - adc paddleprevious0 8526 27507 - ror 8527 27507 - sta paddleprevious0 8528 27507 - endif 8529 27507 - 8530 27507 - sta paddleposition0 8531 27507 - 8532 27507 - ifconst TWOPADDLESUPPORT 8533 27507 - sec 8534 27507 - lda paddleposition1 8535 27507 - sbc #TIMEOFFSET 8536 27507 - ifconst PADDLESCALEX2 8537 27507 - asl 8538 27507 - endif 8539 27507 - 8540 27507 - ifnconst PADDLESMOOTHINGOFF 8541 27507 - clc 8542 27507 - adc paddleprevious1 8543 27507 - ror 8544 27507 - sta paddleprevious1 8545 27507 - endif 8546 27507 - sta paddleposition1 8547 27507 - endif ; TWOPADDLESUPPORT 8548 27507 - 8549 27507 - jmp LLRET0 8550 27507 endif 8551 27507 8552 27507 paddleport1update 8553 27507 - ifconst PADDLE1SUPPORT 8554 27507 - lda #6 8555 27507 - sta VBLANK ; start charging the paddle caps 8556 27507 - 8557 27507 - lda #0 ; use PADDLE timing 8558 27507 - jsr SETTIM64T ; INTIM is in Y 8559 27507 - 8560 27507 -paddleport1updateloop 8561 27507 - lda INPT2 8562 27507 - bmi skippaddle2setposition 8563 27507 - sty paddleposition2 8564 27507 -skippaddle2setposition 8565 27507 - ifconst TWOPADDLESUPPORT 8566 27507 - lda INPT3 8567 27507 - bmi skippaddle3setposition 8568 27507 - sty paddleposition3 8569 27507 -skippaddle3setposition 8570 27507 - endif 8571 27507 - ldy INTIM 8572 27507 - cpy #TIMEOFFSET 8573 27507 - bcs paddleport1updateloop 8574 27507 - 8575 27507 - lda #%10000110 8576 27507 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8577 27507 - sec 8578 27507 - lda paddleposition2 8579 27507 - sbc #TIMEOFFSET 8580 27507 - ifconst PADDLESCALEX2 8581 27507 - asl 8582 27507 - endif 8583 27507 - 8584 27507 - ifnconst PADDLESMOOTHINGOFF 8585 27507 - clc 8586 27507 - adc paddleprevious2 8587 27507 - ror 8588 27507 - sta paddleprevious2 8589 27507 - endif 8590 27507 - 8591 27507 - sta paddleposition2 8592 27507 - 8593 27507 - ifconst TWOPADDLESUPPORT 8594 27507 - sec 8595 27507 - lda paddleposition3 8596 27507 - sbc #TIMEOFFSET 8597 27507 - ifconst PADDLESCALEX2 8598 27507 - asl 8599 27507 - endif 8600 27507 - 8601 27507 - ifnconst PADDLESMOOTHINGOFF 8602 27507 - clc 8603 27507 - adc paddleprevious3 8604 27507 - ror 8605 27507 - sta paddleprevious3 8606 27507 - endif 8607 27507 - sta paddleposition3 8608 27507 - endif ; TWOPADDLESUPPORT 8609 27507 - 8610 27507 - jmp LLRET1 8611 27507 endif 8612 27507 8613 27507 8614 27507 paddlebuttonhandler ; outside of conditional, for button-handler LUT 8615 27507 - ifconst PADDLESUPPORT 8616 27507 - ; x=0|1 for port, rather than paddle #. 8617 27507 - ; Only the first paddle button will integrate into "joy0fire" testing. If the 8618 27507 - ; game wants to support 2 paddles, up to the game to instead test the 8619 27507 - ; joystick right+left directions instead. 8620 27507 - lda SWCHA ; top of nibble is first paddle button 8621 27507 - cpx #0 ; port 0? 8622 27507 - beq skippaddleport2shift 8623 27507 - asl ; shift second port to upper nibble 8624 27507 - asl 8625 27507 - asl 8626 27507 - asl 8627 27507 -skippaddleport2shift 8628 27507 - and #%10000000 8629 27507 - eor #%10000000 ; invert 8630 27507 - sta sINPT1,x 8631 27507 - jmp buttonreadloopreturn 8632 27507 endif ; PADDLESUPPORT 8633 27507 8634 27507 mousebuttonhandler ; outside of conditional, for button-handler LUT 8635 27507 - ifconst MOUSESUPPORT 8636 27507 - ; stick the mouse buttons in the correct shadow register... 8637 27507 - txa 8638 27507 - asl 8639 27507 - tay ; y=x*2 8640 27507 - lda INPT4,x 8641 27507 - eor #%10000000 8642 27507 - lsr 8643 27507 - sta sINPT1,x 8644 27507 - 8645 27507 - lda INPT1,y 8646 27507 - and #%10000000 8647 27507 - eor #%10000000 8648 27507 - ora sINPT1,x 8649 27507 - sta sINPT1,x 8650 27507 - jmp buttonreadloopreturn 8651 27507 endif ; MOUSESUPPORT 8652 27507 8653 27507 - ifconst KEYPADSUPPORT 8654 27507 - ; ** select keypad rows 0 to 3 over 4 frames... 8655 27507 -keypadrowselect 8656 27507 - inc keypadcounter 8657 27507 - ldy #0 8658 27507 - lda port0control 8659 27507 - cmp #7 8660 27507 - bne skipport0val 8661 27507 - iny ; y=y+1 8662 27507 -skipport0val 8663 27507 - lda port1control 8664 27507 - cmp #7 8665 27507 - bne skipport1val 8666 27507 - iny 8667 27507 - iny ; y=y+2 8668 27507 -skipport1val 8669 27507 - cpy #0 8670 27507 - beq exitkeypadrowselect 8671 27507 - lda keyrowdirectionmask,y 8672 27507 - sta CTLSWA 8673 27507 - tya 8674 27507 - asl 8675 27507 - asl 8676 27507 - sta inttemp1 8677 27507 - lda keypadcounter 8678 27507 - and #3 8679 27507 - ora inttemp1 8680 27507 - tax 8681 27507 - lda keyrowselectvalue,x 8682 27507 - sta SWCHA 8683 27507 -exitkeypadrowselect 8684 27507 - rts 8685 27507 - 8686 27507 -keyrowdirectionmask 8687 27507 - .byte #%00000000 ; 0 : port0=input port1=input 8688 27507 - .byte #%11110000 ; 1 : port0=output port1=input 8689 27507 - .byte #%00001111 ; 2 : port0=input port1=output 8690 27507 - .byte #%11111111 ; 3 : port0=output port1=output 8691 27507 - 8692 27507 -keyrowselectvalue 8693 27507 - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 8694 27507 - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 8695 27507 - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 8696 27507 - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 8697 27507 endif ; KEYPADSUPPORT 8698 27507 8699 27507 - ifconst KEYPADSUPPORT 8700 27507 - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 8701 27507 -keypadcolumnread 8702 27507 - lda port0control 8703 27507 - cmp #7 8704 27507 - bne skipkeypadcolumnread0 8705 27507 - lda keypadcounter 8706 27507 - and #3 8707 27507 - asl ; x2 because keypad variables are interleaved 8708 27507 - tax 8709 27507 - lda #0 8710 27507 - sta keypadmatrix0a,x 8711 27507 - lda INPT0 8712 27507 - cmp #$80 8713 27507 - rol keypadmatrix0a,x 8714 27507 - lda INPT1 8715 27507 - cmp #$80 8716 27507 - rol keypadmatrix0a,x 8717 27507 - lda INPT4 8718 27507 - cmp #$80 8719 27507 - rol keypadmatrix0a,x 8720 27507 - lda keypadmatrix0a,x 8721 27507 - eor #%00000111 8722 27507 - sta keypadmatrix0a,x 8723 27507 -skipkeypadcolumnread0 8724 27507 - 8725 27507 - lda port1control 8726 27507 - cmp #7 8727 27507 - bne skipkeypadcolumnread1 8728 27507 - lda keypadcounter 8729 27507 - and #3 8730 27507 - asl ; x2 because keypad variables are interleaved 8731 27507 - tax 8732 27507 - lda #0 8733 27507 - sta keypadmatrix1a,x 8734 27507 - rol keypadmatrix1a,x 8735 27507 - lda INPT2 8736 27507 - cmp #$80 8737 27507 - rol keypadmatrix1a,x 8738 27507 - lda INPT3 8739 27507 - cmp #$80 8740 27507 - rol keypadmatrix1a,x 8741 27507 - lda INPT5 8742 27507 - cmp #$80 8743 27507 - rol keypadmatrix1a,x 8744 27507 - lda keypadmatrix1a,x 8745 27507 - eor #%00000111 8746 27507 - sta keypadmatrix1a,x 8747 27507 -skipkeypadcolumnread1 8748 27507 - rts 8749 27507 endif ; KEYPADSUPPORT 8750 27507 8751 27507 setportforinput 8752 27507 a5 e4 lda CTLSWAs 8753 27509 3d 12 f5 and allpinsinputlut,x 8754 2750c 85 e4 sta CTLSWAs 8755 2750e 8d 81 02 sta CTLSWA 8756 27511 60 rts 8757 27512 8758 27512 allpinsinputlut 8759 27512 0f f0 .byte.b $0F, $F0 8760 27514 8761 27514 setonebuttonmode 8762 27514 a9 06 lda #6 ; in case we're in unlocked-bios mode 8763 27516 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8764 27518 a9 14 lda #$14 8765 2751a 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8766 2751d a5 e5 lda CTLSWBs 8767 2751f 1d 28 f5 ora thisjoy2buttonbit,x 8768 27522 85 e5 sta CTLSWBs 8769 27524 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 8770 27527 60 rts 8771 27528 8772 27528 thisjoy2buttonbit 8773 27528 04 10 .byte.b $04, $10 8774 2752a 8775 2752a settwobuttonmode 8776 2752a a9 06 lda #6 ; in case we're in unlocked-bios mode 8777 2752c 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8778 2752e a9 14 lda #$14 8779 27530 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8780 27533 a5 e5 lda CTLSWBs 8781 27535 3d 3e f5 and thisjoy2buttonmask,x 8782 27538 85 e5 sta CTLSWBs 8783 2753a 8d 82 02 sta SWCHB 8784 2753d 60 rts 8785 2753e 8786 2753e thisjoy2buttonmask 8787 2753e fb ef .byte.b $fb, $ef 8788 27540 8789 27540 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8790 27540 8791 27540 START 8792 27540 start 8793 27540 8794 27540 ;******** more or less the Atari recommended startup procedure 8795 27540 8796 27540 78 sei 8797 27541 d8 cld 8798 27542 8799 27542 ifnconst NOTIALOCK 8800 27542 a9 07 lda #$07 8801 27544 - else 8802 27544 - lda #$06 8803 27544 endif 8804 27544 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 8805 27546 a9 7f lda #$7F 8806 27548 85 3c sta CTRL ;disable DMA 8807 2754a a9 00 lda #$00 8808 2754c 85 38 sta OFFSET 8809 2754e ifnconst NOTIALOCK 8810 2754e 85 01 sta INPTCTRL 8811 27550 85 20 sta BACKGRND ; black default, in case a flash cart is using something else 8812 27552 endif 8813 27552 a2 ff ldx #$FF 8814 27554 9a txs 8815 27555 8816 27555 ;************** Clear Memory 8817 27555 8818 27555 ; ** Clear 1800-27FF, pg0+pg1 memory. 8819 27555 ClearMemPages 8820 27555 a9 00 lda #0 8821 27557 a8 tay ; y=0 8822 27558 85 80 sta $80 8823 2755a a2 18 ldx #$18 8824 2755c ClearMemPagesLoop 8825 2755c 86 81 stx $81 ; needed for when we step on ZP memory 8826 2755e 91 80 sta ($80),y ;Store data 8827 27560 c8 iny ;Next byte 8828 27561 d0 f9 bne ClearMemPagesLoop 8829 27563 e8 inx 8830 27564 e0 28 cpx #$28 8831 27566 d0 f4 bne ClearMemPagesLoop 8832 27568 85 81 sta $81 8833 2756a 8834 2756a ;seed random number with hopefully-random timer value 8835 2756a a9 01 lda #1 8836 2756c 0d 84 02 ora INTIM 8837 2756f 85 40 sta rand 8838 27571 8839 27571 ; detect the console type... 8840 27571 pndetectvblankstart 8841 27571 a5 28 lda MSTAT 8842 27573 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 8843 27575 pndetectvblankover 8844 27575 a5 28 lda MSTAT 8845 27577 30 fc bmi pndetectvblankover ; then wait for it to be over 8846 27579 a0 00 ldy #$00 8847 2757b a2 00 ldx #$00 8848 2757d pndetectvblankhappening 8849 2757d a5 28 lda MSTAT 8850 2757f 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 8851 27581 85 24 sta WSYNC 8852 27583 85 24 sta WSYNC 8853 27585 e8 inx 8854 27586 d0 f5 bne pndetectvblankhappening 8855 27588 pndetectinvblank 8856 27588 e0 7d cpx #125 8857 2758a 90 02 bcc pndetecispal 8858 2758c a0 01 ldy #$01 8859 2758e pndetecispal 8860 2758e 8c 09 21 sty paldetected 8861 27591 8862 27591 20 6d f4 jsr createallgamedlls 8863 27594 8864 27594 a9 18 lda #>DLLMEM 8865 27596 85 2c sta DPPH 8866 27598 a9 00 lda # 255 9051 275c3 -DOUBLEBUFFEROFFSET = 255 9052 275c3 else 9053 275c3 00 f2 DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 9054 275c3 endif 9055 275c3 9056 275c3 ifconst EXTRADLMEMORY 9057 275c3 SECONDDLHALFSTART SET $2300 9058 275c3 endif 9059 275c3 9060 275c3 DLPOINTH 9061 275c3 DLINDEX SET 0 9062 275c3 REPEAT WZONECOUNT 9063 275c3 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275c3 ifconst EXTRADLMEMORY 9065 275c3 - if TMPMEMADDRESS > $1FFF 9066 275c3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275c3 else 9068 275c3 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275c3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275c3 -SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275c3 endif 9072 275c3 endif ; TMPMEMADDRESS > $1FFF 9073 275c3 endif ; EXTRADLMEMORY 9074 275c3 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275c3 18 .byte.b >TMPMEMADDRESS 9076 275c3 DLINDEX SET DLINDEX + 1 9062 275c3 REPEND 9063 275c3 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275c4 ifconst EXTRADLMEMORY 9065 275c4 - if TMPMEMADDRESS > $1FFF 9066 275c4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275c4 else 9068 275c4 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275c4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275c4 -SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275c4 endif 9072 275c4 endif ; TMPMEMADDRESS > $1FFF 9073 275c4 endif ; EXTRADLMEMORY 9074 275c4 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275c4 19 .byte.b >TMPMEMADDRESS 9076 275c4 DLINDEX SET DLINDEX + 1 9062 275c4 REPEND 9063 275c4 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275c5 ifconst EXTRADLMEMORY 9065 275c5 - if TMPMEMADDRESS > $1FFF 9066 275c5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275c5 else 9068 275c5 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275c5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275c5 -SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275c5 endif 9072 275c5 endif ; TMPMEMADDRESS > $1FFF 9073 275c5 endif ; EXTRADLMEMORY 9074 275c5 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275c5 1a .byte.b >TMPMEMADDRESS 9076 275c5 DLINDEX SET DLINDEX + 1 9062 275c5 REPEND 9063 275c5 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275c6 ifconst EXTRADLMEMORY 9065 275c6 - if TMPMEMADDRESS > $1FFF 9066 275c6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275c6 else 9068 275c6 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275c6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275c6 -SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275c6 endif 9072 275c6 endif ; TMPMEMADDRESS > $1FFF 9073 275c6 endif ; EXTRADLMEMORY 9074 275c6 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275c6 1b .byte.b >TMPMEMADDRESS 9076 275c6 DLINDEX SET DLINDEX + 1 9062 275c6 REPEND 9063 275c6 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275c7 ifconst EXTRADLMEMORY 9065 275c7 - if TMPMEMADDRESS > $1FFF 9066 275c7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275c7 else 9068 275c7 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275c7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275c7 -SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275c7 endif 9072 275c7 endif ; TMPMEMADDRESS > $1FFF 9073 275c7 endif ; EXTRADLMEMORY 9074 275c7 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275c7 1c .byte.b >TMPMEMADDRESS 9076 275c7 DLINDEX SET DLINDEX + 1 9062 275c7 REPEND 9063 275c7 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275c8 ifconst EXTRADLMEMORY 9065 275c8 - if TMPMEMADDRESS > $1FFF 9066 275c8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275c8 else 9068 275c8 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275c8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275c8 -SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275c8 endif 9072 275c8 endif ; TMPMEMADDRESS > $1FFF 9073 275c8 endif ; EXTRADLMEMORY 9074 275c8 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275c8 1d .byte.b >TMPMEMADDRESS 9076 275c8 DLINDEX SET DLINDEX + 1 9062 275c8 REPEND 9063 275c8 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275c9 ifconst EXTRADLMEMORY 9065 275c9 - if TMPMEMADDRESS > $1FFF 9066 275c9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275c9 else 9068 275c9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275c9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275c9 -SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275c9 endif 9072 275c9 endif ; TMPMEMADDRESS > $1FFF 9073 275c9 endif ; EXTRADLMEMORY 9074 275c9 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275c9 1e .byte.b >TMPMEMADDRESS 9076 275c9 DLINDEX SET DLINDEX + 1 9062 275c9 REPEND 9063 275c9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275ca ifconst EXTRADLMEMORY 9065 275ca - if TMPMEMADDRESS > $1FFF 9066 275ca -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275ca else 9068 275ca if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275ca TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275ca SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275ca endif 9072 275ca endif ; TMPMEMADDRESS > $1FFF 9073 275ca endif ; EXTRADLMEMORY 9074 275ca ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275ca 22 .byte.b >TMPMEMADDRESS 9076 275ca DLINDEX SET DLINDEX + 1 9062 275ca REPEND 9063 275ca TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275cb ifconst EXTRADLMEMORY 9065 275cb if TMPMEMADDRESS > $1FFF 9066 275cb TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275cb - else 9068 275cb - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275cb -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275cb -SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275cb - endif 9072 275cb endif ; TMPMEMADDRESS > $1FFF 9073 275cb endif ; EXTRADLMEMORY 9074 275cb ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275cb 23 .byte.b >TMPMEMADDRESS 9076 275cb DLINDEX SET DLINDEX + 1 9062 275cb REPEND 9063 275cb TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275cc ifconst EXTRADLMEMORY 9065 275cc if TMPMEMADDRESS > $1FFF 9066 275cc TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275cc - else 9068 275cc - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275cc -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275cc -SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275cc - endif 9072 275cc endif ; TMPMEMADDRESS > $1FFF 9073 275cc endif ; EXTRADLMEMORY 9074 275cc ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275cc 24 .byte.b >TMPMEMADDRESS 9076 275cc DLINDEX SET DLINDEX + 1 9062 275cc REPEND 9063 275cc TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275cd ifconst EXTRADLMEMORY 9065 275cd if TMPMEMADDRESS > $1FFF 9066 275cd TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275cd - else 9068 275cd - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275cd -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275cd -SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275cd - endif 9072 275cd endif ; TMPMEMADDRESS > $1FFF 9073 275cd endif ; EXTRADLMEMORY 9074 275cd ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275cd 25 .byte.b >TMPMEMADDRESS 9076 275cd DLINDEX SET DLINDEX + 1 9062 275cd REPEND 9063 275cd TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9064 275ce ifconst EXTRADLMEMORY 9065 275ce if TMPMEMADDRESS > $1FFF 9066 275ce TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9067 275ce - else 9068 275ce - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9069 275ce -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9070 275ce -SECONDDLHALFSTART SET TMPMEMADDRESS 9071 275ce - endif 9072 275ce endif ; TMPMEMADDRESS > $1FFF 9073 275ce endif ; EXTRADLMEMORY 9074 275ce ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 9075 275ce 26 .byte.b >TMPMEMADDRESS 9076 275ce DLINDEX SET DLINDEX + 1 9077 275cf REPEND 9078 275cf 9079 275cf ifconst EXTRADLMEMORY $2235 to $27ff was claimed as extra DL memory. 9080 275cf echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 9081 275cf endif 9082 275cf 9083 275cf 9084 275cf DLPOINTL 9085 275cf DLINDEX SET 0 9086 275cf REPEAT WZONECOUNT 9087 275cf TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9088 275cf ifconst EXTRADLMEMORY 9089 275cf - if TMPMEMADDRESS > $1FFF 9090 275cf -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275cf else 9092 275cf - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275cf -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275cf endif 9095 275cf endif ; TMPMEMADDRESS > $1FFF 9096 275cf endif ; EXTRADLMEMORY 9097 275cf 80 .byte.b $1FFF 9090 275d0 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275d0 else 9092 275d0 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275d0 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275d0 endif 9095 275d0 endif ; TMPMEMADDRESS > $1FFF 9096 275d0 endif ; EXTRADLMEMORY 9097 275d0 75 .byte.b $1FFF 9090 275d1 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275d1 else 9092 275d1 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275d1 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275d1 endif 9095 275d1 endif ; TMPMEMADDRESS > $1FFF 9096 275d1 endif ; EXTRADLMEMORY 9097 275d1 6a .byte.b $1FFF 9090 275d2 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275d2 else 9092 275d2 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275d2 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275d2 endif 9095 275d2 endif ; TMPMEMADDRESS > $1FFF 9096 275d2 endif ; EXTRADLMEMORY 9097 275d2 60 .byte.b $1FFF 9090 275d3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275d3 else 9092 275d3 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275d3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275d3 endif 9095 275d3 endif ; TMPMEMADDRESS > $1FFF 9096 275d3 endif ; EXTRADLMEMORY 9097 275d3 55 .byte.b $1FFF 9090 275d4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275d4 else 9092 275d4 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275d4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275d4 endif 9095 275d4 endif ; TMPMEMADDRESS > $1FFF 9096 275d4 endif ; EXTRADLMEMORY 9097 275d4 4a .byte.b $1FFF 9090 275d5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275d5 else 9092 275d5 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275d5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275d5 endif 9095 275d5 endif ; TMPMEMADDRESS > $1FFF 9096 275d5 endif ; EXTRADLMEMORY 9097 275d5 40 .byte.b $1FFF 9090 275d6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275d6 else 9092 275d6 if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275d6 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275d6 endif 9095 275d6 endif ; TMPMEMADDRESS > $1FFF 9096 275d6 endif ; EXTRADLMEMORY 9097 275d6 35 .byte.b $1FFF 9090 275d7 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275d7 - else 9092 275d7 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275d7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275d7 - endif 9095 275d7 endif ; TMPMEMADDRESS > $1FFF 9096 275d7 endif ; EXTRADLMEMORY 9097 275d7 2a .byte.b $1FFF 9090 275d8 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275d8 - else 9092 275d8 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275d8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275d8 - endif 9095 275d8 endif ; TMPMEMADDRESS > $1FFF 9096 275d8 endif ; EXTRADLMEMORY 9097 275d8 20 .byte.b $1FFF 9090 275d9 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275d9 - else 9092 275d9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275d9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275d9 - endif 9095 275d9 endif ; TMPMEMADDRESS > $1FFF 9096 275d9 endif ; EXTRADLMEMORY 9097 275d9 15 .byte.b $1FFF 9090 275da TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9091 275da - else 9092 275da - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9093 275da -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9094 275da - endif 9095 275da endif ; TMPMEMADDRESS > $1FFF 9096 275da endif ; EXTRADLMEMORY 9097 275da 0a .byte.b $1FFF 9107 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db else 9109 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 18 80 ZONE0ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9103 275db REPEND 9104 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9105 275db ifconst EXTRADLMEMORY 9106 275db - if TMPMEMADDRESS > $1FFF 9107 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db else 9109 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 19 75 ZONE1ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9103 275db REPEND 9104 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9105 275db ifconst EXTRADLMEMORY 9106 275db - if TMPMEMADDRESS > $1FFF 9107 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db else 9109 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 1a 6a ZONE2ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9103 275db REPEND 9104 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9105 275db ifconst EXTRADLMEMORY 9106 275db - if TMPMEMADDRESS > $1FFF 9107 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db else 9109 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 1b 60 ZONE3ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9103 275db REPEND 9104 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9105 275db ifconst EXTRADLMEMORY 9106 275db - if TMPMEMADDRESS > $1FFF 9107 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db else 9109 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 1c 55 ZONE4ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9103 275db REPEND 9104 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9105 275db ifconst EXTRADLMEMORY 9106 275db - if TMPMEMADDRESS > $1FFF 9107 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db else 9109 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 1d 4a ZONE5ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9103 275db REPEND 9104 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9105 275db ifconst EXTRADLMEMORY 9106 275db - if TMPMEMADDRESS > $1FFF 9107 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db else 9109 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 1e 40 ZONE6ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9103 275db REPEND 9104 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9105 275db ifconst EXTRADLMEMORY 9106 275db - if TMPMEMADDRESS > $1FFF 9107 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db else 9109 275db if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 22 35 ZONE7ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9103 275db REPEND 9104 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9105 275db ifconst EXTRADLMEMORY 9106 275db if TMPMEMADDRESS > $1FFF 9107 275db TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db - else 9109 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db - endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 23 2a ZONE8ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9103 275db REPEND 9104 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9105 275db ifconst EXTRADLMEMORY 9106 275db if TMPMEMADDRESS > $1FFF 9107 275db TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db - else 9109 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db - endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 24 20 ZONE9ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9103 275db REPEND 9104 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9105 275db ifconst EXTRADLMEMORY 9106 275db if TMPMEMADDRESS > $1FFF 9107 275db TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db - else 9109 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db - endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 25 15 ZONE10ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9103 275db REPEND 9104 275db TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 9105 275db ifconst EXTRADLMEMORY 9106 275db if TMPMEMADDRESS > $1FFF 9107 275db TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9108 275db - else 9109 275db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 9110 275db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 9111 275db - endif 9112 275db endif ; TMPMEMADDRESS > $1FFF 9113 275db endif ; EXTRADLMEMORY 9114 275db 9115 275db 26 0a ZONE11ADDRESS = TMPMEMADDRESS 9116 275db 9117 275db DLINDEX SET DLINDEX + 1 9118 275db REPEND 9119 275db 9120 275db $1880 to $23ff used as zone memory, allowing 48 display objects per zone. 9121 275db echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 9122 275db 9123 275db DLHEIGHT 9124 275db REPEAT WZONECOUNT 9125 275db 0f .byte.b (WZONEHEIGHT-1) 9124 275db REPEND 9125 275dc 0f .byte.b (WZONEHEIGHT-1) 9124 275dc REPEND 9125 275dd 0f .byte.b (WZONEHEIGHT-1) 9124 275dd REPEND 9125 275de 0f .byte.b (WZONEHEIGHT-1) 9124 275de REPEND 9125 275df 0f .byte.b (WZONEHEIGHT-1) 9124 275df REPEND 9125 275e0 0f .byte.b (WZONEHEIGHT-1) 9124 275e0 REPEND 9125 275e1 0f .byte.b (WZONEHEIGHT-1) 9124 275e1 REPEND 9125 275e2 0f .byte.b (WZONEHEIGHT-1) 9124 275e2 REPEND 9125 275e3 0f .byte.b (WZONEHEIGHT-1) 9124 275e3 REPEND 9125 275e4 0f .byte.b (WZONEHEIGHT-1) 9124 275e4 REPEND 9125 275e5 0f .byte.b (WZONEHEIGHT-1) 9124 275e5 REPEND 9125 275e6 0f .byte.b (WZONEHEIGHT-1) 9126 275e7 REPEND 9127 275e7 9128 275e7 ; Provided under the CC0 license. See the included LICENSE.txt for details. 9129 275e7 9130 275e7 ; a simple guard, than ensures the 7800basic code hasn't 9131 275e7 ; spilled into the encryption area... 2455 bytes left in the 7800basic reserved area. 9132 275e7 echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 9133 275e7 - if (*>$FF7D) 9134 275e7 - ERR ; abort the assembly 9135 275e7 endif 9136 275e7 ; Provided under the CC0 license. See the included LICENSE.txt for details. 9137 275e7 9138 275e7 - ifconst DEV 9139 275e7 - ifnconst ZONEHEIGHT 9140 275e7 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 9141 275e7 - else 9142 275e7 - if ZONEHEIGHT = 8 9143 275e7 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 9144 275e7 - else 9145 275e7 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 9146 275e7 - endif 9147 275e7 - endif 9148 275e7 endif 9149 275e7 9150 275e7 - if START_OF_ROM = . 9151 275e7 - .byte 0 9152 275e7 endif 9153 275e7 START_OF_ROM SET 0 9154 275e7 9155 275e7 ; FF7E/FF7F contains the 7800basic crc checksum word 9156 275e7 9157 275e7 ; FF80 - FFF7 contains the 7800 encryption key 9158 275e7 9159 275e7 - ifnconst bankswitchmode 9160 275e7 - ORG $FFF8 9161 275e7 else 9162 275e7 ifconst ROM128K 9163 27ff8 ORG $27FF8 9164 27ff8 RORG $FFF8 9165 27ff8 endif 9166 27ff8 - ifconst ROM144K 9167 27ff8 - ORG $27FF8 9168 27ff8 - RORG $FFF8 9169 27ff8 endif 9170 27ff8 - ifconst ROM256K 9171 27ff8 - ORG $47FF8 9172 27ff8 - RORG $FFF8 9173 27ff8 endif 9174 27ff8 - ifconst ROM272K 9175 27ff8 - ORG $47FF8 9176 27ff8 - RORG $FFF8 9177 27ff8 endif 9178 27ff8 - ifconst ROM512K 9179 27ff8 - ORG $87FF8 9180 27ff8 - RORG $FFF8 9181 27ff8 endif 9182 27ff8 - ifconst ROM528K 9183 27ff8 - ORG $87FF8 9184 27ff8 - RORG $FFF8 9185 27ff8 endif 9186 27ff8 endif 9187 27ff8 9188 27ff8 9189 27ff8 ff .byte.b $FF ; region verification. $FF=all regions 9190 27ff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 9191 27ffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 9192 27ffa 9193 27ffa ;Vectors 9194 27ffa 00 f0 .word.w NMI 9195 27ffc 40 f5 .word.w START 9196 27ffe 5f f0 .word.w IRQ 9197 28000