------- FILE c:\Users\Shane\Documents\my7800projects\platformer_demos\template\platformer_demo_v01.78b.asm LEVEL 1 PASS 3 1 10000 ???? ; MACRO.H 2 10000 ???? 3 10000 ???? ; Based on the 2600 macro.h file. 4 10000 ???? ; Macros irrelevant to the 7800 have been removed, and the sleep macro 5 10000 ???? ; has been adapted to give accurate results on the 7800. 6 10000 ???? 7 10000 ???? ; Version 1.0 2019/12/11 (based on the 2600 Version 1.05, 13/NOVEMBER/2003) 8 10000 ???? 9 10000 ???? ; Available macros... 10 10000 ???? ; SLEEP n - sleep for n cycles 11 10000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable 12 10000 ???? 13 10000 ???? ;------------------------------------------------------------------------------- 14 10000 ???? ; SLEEP duration 15 10000 ???? ; Original author: Thomas Jentzsch 16 10000 ???? ; Inserts code which takes the specified number of cycles to execute. This is 17 10000 ???? ; useful for code where precise timing is required. 18 10000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS. 19 10000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS 20 10000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards). 21 10000 ???? 22 10000 ???? MAC sleep 23 10000 ???? .CYCLES SET {1} 24 10000 ???? 25 10000 ???? IF .CYCLES < 2 26 10000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 27 10000 ???? ERR 28 10000 ???? ENDIF 29 10000 ???? 30 10000 ???? IF .CYCLES & 1 31 10000 ???? IFNCONST NO_ILLEGAL_OPCODES 32 10000 ???? nop $80 33 10000 ???? ELSE 34 10000 ???? bit $80 35 10000 ???? ENDIF 36 10000 ???? .CYCLES SET .CYCLES - 3 37 10000 ???? ENDIF 38 10000 ???? 39 10000 ???? REPEAT .CYCLES / 2 40 10000 ???? nop 41 10000 ???? REPEND 42 10000 ???? ENDM ;usage: SLEEP n (n>1) 43 10000 ???? 44 10000 ???? ;------------------------------------------------------- 45 10000 ???? ; SET_POINTER 46 10000 ???? ; Original author: Manuel Rotschkar 47 10000 ???? ; 48 10000 ???? ; Sets a 2 byte RAM pointer to an absolute address. 49 10000 ???? ; 50 10000 ???? ; Usage: SET_POINTER pointer, address 51 10000 ???? ; Example: SET_POINTER SpritePTR, SpriteData 52 10000 ???? ; 53 10000 ???? ; Note: Alters the accumulator, NZ flags 54 10000 ???? ; IN 1: 2 byte RAM location reserved for pointer 55 10000 ???? ; IN 2: absolute address 56 10000 ???? 57 10000 ???? MAC set_pointer 58 10000 ???? .POINTER SET {1} 59 10000 ???? .ADDRESS SET {2} 60 10000 ???? 61 10000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address 62 10000 ???? STA .POINTER ; Store in pointer 63 10000 ???? LDA #>.ADDRESS ; Get Hibyte of Address 64 10000 ???? STA .POINTER+1 ; Store in pointer+1 65 10000 ???? 66 10000 ???? ENDM 67 10000 ???? 68 10000 ???? ; EOF 69 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 70 10000 ???? 71 10000 ???? ; 7800MACRO.H 72 10000 ???? 73 10000 ???? ;------------------------------------------------------- 74 10000 ???? ; BOXCOLLISIONCHECK 75 10000 ???? ; author: Mike Saarna 76 10000 ???? ; 77 10000 ???? ; A general bounding box collision check. compares 2 rectangles of differing size 78 10000 ???? ; and shape for overlap. Carry is set for collision detected, clear for none. 79 10000 ???? ; 80 10000 ???? ; Usage: BOXCOLLISIONCHECK x1var,y1var,w1var,h1var,x2var,y2var,w2var,h2var 81 10000 ???? ; 82 10000 ???? 83 10000 ???? MAC boxcollisioncheck 84 10000 ???? .boxx1 SET {1} 85 10000 ???? .boxy1 SET {2} 86 10000 ???? .boxw1 SET {3} 87 10000 ???? .boxh1 SET {4} 88 10000 ???? .boxx2 SET {5} 89 10000 ???? .boxy2 SET {6} 90 10000 ???? .boxw2 SET {7} 91 10000 ???? .boxh2 SET {8} 92 10000 ???? 93 10000 ???? .DoXCollisionCheck 94 10000 ???? lda .boxx1 ;3 95 10000 ???? cmp .boxx2 ;2 96 10000 ???? bcs .X1isbiggerthanX2 ;2/3 97 10000 ???? .X2isbiggerthanX1 98 10000 ???? adc #.boxw1 ;2 99 10000 ???? cmp .boxx2 ;3 100 10000 ???? bcs .DoYCollisionCheck ;3/2 101 10000 ???? bcc .noboxcollision ;3 102 10000 ???? .X1isbiggerthanX2 103 10000 ???? clc ;2 104 10000 ???? sbc #.boxw2 ;2 105 10000 ???? cmp .boxx2 ;3 106 10000 ???? bcs .noboxcollision ;3/2 107 10000 ???? .DoYCollisionCheck 108 10000 ???? lda .boxy1 ;3 109 10000 ???? cmp .boxy2 ;3 110 10000 ???? bcs .Y1isbiggerthanY2 ;3/2 111 10000 ???? .Y2isbiggerthanY1 112 10000 ???? adc #.boxh1 ;2 113 10000 ???? cmp .boxy2 ;3 114 10000 ???? jmp .checkdone ;6 115 10000 ???? .Y1isbiggerthanY2 116 10000 ???? clc ;2 117 10000 ???? sbc #.boxh2 ;2 118 10000 ???? cmp .boxy2 ;3 119 10000 ???? bcs .noboxcollision ;3/2 120 10000 ???? .boxcollision 121 10000 ???? sec ;2 122 10000 ???? .byte $24 ; hardcoded "BIT [clc opcode]", used to skip over the following clc 123 10000 ???? .noboxcollision 124 10000 ???? clc ;2 125 10000 ???? .checkdone 126 10000 ???? 127 10000 ???? ENDM 128 10000 ???? 129 10000 ???? MAC median3 130 10000 ???? 131 10000 ???? ; A median filter (for smoothing paddle jitter) 132 10000 ???? ; this macro takes the current paddle value, compares it to historic 133 10000 ???? ; values, and replaces the current paddle value with the median. 134 10000 ???? ; 135 10000 ???? ; called as: MEDIAN3 STORAGE CURRENT 136 10000 ???? ; where STORAGE points to 3 consecutive bytes of memory. The first 2 137 10000 ???? ; must be dedicated to this MEDIAN filter. The last 1 is a temp. 138 10000 ???? ; where CURRENT is memory holding the new value you wish to compare to 139 10000 ???? ; the previous values, and update with the median value. 140 10000 ???? ; 141 10000 ???? ; returns: CURRENT (modified to contain median value) 142 10000 ???? ; 143 10000 ???? ; author: Mike Saarna (aka RevEng) 144 10000 ???? 145 10000 ???? .MedianBytes SET {1} 146 10000 ???? .NewValue SET {2} 147 10000 ???? 148 10000 ???? lda #0 149 10000 ???? ldy .NewValue 150 10000 ???? sty .MedianBytes+2 ; put the new value in the most "recent" slot 151 10000 ???? 152 10000 ???? ; build an index from relative size comparisons between our 3 values. 153 10000 ???? cpy .MedianBytes 154 10000 ???? rol 155 10000 ???? cpy .MedianBytes+1 156 10000 ???? rol 157 10000 ???? ldy .MedianBytes 158 10000 ???? cpy .MedianBytes+1 159 10000 ???? rol 160 10000 ???? tay 161 10000 ???? 162 10000 ???? ldx MedianOrderLUT,y ; convert the size-comparison index to an index to the median value 163 10000 ???? lda .MedianBytes,x 164 10000 ???? sta .NewValue ; we replace the new value memory with the median value 165 10000 ???? 166 10000 ???? ; then shift values from "newer" bytes to "older" bytes, leaving the 167 10000 ???? ; newest byte (.MedianBytes+2) empty for next time. 168 10000 ???? lda .MedianBytes+1 169 10000 ???? sta .MedianBytes 170 10000 ???? lda .MedianBytes+2 171 10000 ???? sta .MedianBytes+1 172 10000 ???? ifnconst MedianOrderLUT 173 10000 ???? jmp MedianOrderLUTend 174 10000 ???? MedianOrderLUT ; converts our "comparison index" to an index to the median value 175 10000 ???? .byte 0 ; 0 B2 < B0 < B1 176 10000 ???? .byte 1 ; 1 B2 < B1 < B0 177 10000 ???? .byte 2 ; 2 impossible 178 10000 ???? .byte 2 ; 3 B1 < B2 < B0 179 10000 ???? .byte 2 ; 4 B0 < B2 < B1 180 10000 ???? .byte 2 ; 5 impossible 181 10000 ???? .byte 1 ; 6 B0 < B1 < B2 182 10000 ???? .byte 0 ; 7 B1 < B0 < B2 183 10000 ???? MedianOrderLUTend 184 10000 ???? endif 185 10000 ???? ENDM 186 10000 ???? 187 10000 ???? MAC plotsprite 188 10000 ???? 189 10000 ???? ; A macro version of the plotsprite command. 190 10000 ???? ; This trades off rom space for speed. 191 10000 ???? ; It also doesn't check if the visible screen is displayed or not. 192 10000 ???? ; It has no training wheels. It is all rusty sharp edges. 193 10000 ???? 194 10000 ???? .GFXLabel SET {1} 195 10000 ???? .Palette SET {2} ; constant 196 10000 ???? .SpriteX SET {3} ; variable 197 10000 ???? .SpriteY SET {4} ; variable 198 10000 ???? .ByteOffset SET {5} ; variable 199 10000 ???? 200 10000 ???? lda .SpriteY 201 10000 ???? lsr 202 10000 ???? lsr 203 10000 ???? asr #%11111110 ; ensure carry is clear 204 10000 ???? if WZONEHEIGHT = 16 205 10000 ???? asr #%11111110 ; ensure carry is clear 206 10000 ???? endif 207 10000 ???? 208 10000 ???? tax 209 10000 ???? 210 10000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 211 10000 ???? sta dlpnt 212 10000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 213 10000 ???? sta dlpnt+1 214 10000 ???? 215 10000 ???? ldy dlend,x ; find the next new object position in this zone 216 10000 ???? 217 10000 ???? lda .ByteOffset 218 10000 ???? if {1}_width = 2 219 10000 ???? asl 220 10000 ???? endif 221 10000 ???? if {1}_width = 3 222 10000 ???? asl 223 10000 ???? adc .ByteOffset 224 10000 ???? endif 225 10000 ???? if {1}_width = 4 226 10000 ???? asl 227 10000 ???? asl 228 10000 ???? endif 229 10000 ???? if {1}_width = 5 230 10000 ???? asl 231 10000 ???? asl 232 10000 ???? adc .ByteOffset 233 10000 ???? endif 234 10000 ???? if {1}_width = 6 235 10000 ???? asl 236 10000 ???? adc .ByteOffset 237 10000 ???? asl 238 10000 ???? endif 239 10000 ???? if {1}_width = 7 240 10000 ???? asl 241 10000 ???? adc .ByteOffset 242 10000 ???? asl 243 10000 ???? adc .ByteOffset 244 10000 ???? endif 245 10000 ???? if {1}_width = 8 246 10000 ???? asl 247 10000 ???? asl 248 10000 ???? asl 249 10000 ???? endif 250 10000 ???? if {1}_width = 9 251 10000 ???? asl 252 10000 ???? asl 253 10000 ???? asl 254 10000 ???? adc .ByteOffset 255 10000 ???? endif 256 10000 ???? if {1}_width = 10 257 10000 ???? asl 258 10000 ???? asl 259 10000 ???? adc .ByteOffset 260 10000 ???? asl 261 10000 ???? endif 262 10000 ???? if {1}_width = 11 263 10000 ???? asl 264 10000 ???? asl 265 10000 ???? adc .ByteOffset 266 10000 ???? asl 267 10000 ???? adc .ByteOffset 268 10000 ???? endif 269 10000 ???? if {1}_width = 12 270 10000 ???? asl 271 10000 ???? adc .ByteOffset 272 10000 ???? asl 273 10000 ???? asl 274 10000 ???? endif 275 10000 ???? if {1}_width = 13 276 10000 ???? asl 277 10000 ???? adc .ByteOffset 278 10000 ???? asl 279 10000 ???? asl 280 10000 ???? adc .ByteOffset 281 10000 ???? endif 282 10000 ???? if {1}_width = 14 283 10000 ???? asl 284 10000 ???? adc .ByteOffset 285 10000 ???? asl 286 10000 ???? adc .ByteOffset 287 10000 ???? asl 288 10000 ???? endif 289 10000 ???? 290 10000 ???? adc #<.GFXLabel ; carry is clear via previous asl or asr 291 10000 ???? sta (dlpnt),y ; #1 - low byte object address 292 10000 ???? 293 10000 ???? iny 294 10000 ???? 295 10000 ???? lda #({1}_mode | %01000000) 296 10000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 297 10000 ???? 298 10000 ???? iny 299 10000 ???? 300 10000 ???? lda .SpriteY 301 10000 ???? and #(WZONEHEIGHT - 1) 302 10000 ???? cmp #1 ; clear carry if our sprite is just in this zone 303 10000 ???? ora #>.GFXLabel 304 10000 ???? sta (dlpnt),y ; #3 - hi byte object address 305 10000 ???? 306 10000 ???? iny 307 10000 ???? 308 10000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 309 10000 ???? sta (dlpnt),y ; #4 - palette|width 310 10000 ???? 311 10000 ???? iny 312 10000 ???? 313 10000 ???? lda .SpriteX 314 10000 ???? sta (dlpnt),y ; #5 - x object position 315 10000 ???? 316 10000 ???? iny 317 10000 ???? sty dlend,x 318 10000 ???? 319 10000 ???? ifconst ALWAYSTERMINATE 320 10000 ???? iny 321 10000 ???? lda #0 322 10000 ???? sta (dlpnt),y 323 10000 ???? endif 324 10000 ???? 325 10000 ???? bcc .PLOTSPRITEend 326 10000 ???? 327 10000 ???? inx ; next zone 328 10000 ???? 329 10000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 330 10000 ???? sta dlpnt 331 10000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 332 10000 ???? sta dlpnt+1 333 10000 ???? 334 10000 ???? ldy dlend,x ; find the next new object position in this zone 335 10000 ???? 336 10000 ???? lda .ByteOffset 337 10000 ???? if {1}_width = 1 338 10000 ???? clc 339 10000 ???? endif 340 10000 ???? if {1}_width = 2 341 10000 ???? asl ; carry clear 342 10000 ???? endif 343 10000 ???? if {1}_width = 3 344 10000 ???? asl ; carry clear 345 10000 ???? adc .ByteOffset 346 10000 ???? endif 347 10000 ???? if {1}_width = 4 348 10000 ???? asl ; carry clear 349 10000 ???? asl 350 10000 ???? endif 351 10000 ???? if {1}_width = 5 352 10000 ???? asl ; carry clear 353 10000 ???? asl 354 10000 ???? adc .ByteOffset 355 10000 ???? endif 356 10000 ???? if {1}_width = 6 357 10000 ???? asl ; carry clear 358 10000 ???? adc .ByteOffset 359 10000 ???? asl 360 10000 ???? endif 361 10000 ???? if {1}_width = 7 362 10000 ???? asl ; carry clear 363 10000 ???? adc .ByteOffset 364 10000 ???? asl 365 10000 ???? endif 366 10000 ???? if {1}_width = 8 367 10000 ???? asl ; carry clear 368 10000 ???? asl 369 10000 ???? asl 370 10000 ???? endif 371 10000 ???? if {1}_width = 9 372 10000 ???? asl ; carry clear 373 10000 ???? asl 374 10000 ???? asl 375 10000 ???? adc .ByteOffset 376 10000 ???? endif 377 10000 ???? if {1}_width = 10 378 10000 ???? asl ; carry clear 379 10000 ???? asl 380 10000 ???? adc .ByteOffset 381 10000 ???? asl 382 10000 ???? endif 383 10000 ???? if {1}_width = 11 384 10000 ???? asl ; carry clear 385 10000 ???? asl 386 10000 ???? adc .ByteOffset 387 10000 ???? asl 388 10000 ???? adc .ByteOffset 389 10000 ???? endif 390 10000 ???? if {1}_width = 12 391 10000 ???? asl ; carry clear 392 10000 ???? adc .ByteOffset 393 10000 ???? asl 394 10000 ???? asl 395 10000 ???? endif 396 10000 ???? if {1}_width = 13 397 10000 ???? asl ; carry clear 398 10000 ???? adc .ByteOffset 399 10000 ???? asl 400 10000 ???? asl 401 10000 ???? adc .ByteOffset 402 10000 ???? endif 403 10000 ???? if {1}_width = 14 404 10000 ???? asl ; carry clear 405 10000 ???? adc .ByteOffset 406 10000 ???? asl 407 10000 ???? adc .ByteOffset 408 10000 ???? asl 409 10000 ???? endif 410 10000 ???? 411 10000 ???? adc #<.GFXLabel 412 10000 ???? sta (dlpnt),y ; #1 - low byte object address 413 10000 ???? 414 10000 ???? iny 415 10000 ???? 416 10000 ???? lda #({1}_mode | %01000000) 417 10000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 418 10000 ???? 419 10000 ???? iny 420 10000 ???? 421 10000 ???? lda .SpriteY 422 10000 ???? and #(WZONEHEIGHT - 1) 423 10000 ???? ora #>(.GFXLabel - (WZONEHEIGHT * 256)) ; start in the dma hole 424 10000 ???? sta (dlpnt),y ; #3 - hi byte object address 425 10000 ???? 426 10000 ???? iny 427 10000 ???? 428 10000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 429 10000 ???? sta (dlpnt),y ; #4 - palette|width 430 10000 ???? 431 10000 ???? iny 432 10000 ???? 433 10000 ???? lda .SpriteX 434 10000 ???? sta (dlpnt),y ; #5 - x object position 435 10000 ???? 436 10000 ???? iny 437 10000 ???? sty dlend,x 438 10000 ???? 439 10000 ???? ifconst ALWAYSTERMINATE 440 10000 ???? iny 441 10000 ???? lda #0 442 10000 ???? sta (dlpnt),y 443 10000 ???? endif 444 10000 ???? 445 10000 ???? .PLOTSPRITEend 446 10000 ???? ENDM 447 10000 ???? 448 10000 ???? MAC sizeof 449 10000 ???? 450 10000 ???? ; echo's the size difference between the current address and the 451 10000 ???? ; a label that was passed as an argument. This is a quick way to 452 10000 ???? ; determine the size of a structure. 453 10000 ???? 454 10000 ???? .NAME SETSTR {1} 455 10000 ???? echo " The Size of",.NAME,"is:",[* - {1}]d,[* - {2}]d,"bytes." 456 10000 ???? ENDM 457 10000 ???? 458 10000 ???? ; 459 10000 ???? ; speakjet.inc 460 10000 ???? ; 461 10000 ???? ; 462 10000 ???? ; AtariVox Speech Synth Driver 463 10000 ???? ; 464 10000 ???? ; By Alex Herbert, 2004 465 10000 ???? ; 466 10000 ???? 467 10000 ???? 468 10000 ???? 469 10000 ???? 470 10000 ???? ; Constants 471 10000 ???? 472 10000 ???? 473 10000 ???? 00 01 SERIAL_OUTMASK equ $01 474 10000 ???? 00 02 SERIAL_RDYMASK equ $02 475 10000 ???? 476 10000 ???? 477 10000 ???? 478 10000 ???? ; Macros 479 10000 ???? 480 10000 ???? mac spkout 481 10000 ???? 482 10000 ???? ; check buffer-full status 483 10000 ???? lda SWCHA 484 10000 ???? and #SERIAL_RDYMASK 485 10000 ???? beq .speech_done 486 10000 ???? 487 10000 ???? ; get next speech byte 488 10000 ???? ldy #$00 489 10000 ???? lda (speech_addr),y 490 10000 ???? 491 10000 ???? ; invert data and check for end of string 492 10000 ???? eor #$ff 493 10000 ???? ;sta BACKGRND ; debug - uncomment to flash the background color with vox data 494 10000 ???? beq .speech_done 495 10000 ???? sta {1} 496 10000 ???? 497 10000 ???? ; increment speech pointer 498 10000 ???? inc speech_addr 499 10000 ???? bne .incaddr_skip 500 10000 ???? inc speech_addr+1 501 10000 ???? .incaddr_skip 502 10000 ???? 503 10000 ???? ; output byte as serial data 504 10000 ???? 505 10000 ???? sec ; start bit 506 10000 ???? .byteout_loop 507 10000 ???? ; put carry flag into bit 0 of SWACNT, perserving other bits 508 10000 ???? lda SWACNT ; 4 509 10000 ???? and #$fe ; 2 6 510 10000 ???? adc #$00 ; 2 8 511 10000 ???? sta SWACNT ; 4 12 512 10000 ???? 513 10000 ???? ; 10 bits sent? (1 start bit, 8 data bits, 1 stop bit) 514 10000 ???? cpy #$09 ; 2 14 515 10000 ???? beq .speech_done ; 2 16 516 10000 ???? iny ; 2 18 517 10000 ???? 518 10000 ???? ; the 7800 is 1.5x faster than the 2600. Waste more cycles here 519 10000 ???? ; to match the original baud rate... 520 10000 ???? ;ldx #$07 ; 2600 521 10000 ???? ldx #$0D 522 10000 ???? 523 10000 ???? .delay_loop 524 10000 ???? dex ; 525 10000 ???? bne .delay_loop ; 36 54 526 10000 ???? 527 10000 ???? ; shift next data bit into carry 528 10000 ???? lsr {1} ; 5 59 529 10000 ???? 530 10000 ???? ; and loop (branch always taken) 531 10000 ???? bpl .byteout_loop ; 3 62 cycles for loop 532 10000 ???? 533 10000 ???? .speech_done 534 10000 ???? 535 10000 ???? endm 536 10000 ???? 537 10000 ???? 538 10000 ???? mac speak 539 10000 ???? 540 10000 ???? lda #<{1} 541 10000 ???? sta speech_addr 542 10000 ???? lda #>{1} 543 10000 ???? sta speech_addr+1 544 10000 ???? 545 10000 ???? endm 546 10000 ???? 547 10000 ???? 548 10000 ???? 549 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 550 10000 ???? 551 10000 ???? processor 6502 552 10000 ???? ------- FILE 7800basic.h LEVEL 2 PASS 3 0 10000 ???? include "7800basic.h" 1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 10000 ???? 3 10000 ???? processor 6502 ------- FILE 7800.h LEVEL 3 PASS 3 0 10000 ???? include "7800.h" 1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 10000 ???? 3 10000 ???? ; 7800.h 4 10000 ???? ; Version 1.0, 2019/12/13 5 10000 ???? 6 10000 ???? ; This file defines hardware registers and memory mapping for the 7 10000 ???? ; Atari 7800. It is distributed as a companion machine-specific support package 8 10000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are 9 10000 ???? ; available at https://github.com/dasm-assembler/dasm 10 10000 ???? 11 10000 ???? 12 10000 ???? ; ******************** 7800 Hardware Adresses *************************** 13 10000 ???? ; 14 10000 ???? ; MEMORY MAP USAGE OF THE 7800 15 10000 ???? ; 16 10000 ???? ; 00 - 1F TIA REGISTERS 17 10000 ???? ; 20 - 3F MARIA REGISTERS 18 10000 ???? ; 40 - FF RAM block 0 (zero page) 19 10000 ???? ; 100 - 11F TIA (mirror of 0000-001f) 20 10000 ???? ; 120 - 13F MARIA (mirror of 0020-003f) 21 10000 ???? ; 140 - 1FF RAM block 1 (stack) 22 10000 ???? ; 200 - 21F TIA (mirror of 0000-001f) 23 10000 ???? ; 220 - 23F MARIA (mirror of 0020-003f) 24 10000 ???? ; 240 - 27F ??? 25 10000 ???? ; 280 - 2FF RIOT I/O ports and timers 26 10000 ???? ; 300 - 31F TIA (mirror of 0000-001f) 27 10000 ???? ; 320 - 33F MARIA (mirror of 0020-003f) 28 10000 ???? ; 340 - 3FF ??? 29 10000 ???? ; 400 - 47F unused address space 30 10000 ???? ; 480 - 4FF RIOT RAM 31 10000 ???? ; 500 - 57F unused address space 32 10000 ???? ; 580 - 5FF RIOT RAM (mirror of 0480-04ff) 33 10000 ???? ; 600 - 17FF unused address space 34 10000 ???? ; 1800 - 203F RAM 35 10000 ???? ; 2040 - 20FF RAM block 0 (mirror of 0000-001f) 36 10000 ???? ; 2100 - 213F RAM 37 10000 ???? ; 2140 - 21FF RAM block 1 (mirror of 0140-01ff) 38 10000 ???? ; 2200 - 27FF RAM 39 10000 ???? ; 2800 - 2FFF mirror of 1800-27ff 40 10000 ???? ; 3000 - 3FFF unused address space 41 10000 ???? ; 4000 - FF7F potential cartridge address space 42 10000 ???? ; FF80 - FFF9 RESERVED FOR ENCRYPTION 43 10000 ???? ; FFFA - FFFF 6502 VECTORS 44 10000 ???? 45 10000 ???? 46 10000 ???? ;****** 00-1F ********* TIA REGISTERS ****************** 47 10000 ???? 48 10000 ???? 00 01 INPTCTRL = $01 ;Input control. In same address space as TIA. write-only 49 10000 ???? 00 01 VBLANK = $01 ;VBLANK. D7=1:dump paddle caps to ground. write-only 50 10000 ???? 00 08 INPT0 = $08 ;Paddle Control Input 0 read-only 51 10000 ???? 00 09 INPT1 = $09 ;Paddle Control Input 1 read-only 52 10000 ???? 00 0a INPT2 = $0A ;Paddle Control Input 2 read-only 53 10000 ???? 00 0b INPT3 = $0B ;Paddle Control Input 3 read-only 54 10000 ???? 55 10000 ???? ; ** some common alternate names for INPT0/1/2/3 56 10000 ???? 00 08 INPT4B = $08 ;Joystick 0 Fire 1 read-only 57 10000 ???? 00 09 INPT4A = $09 ;Joystick 0 Fire 1 read-only 58 10000 ???? 00 0a INPT5B = $0A ;Joystick 1 Fire 0 read-only 59 10000 ???? 00 0b INPT5A = $0B ;Joystick 1 Fire 1 read-only 60 10000 ???? 00 08 INPT4R = $08 ;Joystick 0 Fire 1 read-only 61 10000 ???? 00 09 INPT4L = $09 ;Joystick 0 Fire 1 read-only 62 10000 ???? 00 0a INPT5R = $0A ;Joystick 1 Fire 0 read-only 63 10000 ???? 00 0b INPT5L = $0B ;Joystick 1 Fire 1 read-only 64 10000 ???? 65 10000 ???? 00 0c INPT4 = $0C ;Player 0 Fire Button Input read-only 66 10000 ???? 00 0d INPT5 = $0D ;Player 1 Fire Button Input read-only 67 10000 ???? 68 10000 ???? 00 15 AUDC0 = $15 ;Audio Control Channel 0 write-only 69 10000 ???? 00 16 AUDC1 = $16 ;Audio Control Channel 1 write-only 70 10000 ???? 00 17 AUDF0 = $17 ;Audio Frequency Channel 0 write-only 71 10000 ???? 00 18 AUDF1 = $18 ;Audio Frequency Channel 1 write-only 72 10000 ???? 00 19 AUDV0 = $19 ;Audio Volume Channel 0 write-only 73 10000 ???? 00 1a AUDV1 = $1A ;Audio Volume Channel 1 write-only 74 10000 ???? 75 10000 ???? ;****** 20-3F ********* MARIA REGISTERS *************** 76 10000 ???? 77 10000 ???? 00 20 BACKGRND = $20 ;Background Color write-only 78 10000 ???? 00 21 P0C1 = $21 ;Palette 0 - Color 1 write-only 79 10000 ???? 00 22 P0C2 = $22 ;Palette 0 - Color 2 write-only 80 10000 ???? 00 23 P0C3 = $23 ;Palette 0 - Color 3 write-only 81 10000 ???? 00 24 WSYNC = $24 ;Wait For Sync write-only 82 10000 ???? 00 25 P1C1 = $25 ;Palette 1 - Color 1 write-only 83 10000 ???? 00 26 P1C2 = $26 ;Palette 1 - Color 2 write-only 84 10000 ???? 00 27 P1C3 = $27 ;Palette 1 - Color 3 write-only 85 10000 ???? 00 28 MSTAT = $28 ;Maria Status read-only 86 10000 ???? 00 29 P2C1 = $29 ;Palette 2 - Color 1 write-only 87 10000 ???? 00 2a P2C2 = $2A ;Palette 2 - Color 2 write-only 88 10000 ???? 00 2b P2C3 = $2B ;Palette 2 - Color 3 write-only 89 10000 ???? 00 2c DPPH = $2C ;Display List List Pointer High write-only 90 10000 ???? 00 2d P3C1 = $2D ;Palette 3 - Color 1 write-only 91 10000 ???? 00 2e P3C2 = $2E ;Palette 3 - Color 2 write-only 92 10000 ???? 00 2f P3C3 = $2F ;Palette 3 - Color 3 write-only 93 10000 ???? 00 30 DPPL = $30 ;Display List List Pointer Low write-only 94 10000 ???? 00 31 P4C1 = $31 ;Palette 4 - Color 1 write-only 95 10000 ???? 00 32 P4C2 = $32 ;Palette 4 - Color 2 write-only 96 10000 ???? 00 33 P4C3 = $33 ;Palette 4 - Color 3 write-only 97 10000 ???? 00 34 CHARBASE = $34 ;Character Base Address write-only 98 10000 ???? 00 34 CHBASE = $34 ;Character Base Address write-only 99 10000 ???? 00 35 P5C1 = $35 ;Palette 5 - Color 1 write-only 100 10000 ???? 00 36 P5C2 = $36 ;Palette 5 - Color 2 write-only 101 10000 ???? 00 37 P5C3 = $37 ;Palette 5 - Color 3 write-only 102 10000 ???? 00 38 OFFSET = $38 ;Unused - Store zero here write-only 103 10000 ???? 00 39 P6C1 = $39 ;Palette 6 - Color 1 write-only 104 10000 ???? 00 3a P6C2 = $3A ;Palette 6 - Color 2 write-only 105 10000 ???? 00 3b P6C3 = $3B ;Palette 6 - Color 3 write-only 106 10000 ???? 00 3c CTRL = $3C ;Maria Control Register write-only 107 10000 ???? 00 3d P7C1 = $3D ;Palette 7 - Color 1 write-only 108 10000 ???? 00 3e P7C2 = $3E ;Palette 7 - Color 2 write-only 109 10000 ???? 00 3f P7C3 = $3F ;Palette 7 - Color 3 write-only 110 10000 ???? 111 10000 ???? 112 10000 ???? ;****** 280-2FF ******* PIA PORTS AND TIMERS ************ 113 10000 ???? 114 10000 ???? 02 80 SWCHA = $280 ;P0+P1 Joystick Directional Input read-write 115 10000 ???? 02 81 CTLSWA = $281 ;I/O Control for SCHWA read-write 116 10000 ???? 02 81 SWACNT = $281 ;VCS name for above read-write 117 10000 ???? 02 82 SWCHB = $282 ;Console Switches read-write 118 10000 ???? 02 83 CTLSWB = $283 ;I/O Control for SCHWB read-write 119 10000 ???? 02 83 SWBCNT = $283 ;VCS name for above read-write 120 10000 ???? 121 10000 ???? 02 84 INTIM = $284 ;Interval Timer Read read-only 122 10000 ???? 02 94 TIM1T = $294 ;Set 1 CLK Interval (838 nsec/interval) write-only 123 10000 ???? 02 95 TIMINT = $295 ;Interval Timer Interrupt read-only 124 10000 ???? 02 95 TIM8T = $295 ;Set 8 CLK Interval (6.7 usec/interval) write-only 125 10000 ???? 02 96 TIM64T = $296 ;Set 64 CLK Interval (63.6 usec/interval) write-only 126 10000 ???? 02 97 T1024T = $297 ;Set 1024 CLK Interval (858.2 usec/interval) write-only 127 10000 ???? 02 9e TIM64TI = $29E ;Interrupt timer 64T write-only 128 10000 ???? 129 10000 ???? ;XM 130 10000 ???? 04 70 XCTRL = $470 ; 7=YM2151 6=RAM@6k 5=RAM@4k 4=pokey@450 3=hsc 2=cart 1=RoF_bank1 0=RoF_bank2 131 10000 ???? 04 70 XCTRL1 = $470 132 10000 ???? 04 78 XCTRL2 = $478 133 10000 ???? 04 7c XCTRL3 = $47c 134 10000 ???? 04 71 XCTRL4 = $471 135 10000 ???? 04 72 XCTRL5 = $472 136 10000 ???? 137 10000 ???? ; Pokey register relative locations, since its base may be different 138 10000 ???? ; depending on the hardware. 139 10000 ???? 00 00 PAUDF0 = $0 ; extra audio channels and frequencies 140 10000 ???? 00 01 PAUDC0 = $1 141 10000 ???? 00 02 PAUDF1 = $2 142 10000 ???? 00 03 PAUDC1 = $3 143 10000 ???? 00 04 PAUDF2 = $4 144 10000 ???? 00 05 PAUDC2 = $5 145 10000 ???? 00 06 PAUDF3 = $6 146 10000 ???? 00 07 PAUDC3 = $7 147 10000 ???? 00 08 PAUDCTL = $8 ; Audio Control 148 10000 ???? 00 09 PSTIMER = $9 149 10000 ???? 00 0a PRANDOM = $A ; 17 bit polycounter pseudo random 150 10000 ???? 00 0f PSKCTL = $F ; Serial Port control ------- FILE 7800basic.h ------- FILE 7800basic_variable_redefs.h LEVEL 3 PASS 3 0 10000 ???? include "7800basic_variable_redefs.h" 1 10000 ???? ; This file contains variable mapping and other information for the current project. 2 10000 ???? 3 10000 ???? 00 00 platformer_test_fontCS_mode = $00 4 10000 ???? 00 06 platformer_test_fontCS_width_twoscompliment = $06 5 10000 ???? 00 3a platformer_test_fontCS_width = $3a 6 10000 ???? 00 80 platformer_test_sprite8_tallsprite_00_mode = $80 7 10000 ???? 00 1c platformer_test_sprite8_tallsprite_00_width_twoscompliment = $1c 8 10000 ???? 00 04 platformer_test_sprite8_tallsprite_00_width = $04 9 10000 ???? 00 80 platformer_test_sprite8_mode = $80 10 10000 ???? 00 1c platformer_test_sprite8_width_twoscompliment = $1c 11 10000 ???? 00 04 platformer_test_sprite8_width = $04 12 10000 ???? 00 80 platformer_test_sprite7_tallsprite_00_mode = $80 13 10000 ???? 00 1c platformer_test_sprite7_tallsprite_00_width_twoscompliment = $1c 14 10000 ???? 00 04 platformer_test_sprite7_tallsprite_00_width = $04 15 10000 ???? 00 80 platformer_test_sprite7_mode = $80 16 10000 ???? 00 1c platformer_test_sprite7_width_twoscompliment = $1c 17 10000 ???? 00 04 platformer_test_sprite7_width = $04 18 10000 ???? 00 80 platformer_test_sprite6_tallsprite_00_mode = $80 19 10000 ???? 00 1c platformer_test_sprite6_tallsprite_00_width_twoscompliment = $1c 20 10000 ???? 00 04 platformer_test_sprite6_tallsprite_00_width = $04 21 10000 ???? 00 80 platformer_test_sprite6_mode = $80 22 10000 ???? 00 1c platformer_test_sprite6_width_twoscompliment = $1c 23 10000 ???? 00 04 platformer_test_sprite6_width = $04 24 10000 ???? 00 80 platformer_test_sprite5_tallsprite_00_mode = $80 25 10000 ???? 00 1c platformer_test_sprite5_tallsprite_00_width_twoscompliment = $1c 26 10000 ???? 00 04 platformer_test_sprite5_tallsprite_00_width = $04 27 10000 ???? 00 80 platformer_test_sprite5_mode = $80 28 10000 ???? 00 1c platformer_test_sprite5_width_twoscompliment = $1c 29 10000 ???? 00 04 platformer_test_sprite5_width = $04 30 10000 ???? 00 80 platformer_test_sprite4_tallsprite_00_mode = $80 31 10000 ???? 00 1c platformer_test_sprite4_tallsprite_00_width_twoscompliment = $1c 32 10000 ???? 00 04 platformer_test_sprite4_tallsprite_00_width = $04 33 10000 ???? 00 80 platformer_test_sprite4_mode = $80 34 10000 ???? 00 1c platformer_test_sprite4_width_twoscompliment = $1c 35 10000 ???? 00 04 platformer_test_sprite4_width = $04 36 10000 ???? 00 80 platformer_test_sprite3_tallsprite_00_mode = $80 37 10000 ???? 00 1c platformer_test_sprite3_tallsprite_00_width_twoscompliment = $1c 38 10000 ???? 00 04 platformer_test_sprite3_tallsprite_00_width = $04 39 10000 ???? 00 80 platformer_test_sprite3_mode = $80 40 10000 ???? 00 1c platformer_test_sprite3_width_twoscompliment = $1c 41 10000 ???? 00 04 platformer_test_sprite3_width = $04 42 10000 ???? 00 80 platformer_test_sprite2_tallsprite_00_mode = $80 43 10000 ???? 00 1c platformer_test_sprite2_tallsprite_00_width_twoscompliment = $1c 44 10000 ???? 00 04 platformer_test_sprite2_tallsprite_00_width = $04 45 10000 ???? 00 80 platformer_test_sprite2_mode = $80 46 10000 ???? 00 1c platformer_test_sprite2_width_twoscompliment = $1c 47 10000 ???? 00 04 platformer_test_sprite2_width = $04 48 10000 ???? 00 80 platformer_test_sprite1_tallsprite_00_mode = $80 49 10000 ???? 00 1c platformer_test_sprite1_tallsprite_00_width_twoscompliment = $1c 50 10000 ???? 00 04 platformer_test_sprite1_tallsprite_00_width = $04 51 10000 ???? 00 80 platformer_test_sprite1_mode = $80 52 10000 ???? 00 1c platformer_test_sprite1_width_twoscompliment = $1c 53 10000 ???? 00 04 platformer_test_sprite1_width = $04 54 10000 ???? 00 80 platformer_test_sprite0_tallsprite_00_mode = $80 55 10000 ???? 00 1c platformer_test_sprite0_tallsprite_00_width_twoscompliment = $1c 56 10000 ???? 00 04 platformer_test_sprite0_tallsprite_00_width = $04 57 10000 ???? 00 80 platformer_test_sprite0_mode = $80 58 10000 ???? 00 1c platformer_test_sprite0_width_twoscompliment = $1c 59 10000 ???? 00 04 platformer_test_sprite0_width = $04 60 10000 ???? 00 00 platformer_test_tiles_ramchar_tallsprite_00_mode = $00 61 10000 ???? 00 0c platformer_test_tiles_ramchar_tallsprite_00_width_twoscompliment = $0c 62 10000 ???? 00 14 platformer_test_tiles_ramchar_tallsprite_00_width = $14 63 10000 ???? 00 00 platformer_test_tiles_ramchar_mode = $00 64 10000 ???? 00 0c platformer_test_tiles_ramchar_width_twoscompliment = $0c 65 10000 ???? 00 14 platformer_test_tiles_ramchar_width = $14 66 10000 ???? 01 e0 level4_length = .skipL0110-level4 67 10000 ???? 68 10000 ???? 01 e0 level3_length = .skipL0109-level3 69 10000 ???? 70 10000 ???? 01 e0 level2_length = .skipL0108-level2 71 10000 ???? 72 10000 ???? 01 e0 level1_length = .skipL0107-level1 73 10000 ???? 74 10000 ???? 00 0f platformer_test_fontCS_color1 = $0f 75 10000 ???? 00 00 platformer_test_fontCS_color0 = $00 76 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color15 = 0 77 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color14 = 0 78 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color13 = 0 79 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color12 = 0 80 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color11 = 0 81 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color10 = 0 82 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color9 = 0 83 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color8 = 0 84 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color7 = 0 85 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color6 = $00 86 10000 ???? 00 68 platformer_test_sprite8_tallsprite_00_color5 = $68 87 10000 ???? 00 6c platformer_test_sprite8_tallsprite_00_color4 = $6c 88 10000 ???? 00 08 platformer_test_sprite8_tallsprite_00_color3 = $08 89 10000 ???? 00 0f platformer_test_sprite8_tallsprite_00_color2 = $0f 90 10000 ???? 00 04 platformer_test_sprite8_tallsprite_00_color1 = $04 91 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color0 = $00 92 10000 ???? 00 00 platformer_test_sprite8_color15 = 0 93 10000 ???? 00 00 platformer_test_sprite8_color14 = 0 94 10000 ???? 00 00 platformer_test_sprite8_color13 = 0 95 10000 ???? 00 00 platformer_test_sprite8_color12 = 0 96 10000 ???? 00 00 platformer_test_sprite8_color11 = 0 97 10000 ???? 00 00 platformer_test_sprite8_color10 = 0 98 10000 ???? 00 00 platformer_test_sprite8_color9 = 0 99 10000 ???? 00 00 platformer_test_sprite8_color8 = 0 100 10000 ???? 00 00 platformer_test_sprite8_color7 = 0 101 10000 ???? 00 00 platformer_test_sprite8_color6 = $00 102 10000 ???? 00 68 platformer_test_sprite8_color5 = $68 103 10000 ???? 00 6c platformer_test_sprite8_color4 = $6c 104 10000 ???? 00 08 platformer_test_sprite8_color3 = $08 105 10000 ???? 00 0f platformer_test_sprite8_color2 = $0f 106 10000 ???? 00 04 platformer_test_sprite8_color1 = $04 107 10000 ???? 00 00 platformer_test_sprite8_color0 = $00 108 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color15 = 0 109 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color14 = 0 110 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color13 = 0 111 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color12 = 0 112 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color11 = 0 113 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color10 = 0 114 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color9 = 0 115 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color8 = 0 116 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color7 = 0 117 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color6 = $00 118 10000 ???? 00 68 platformer_test_sprite7_tallsprite_00_color5 = $68 119 10000 ???? 00 0f platformer_test_sprite7_tallsprite_00_color4 = $0f 120 10000 ???? 00 6c platformer_test_sprite7_tallsprite_00_color3 = $6c 121 10000 ???? 00 08 platformer_test_sprite7_tallsprite_00_color2 = $08 122 10000 ???? 00 04 platformer_test_sprite7_tallsprite_00_color1 = $04 123 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color0 = $00 124 10000 ???? 00 00 platformer_test_sprite7_color15 = 0 125 10000 ???? 00 00 platformer_test_sprite7_color14 = 0 126 10000 ???? 00 00 platformer_test_sprite7_color13 = 0 127 10000 ???? 00 00 platformer_test_sprite7_color12 = 0 128 10000 ???? 00 00 platformer_test_sprite7_color11 = 0 129 10000 ???? 00 00 platformer_test_sprite7_color10 = 0 130 10000 ???? 00 00 platformer_test_sprite7_color9 = 0 131 10000 ???? 00 00 platformer_test_sprite7_color8 = 0 132 10000 ???? 00 00 platformer_test_sprite7_color7 = 0 133 10000 ???? 00 00 platformer_test_sprite7_color6 = $00 134 10000 ???? 00 68 platformer_test_sprite7_color5 = $68 135 10000 ???? 00 0f platformer_test_sprite7_color4 = $0f 136 10000 ???? 00 6c platformer_test_sprite7_color3 = $6c 137 10000 ???? 00 08 platformer_test_sprite7_color2 = $08 138 10000 ???? 00 04 platformer_test_sprite7_color1 = $04 139 10000 ???? 00 00 platformer_test_sprite7_color0 = $00 140 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color15 = 0 141 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color14 = 0 142 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color13 = 0 143 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color12 = 0 144 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color11 = 0 145 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color10 = 0 146 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color9 = 0 147 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color8 = 0 148 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color7 = 0 149 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color6 = $00 150 10000 ???? 00 68 platformer_test_sprite6_tallsprite_00_color5 = $68 151 10000 ???? 00 6c platformer_test_sprite6_tallsprite_00_color4 = $6c 152 10000 ???? 00 04 platformer_test_sprite6_tallsprite_00_color3 = $04 153 10000 ???? 00 0f platformer_test_sprite6_tallsprite_00_color2 = $0f 154 10000 ???? 00 08 platformer_test_sprite6_tallsprite_00_color1 = $08 155 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color0 = $00 156 10000 ???? 00 00 platformer_test_sprite6_color15 = 0 157 10000 ???? 00 00 platformer_test_sprite6_color14 = 0 158 10000 ???? 00 00 platformer_test_sprite6_color13 = 0 159 10000 ???? 00 00 platformer_test_sprite6_color12 = 0 160 10000 ???? 00 00 platformer_test_sprite6_color11 = 0 161 10000 ???? 00 00 platformer_test_sprite6_color10 = 0 162 10000 ???? 00 00 platformer_test_sprite6_color9 = 0 163 10000 ???? 00 00 platformer_test_sprite6_color8 = 0 164 10000 ???? 00 00 platformer_test_sprite6_color7 = 0 165 10000 ???? 00 00 platformer_test_sprite6_color6 = $00 166 10000 ???? 00 68 platformer_test_sprite6_color5 = $68 167 10000 ???? 00 6c platformer_test_sprite6_color4 = $6c 168 10000 ???? 00 04 platformer_test_sprite6_color3 = $04 169 10000 ???? 00 0f platformer_test_sprite6_color2 = $0f 170 10000 ???? 00 08 platformer_test_sprite6_color1 = $08 171 10000 ???? 00 00 platformer_test_sprite6_color0 = $00 172 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color15 = 0 173 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color14 = 0 174 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color13 = 0 175 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color12 = 0 176 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color11 = 0 177 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color10 = 0 178 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color9 = 0 179 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color8 = 0 180 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color7 = 0 181 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color6 = $00 182 10000 ???? 00 68 platformer_test_sprite5_tallsprite_00_color5 = $68 183 10000 ???? 00 6c platformer_test_sprite5_tallsprite_00_color4 = $6c 184 10000 ???? 00 0f platformer_test_sprite5_tallsprite_00_color3 = $0f 185 10000 ???? 00 08 platformer_test_sprite5_tallsprite_00_color2 = $08 186 10000 ???? 00 04 platformer_test_sprite5_tallsprite_00_color1 = $04 187 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color0 = $00 188 10000 ???? 00 00 platformer_test_sprite5_color15 = 0 189 10000 ???? 00 00 platformer_test_sprite5_color14 = 0 190 10000 ???? 00 00 platformer_test_sprite5_color13 = 0 191 10000 ???? 00 00 platformer_test_sprite5_color12 = 0 192 10000 ???? 00 00 platformer_test_sprite5_color11 = 0 193 10000 ???? 00 00 platformer_test_sprite5_color10 = 0 194 10000 ???? 00 00 platformer_test_sprite5_color9 = 0 195 10000 ???? 00 00 platformer_test_sprite5_color8 = 0 196 10000 ???? 00 00 platformer_test_sprite5_color7 = 0 197 10000 ???? 00 00 platformer_test_sprite5_color6 = $00 198 10000 ???? 00 68 platformer_test_sprite5_color5 = $68 199 10000 ???? 00 6c platformer_test_sprite5_color4 = $6c 200 10000 ???? 00 0f platformer_test_sprite5_color3 = $0f 201 10000 ???? 00 08 platformer_test_sprite5_color2 = $08 202 10000 ???? 00 04 platformer_test_sprite5_color1 = $04 203 10000 ???? 00 00 platformer_test_sprite5_color0 = $00 204 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color15 = 0 205 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color14 = 0 206 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color13 = 0 207 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color12 = 0 208 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color11 = 0 209 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color10 = 0 210 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color9 = 0 211 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color8 = 0 212 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color7 = 0 213 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color6 = $00 214 10000 ???? 00 68 platformer_test_sprite4_tallsprite_00_color5 = $68 215 10000 ???? 00 08 platformer_test_sprite4_tallsprite_00_color4 = $08 216 10000 ???? 00 0f platformer_test_sprite4_tallsprite_00_color3 = $0f 217 10000 ???? 00 6c platformer_test_sprite4_tallsprite_00_color2 = $6c 218 10000 ???? 00 04 platformer_test_sprite4_tallsprite_00_color1 = $04 219 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color0 = $00 220 10000 ???? 00 00 platformer_test_sprite4_color15 = 0 221 10000 ???? 00 00 platformer_test_sprite4_color14 = 0 222 10000 ???? 00 00 platformer_test_sprite4_color13 = 0 223 10000 ???? 00 00 platformer_test_sprite4_color12 = 0 224 10000 ???? 00 00 platformer_test_sprite4_color11 = 0 225 10000 ???? 00 00 platformer_test_sprite4_color10 = 0 226 10000 ???? 00 00 platformer_test_sprite4_color9 = 0 227 10000 ???? 00 00 platformer_test_sprite4_color8 = 0 228 10000 ???? 00 00 platformer_test_sprite4_color7 = 0 229 10000 ???? 00 00 platformer_test_sprite4_color6 = $00 230 10000 ???? 00 68 platformer_test_sprite4_color5 = $68 231 10000 ???? 00 08 platformer_test_sprite4_color4 = $08 232 10000 ???? 00 0f platformer_test_sprite4_color3 = $0f 233 10000 ???? 00 6c platformer_test_sprite4_color2 = $6c 234 10000 ???? 00 04 platformer_test_sprite4_color1 = $04 235 10000 ???? 00 00 platformer_test_sprite4_color0 = $00 236 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color15 = 0 237 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color14 = 0 238 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color13 = 0 239 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color12 = 0 240 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color11 = 0 241 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color10 = 0 242 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color9 = 0 243 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color8 = 0 244 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color7 = 0 245 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color6 = $00 246 10000 ???? 00 68 platformer_test_sprite3_tallsprite_00_color5 = $68 247 10000 ???? 00 0f platformer_test_sprite3_tallsprite_00_color4 = $0f 248 10000 ???? 00 6c platformer_test_sprite3_tallsprite_00_color3 = $6c 249 10000 ???? 00 08 platformer_test_sprite3_tallsprite_00_color2 = $08 250 10000 ???? 00 04 platformer_test_sprite3_tallsprite_00_color1 = $04 251 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color0 = $00 252 10000 ???? 00 00 platformer_test_sprite3_color15 = 0 253 10000 ???? 00 00 platformer_test_sprite3_color14 = 0 254 10000 ???? 00 00 platformer_test_sprite3_color13 = 0 255 10000 ???? 00 00 platformer_test_sprite3_color12 = 0 256 10000 ???? 00 00 platformer_test_sprite3_color11 = 0 257 10000 ???? 00 00 platformer_test_sprite3_color10 = 0 258 10000 ???? 00 00 platformer_test_sprite3_color9 = 0 259 10000 ???? 00 00 platformer_test_sprite3_color8 = 0 260 10000 ???? 00 00 platformer_test_sprite3_color7 = 0 261 10000 ???? 00 00 platformer_test_sprite3_color6 = $00 262 10000 ???? 00 68 platformer_test_sprite3_color5 = $68 263 10000 ???? 00 0f platformer_test_sprite3_color4 = $0f 264 10000 ???? 00 6c platformer_test_sprite3_color3 = $6c 265 10000 ???? 00 08 platformer_test_sprite3_color2 = $08 266 10000 ???? 00 04 platformer_test_sprite3_color1 = $04 267 10000 ???? 00 00 platformer_test_sprite3_color0 = $00 268 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color15 = 0 269 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color14 = 0 270 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color13 = 0 271 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color12 = 0 272 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color11 = 0 273 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color10 = 0 274 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color9 = 0 275 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color8 = 0 276 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color7 = 0 277 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color6 = $00 278 10000 ???? 00 68 platformer_test_sprite2_tallsprite_00_color5 = $68 279 10000 ???? 00 6c platformer_test_sprite2_tallsprite_00_color4 = $6c 280 10000 ???? 00 08 platformer_test_sprite2_tallsprite_00_color3 = $08 281 10000 ???? 00 04 platformer_test_sprite2_tallsprite_00_color2 = $04 282 10000 ???? 00 0f platformer_test_sprite2_tallsprite_00_color1 = $0f 283 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color0 = $00 284 10000 ???? 00 00 platformer_test_sprite2_color15 = 0 285 10000 ???? 00 00 platformer_test_sprite2_color14 = 0 286 10000 ???? 00 00 platformer_test_sprite2_color13 = 0 287 10000 ???? 00 00 platformer_test_sprite2_color12 = 0 288 10000 ???? 00 00 platformer_test_sprite2_color11 = 0 289 10000 ???? 00 00 platformer_test_sprite2_color10 = 0 290 10000 ???? 00 00 platformer_test_sprite2_color9 = 0 291 10000 ???? 00 00 platformer_test_sprite2_color8 = 0 292 10000 ???? 00 00 platformer_test_sprite2_color7 = 0 293 10000 ???? 00 00 platformer_test_sprite2_color6 = $00 294 10000 ???? 00 68 platformer_test_sprite2_color5 = $68 295 10000 ???? 00 6c platformer_test_sprite2_color4 = $6c 296 10000 ???? 00 08 platformer_test_sprite2_color3 = $08 297 10000 ???? 00 04 platformer_test_sprite2_color2 = $04 298 10000 ???? 00 0f platformer_test_sprite2_color1 = $0f 299 10000 ???? 00 00 platformer_test_sprite2_color0 = $00 300 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color15 = 0 301 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color14 = 0 302 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color13 = 0 303 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color12 = 0 304 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color11 = 0 305 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color10 = 0 306 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color9 = 0 307 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color8 = 0 308 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color7 = 0 309 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color6 = $00 310 10000 ???? 00 68 platformer_test_sprite1_tallsprite_00_color5 = $68 311 10000 ???? 00 6c platformer_test_sprite1_tallsprite_00_color4 = $6c 312 10000 ???? 00 04 platformer_test_sprite1_tallsprite_00_color3 = $04 313 10000 ???? 00 08 platformer_test_sprite1_tallsprite_00_color2 = $08 314 10000 ???? 00 0f platformer_test_sprite1_tallsprite_00_color1 = $0f 315 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color0 = $00 316 10000 ???? 00 00 platformer_test_sprite1_color15 = 0 317 10000 ???? 00 00 platformer_test_sprite1_color14 = 0 318 10000 ???? 00 00 platformer_test_sprite1_color13 = 0 319 10000 ???? 00 00 platformer_test_sprite1_color12 = 0 320 10000 ???? 00 00 platformer_test_sprite1_color11 = 0 321 10000 ???? 00 00 platformer_test_sprite1_color10 = 0 322 10000 ???? 00 00 platformer_test_sprite1_color9 = 0 323 10000 ???? 00 00 platformer_test_sprite1_color8 = 0 324 10000 ???? 00 00 platformer_test_sprite1_color7 = 0 325 10000 ???? 00 00 platformer_test_sprite1_color6 = $00 326 10000 ???? 00 68 platformer_test_sprite1_color5 = $68 327 10000 ???? 00 6c platformer_test_sprite1_color4 = $6c 328 10000 ???? 00 04 platformer_test_sprite1_color3 = $04 329 10000 ???? 00 08 platformer_test_sprite1_color2 = $08 330 10000 ???? 00 0f platformer_test_sprite1_color1 = $0f 331 10000 ???? 00 00 platformer_test_sprite1_color0 = $00 332 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color15 = 0 333 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color14 = 0 334 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color13 = 0 335 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color12 = 0 336 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color11 = 0 337 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color10 = 0 338 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color9 = 0 339 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color8 = 0 340 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color7 = 0 341 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color6 = $00 342 10000 ???? 00 68 platformer_test_sprite0_tallsprite_00_color5 = $68 343 10000 ???? 00 6c platformer_test_sprite0_tallsprite_00_color4 = $6c 344 10000 ???? 00 04 platformer_test_sprite0_tallsprite_00_color3 = $04 345 10000 ???? 00 08 platformer_test_sprite0_tallsprite_00_color2 = $08 346 10000 ???? 00 0f platformer_test_sprite0_tallsprite_00_color1 = $0f 347 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color0 = $00 348 10000 ???? 00 00 platformer_test_sprite0_color15 = 0 349 10000 ???? 00 00 platformer_test_sprite0_color14 = 0 350 10000 ???? 00 00 platformer_test_sprite0_color13 = 0 351 10000 ???? 00 00 platformer_test_sprite0_color12 = 0 352 10000 ???? 00 00 platformer_test_sprite0_color11 = 0 353 10000 ???? 00 00 platformer_test_sprite0_color10 = 0 354 10000 ???? 00 00 platformer_test_sprite0_color9 = 0 355 10000 ???? 00 00 platformer_test_sprite0_color8 = 0 356 10000 ???? 00 00 platformer_test_sprite0_color7 = 0 357 10000 ???? 00 00 platformer_test_sprite0_color6 = $00 358 10000 ???? 00 68 platformer_test_sprite0_color5 = $68 359 10000 ???? 00 6c platformer_test_sprite0_color4 = $6c 360 10000 ???? 00 04 platformer_test_sprite0_color3 = $04 361 10000 ???? 00 08 platformer_test_sprite0_color2 = $08 362 10000 ???? 00 0f platformer_test_sprite0_color1 = $0f 363 10000 ???? 00 00 platformer_test_sprite0_color0 = $00 364 10000 ???? 00 00 platformer_test_tiles_ramchar_tallsprite_00_color3 = $00 365 10000 ???? 00 08 platformer_test_tiles_ramchar_tallsprite_00_color2 = $08 366 10000 ???? 00 04 platformer_test_tiles_ramchar_tallsprite_00_color1 = $04 367 10000 ???? 00 00 platformer_test_tiles_ramchar_tallsprite_00_color0 = $00 368 10000 ???? 00 00 platformer_test_tiles_ramchar_color3 = $00 369 10000 ???? 00 08 platformer_test_tiles_ramchar_color2 = $08 370 10000 ???? 00 04 platformer_test_tiles_ramchar_color1 = $04 371 10000 ???? 00 00 platformer_test_tiles_ramchar_color0 = $00 372 10000 ???? 23 10 vSpeed = $2310 373 10000 ???? 374 10000 ???? 23 00 hSpeed = $2300 375 10000 ???? 376 10000 ???? 22 00 screendata = $2200 377 10000 ???? 378 10000 ???? 01 50 level = var16 379 10000 ???? 380 10000 ???? 01 4f pTemp2 = var15 381 10000 ???? 382 10000 ???? 01 4e pTemp1 = var14 383 10000 ???? 384 10000 ???? 01 4d gen_frame = var13 385 10000 ???? 386 10000 ???? 01 4c playerChar = var12 387 10000 ???? 388 10000 ???? 01 4b player_aniframe = var11 389 10000 ???? 390 10000 ???? 01 4a player_dir = var10 391 10000 ???? 392 10000 ???? 01 49 player_moving = var9 393 10000 ???? 394 10000 ???? 01 48 button2_Debounce = var8 395 10000 ???? 396 10000 ???? 01 47 button1_Debounce = var7 397 10000 ???? 398 10000 ???? 01 46 joyposright = var6 399 10000 ???? 400 10000 ???? 01 45 joyposleft = var5 401 10000 ???? 402 10000 ???? 01 44 joyposup = var4 403 10000 ???? 404 10000 ???? 01 43 joyposdown = var3 405 10000 ???? 406 10000 ???? 01 42 player_y = var2 407 10000 ???? 408 10000 ???? 01 41 player_x = var1 409 10000 ???? 410 10000 ???? 01 40 frameCounter = var0 411 10000 ???? 412 10000 ???? 00 01 collisionwrap = 1 413 10000 ???? 00 01 NTSC = 1 414 10000 ???? 00 c0 SCREENHEIGHT = 192 415 10000 ???? 00 01 CHECKOVERWRITE = 1 416 10000 ???? 00 08 ZONEHEIGHT = 8 417 10000 ???? 00 01 ROM48K = 1 ------- FILE 7800basic.h 6 10000 ???? 7 10000 ???? ;************ 7800 overall RAM map ************** 8 10000 ???? 9 10000 ???? ; 40-FF zero page RAM 10 10000 ???? ; 140-1FF RAM (stack) 11 10000 ???? ; 1800-203F RAM 12 10000 ???? ; 2100-213F RAM 13 10000 ???? ; 2200-27FF RAM 14 10000 ???? 15 10000 ???? ;************ 7800basic RAM usage map ************** 16 10000 ???? 17 10000 ???? ; 40-FF numerous defines, listed below 18 10000 ???? ; 140-1FF RAM (stack) 19 10000 ???? 20 10000 ???? ; 1800-187F DLL (1800-18DF with page flipping enabled) 21 10000 ???? ; 1880-1FFF DLs (18E0-1FFF with page flipping enabled) 22 10000 ???? 23 10000 ???? ; 2000-203F Reserved 24 10000 ???? ; 2100-213F Reserved 25 10000 ???? ; 2200-27FF Free 26 10000 ???? 27 10000 ???? 1f e0 eeprombuffer = $1FE0 28 10000 ???? 18 00 DLLMEM = $1800 29 10000 ???? 00 70 DBOFFSET = $70 ; $E0 length DL is /2 for double-buffering 30 10000 ???? 31 10000 ???? - ifconst PLOTVALUEPAGE 32 10000 ???? -VALBUFFER = (PLOTVALUEPAGE*256) 33 10000 ???? else 34 10000 ???? 20 00 VALBUFFER = $2000 ; to $203F ** never let VALBUFFER straddle pages 35 10000 ???? endif 36 10000 ???? 37 10000 ???? 38 10000 ???? 21 00 pausestate = $2100 39 10000 ???? 21 01 dlzero = $2101 ; zero to force end of $2100 DL, which we use in vblank and overscan 40 10000 ???? 21 02 sINPT1 = $2102 ; save register for joy button joy0 41 10000 ???? 21 03 sINPT3 = $2103 ; save register for joy button joy1 42 10000 ???? 21 04 currentbank = $2104 43 10000 ???? 44 10000 ???? 21 05 currentrambank = $2105 45 10000 ???? 21 06 charactermode = $2106 46 10000 ???? 21 07 sCTRL = $2107 47 10000 ???? 21 08 pokeydetected = $2108 48 10000 ???? 21 09 paldetected = $2109 49 10000 ???? 21 0a avoxdetected = $210A 50 10000 ???? 21 0b sCHARBASE = $210B ; save register for CHARBASE 51 10000 ???? 52 10000 ???? 21 0c hsdevice = $210C 53 10000 ???? 21 0d hsdifficulty = $210D 54 10000 ???? 21 0e hserror = $210E 55 10000 ???? 21 0f hsgameslot = $210F 56 10000 ???? 21 10 hsnewscoreline = $2110 57 10000 ???? 21 11 hsnewscorerank = $2111 58 10000 ???? 21 12 HSRAMTable = $2112 ; to $212F (30 bytes) Format: III*5, SSS*5 59 10000 ???? 21 12 HSRAMInitials = $2112 ; see above 60 10000 ???? 21 21 HSRAMScores = $2121 ; see above 61 10000 ???? 62 10000 ???? 21 31 ssCTRL = $2131 63 10000 ???? 21 32 ssCHARBASE = $2132 64 10000 ???? 21 33 hsdisplaymode = $2133 65 10000 ???? 21 34 gamedifficulty = $2134 66 10000 ???? 21 35 hsinitialpos = $2135 67 10000 ???? 21 36 hsinitialhold = $2136 68 10000 ???? 21 37 hscursorx = $2137 69 10000 ???? 21 38 hsjoydebounce = $2138 70 10000 ???? 21 39 hsswcha = $2139 71 10000 ???? 21 3a hsinpt1 = $213A 72 10000 ???? 21 3b hscolorchaseindex = $213B 73 10000 ???? 21 3c visibleDLLstart = $213C 74 10000 ???? 21 3d overscanDLLstart = $213D 75 10000 ???? 21 3e frameslost = $213E 76 10000 ???? 77 10000 ???? 78 10000 ???? 00 40 rand = $40 79 10000 ???? 00 41 rand16 = $41 80 10000 ???? 00 42 temp1 = $42 81 10000 ???? 00 43 temp2 = $43 82 10000 ???? 00 44 temp3 = $44 83 10000 ???? 00 45 temp4 = $45 84 10000 ???? 00 46 temp5 = $46 85 10000 ???? 00 47 temp6 = $47 86 10000 ???? 00 48 temp7 = $48 87 10000 ???? 00 49 temp8 = $49 88 10000 ???? 00 4a temp9 = $4a 89 10000 ???? 90 10000 ???? 00 4b pokeybase = $4b 91 10000 ???? 00 4b pokeybaselo = $4b 92 10000 ???? 00 4c pokeybasehi = $4c 93 10000 ???? 94 10000 ???? 00 4d visibleover = $4d 95 10000 ???? 96 10000 ???? 00 4e sfx1pointlo = $4e 97 10000 ???? 00 4f sfx2pointlo = $4f 98 10000 ???? 00 50 sfx1pointhi = $50 99 10000 ???? 00 51 sfx2pointhi = $51 100 10000 ???? 101 10000 ???? 00 52 sfx1priority = $52 102 10000 ???? 00 53 sfx2priority = $53 103 10000 ???? 00 54 sfx1poffset = $54 104 10000 ???? 00 55 sfx2poffset = $55 105 10000 ???? 106 10000 ???? 00 56 sfx1frames = $56 107 10000 ???? 00 57 sfx2frames = $57 108 10000 ???? 00 58 sfx1tick = $58 109 10000 ???? 00 59 sfx2tick = $59 110 10000 ???? 111 10000 ???? 00 5a tempmath = $5a 112 10000 ???? 113 10000 ???? 00 5b pokey1pointlo = $5b 114 10000 ???? 00 5c pokey1pointhi = $5c 115 10000 ???? 00 5d pokey2pointlo = $5d 116 10000 ???? 00 5e pokey2pointhi = $5e 117 10000 ???? 00 5f pokey3pointlo = $5f 118 10000 ???? 00 60 pokey3pointhi = $60 119 10000 ???? 00 61 pokey4pointlo = $61 120 10000 ???? 00 62 pokey4pointhi = $62 121 10000 ???? 122 10000 ???? 00 63 dlpnt = $63 ; to $64 123 10000 ???? 00 65 dlend = $65 ; to $81 - for 28 possible visible dll entries 124 10000 ???? 00 82 dlendsave = $82 ; to $9e - for 28 possible visible dll entries 125 10000 ???? 126 10000 ???? 00 9f speech_addr = $9f 127 10000 ???? 00 a0 speech_addr_hi = $a0 128 10000 ???? 129 10000 ???? 00 a1 HSGameTableLo = $a1 130 10000 ???? 00 a2 HSGameTableHi = $a2 131 10000 ???? 00 a3 HSVoxHi = $a3 132 10000 ???? 00 a4 HSVoxLo = $a4 133 10000 ???? 134 10000 ???? ;channel pointers 135 10000 ???? 136 10000 ???? 00 a5 songchannel1layer1lo = $a5 137 10000 ???? 00 a6 songchannel2layer1lo = $a6 138 10000 ???? 00 a7 songchannel3layer1lo = $a7 139 10000 ???? 00 a8 songchannel4layer1lo = $a8 140 10000 ???? 141 10000 ???? 00 a9 songchannel1layer2lo = $a9 142 10000 ???? 00 aa songchannel2layer2lo = $aA 143 10000 ???? 00 ab songchannel3layer2lo = $aB 144 10000 ???? 00 ac songchannel4layer2lo = $aC 145 10000 ???? 146 10000 ???? 00 ad songchannel1layer3lo = $aD 147 10000 ???? 00 ae songchannel2layer3lo = $aE 148 10000 ???? 00 af songchannel3layer3lo = $aF 149 10000 ???? 00 b0 songchannel4layer3lo = $b0 150 10000 ???? 151 10000 ???? 00 b1 songchannel1layer1hi = $b1 152 10000 ???? 00 b2 songchannel2layer1hi = $b2 153 10000 ???? 00 b3 songchannel3layer1hi = $b3 154 10000 ???? 00 b4 songchannel4layer1hi = $b4 155 10000 ???? 156 10000 ???? 00 b5 songchannel1layer2hi = $b5 157 10000 ???? 00 b6 songchannel2layer2hi = $b6 158 10000 ???? 00 b7 songchannel3layer2hi = $b7 159 10000 ???? 00 b8 songchannel4layer2hi = $b8 160 10000 ???? 161 10000 ???? 00 b9 songchannel1layer3hi = $b9 162 10000 ???? 00 ba songchannel2layer3hi = $bA 163 10000 ???? 00 bb songchannel3layer3hi = $bB 164 10000 ???? 00 bc songchannel4layer3hi = $bC 165 10000 ???? 166 10000 ???? 00 bd songdatalo = $bd 167 10000 ???? 00 be songdatahi = $be 168 10000 ???? 169 10000 ???? 00 bf inactivechannelcount = $bf 170 10000 ???? 171 10000 ???? 172 10000 ???? 00 c0 songchannel1transpose = $c0 173 10000 ???? 00 c1 songchannel2transpose = $c1 174 10000 ???? 00 c2 songchannel3transpose = $c2 175 10000 ???? 00 c3 songchannel4transpose = $c3 176 10000 ???? 177 10000 ???? 00 c4 songstackindex = $c4 178 10000 ???? 179 10000 ???? 00 c5 songchannel1instrumentlo = $c5 180 10000 ???? 00 c6 songchannel2instrumentlo = $c6 181 10000 ???? 00 c7 songchannel3instrumentlo = $c7 182 10000 ???? 00 c8 songchannel4instrumentlo = $c8 183 10000 ???? 184 10000 ???? 00 c9 songchannel1instrumenthi = $c9 185 10000 ???? 00 ca songchannel2instrumenthi = $ca 186 10000 ???? 00 cb songchannel3instrumenthi = $cb 187 10000 ???? 00 cc songchannel4instrumenthi = $cc 188 10000 ???? 189 10000 ???? 00 cd sfx1notedata = $cd 190 10000 ???? 00 ce sfx2notedata = $ce 191 10000 ???? 192 10000 ???? 00 cf songloops = $cf 193 10000 ???? 194 10000 ???? 00 d0 songpointerlo = $D0 195 10000 ???? 00 d1 songpointerhi = $D1 196 10000 ???? 197 10000 ???? 00 d2 voxlock = $D2 198 10000 ???? 00 d3 voxqueuesize = $D3 199 10000 ???? 200 10000 ???? 00 d4 vblankroutines = $D4 201 10000 ???? 202 10000 ???? 00 d5 doublebufferstate = $D5 203 10000 ???? 00 d6 doublebufferdloffset = $D6 204 10000 ???? 00 d7 doublebufferbufferdirty = $D7 205 10000 ???? 206 10000 ???? 00 d8 inttemp1 = $D8 207 10000 ???? 00 d9 inttemp2 = $D9 208 10000 ???? 00 da inttemp3 = $DA 209 10000 ???? 00 db inttemp4 = $DB 210 10000 ???? 00 dc inttemp5 = $DC 211 10000 ???? 00 dd inttemp6 = $DD 212 10000 ???? 213 10000 ???? 00 de sfxschedulelock = $DE 214 10000 ???? 00 df sfxschedulemissed = $DF 215 10000 ???? 00 e0 sfxinstrumentlo = $E0 216 10000 ???? 00 e1 sfxinstrumenthi = $E1 217 10000 ???? 00 e2 sfxpitchoffset = $E2 218 10000 ???? 00 e3 sfxnoteindex = $E3 219 10000 ???? 220 10000 ???? 00 e4 CTLSWAs = $E4 221 10000 ???? 00 e5 CTLSWBs = $E5 222 10000 ???? 223 10000 ???? 00 e6 A = $e6 224 10000 ???? 00 e6 a = $e6 225 10000 ???? 00 e7 B = $e7 226 10000 ???? 00 e7 b = $e7 227 10000 ???? 00 e8 C = $e8 228 10000 ???? 00 e8 c = $e8 229 10000 ???? 00 e9 D = $e9 230 10000 ???? 00 e9 d = $e9 231 10000 ???? 00 ea E = $ea 232 10000 ???? 00 ea e = $ea 233 10000 ???? 00 eb F = $eb 234 10000 ???? 00 eb f = $eb 235 10000 ???? 00 ec G = $ec 236 10000 ???? 00 ec g = $ec 237 10000 ???? 00 ed H = $ed 238 10000 ???? 00 ed h = $ed 239 10000 ???? 00 ee I = $ee 240 10000 ???? 00 ee i = $ee 241 10000 ???? 00 ef J = $ef 242 10000 ???? 00 ef j = $ef 243 10000 ???? 00 f0 K = $f0 244 10000 ???? 00 f0 k = $f0 245 10000 ???? 00 f1 L = $f1 246 10000 ???? 00 f1 l = $f1 247 10000 ???? 00 f2 M = $f2 248 10000 ???? 00 f2 m = $f2 249 10000 ???? 00 f3 N = $f3 250 10000 ???? 00 f3 n = $f3 251 10000 ???? 00 f4 O = $f4 252 10000 ???? 00 f4 o = $f4 253 10000 ???? 00 f5 P = $f5 254 10000 ???? 00 f5 p = $f5 255 10000 ???? 00 f6 Q = $f6 256 10000 ???? 00 f6 q = $f6 257 10000 ???? 00 f7 R = $f7 258 10000 ???? 00 f7 r = $f7 259 10000 ???? 00 f8 S = $f8 260 10000 ???? 00 f8 s = $f8 261 10000 ???? 00 f9 T = $f9 262 10000 ???? 00 f9 t = $f9 263 10000 ???? 00 fa U = $fa 264 10000 ???? 00 fa u = $fa 265 10000 ???? 00 fb V = $fb 266 10000 ???? 00 fb v = $fb 267 10000 ???? 00 fc W = $fc 268 10000 ???? 00 fc w = $fc 269 10000 ???? 00 fd X = $fd 270 10000 ???? 00 fd x = $fd 271 10000 ???? 00 fe Y = $fe 272 10000 ???? 00 fe y = $fe 273 10000 ???? 00 ff Z = $ff 274 10000 ???? 00 ff z = $ff 275 10000 ???? 276 10000 ???? ; var0-var99 variables use the top of the stack 277 10000 ???? 01 40 var0 = $140 278 10000 ???? 01 41 var1 = $141 279 10000 ???? 01 42 var2 = $142 280 10000 ???? 01 43 var3 = $143 281 10000 ???? 01 44 var4 = $144 282 10000 ???? 01 45 var5 = $145 283 10000 ???? 01 46 var6 = $146 284 10000 ???? 01 47 var7 = $147 285 10000 ???? 01 48 var8 = $148 286 10000 ???? 01 49 var9 = $149 287 10000 ???? 01 4a var10 = $14a 288 10000 ???? 01 4b var11 = $14b 289 10000 ???? 01 4c var12 = $14c 290 10000 ???? 01 4d var13 = $14d 291 10000 ???? 01 4e var14 = $14e 292 10000 ???? 01 4f var15 = $14f 293 10000 ???? 01 50 var16 = $150 294 10000 ???? 01 51 var17 = $151 295 10000 ???? 01 52 var18 = $152 296 10000 ???? 01 53 var19 = $153 297 10000 ???? 01 54 var20 = $154 298 10000 ???? 01 55 var21 = $155 299 10000 ???? 01 56 var22 = $156 300 10000 ???? 01 57 var23 = $157 301 10000 ???? 01 58 var24 = $158 302 10000 ???? 01 59 var25 = $159 303 10000 ???? 01 5a var26 = $15a 304 10000 ???? 01 5b var27 = $15b 305 10000 ???? 01 5c var28 = $15c 306 10000 ???? 01 5d var29 = $15d 307 10000 ???? 01 5e var30 = $15e 308 10000 ???? 01 5f var31 = $15f 309 10000 ???? 01 60 var32 = $160 310 10000 ???? 01 61 var33 = $161 311 10000 ???? 01 62 var34 = $162 312 10000 ???? 01 63 var35 = $163 313 10000 ???? 01 64 var36 = $164 314 10000 ???? 01 65 var37 = $165 315 10000 ???? 01 66 var38 = $166 316 10000 ???? 01 67 var39 = $167 317 10000 ???? 01 68 var40 = $168 318 10000 ???? 01 69 var41 = $169 319 10000 ???? 01 6a var42 = $16a 320 10000 ???? 01 6b var43 = $16b 321 10000 ???? 01 6c var44 = $16c 322 10000 ???? 01 6d var45 = $16d 323 10000 ???? 01 6e var46 = $16e 324 10000 ???? 01 6f var47 = $16f 325 10000 ???? 01 70 var48 = $170 326 10000 ???? 01 71 var49 = $171 327 10000 ???? 01 72 var50 = $172 328 10000 ???? 01 73 var51 = $173 329 10000 ???? 01 74 var52 = $174 330 10000 ???? 01 75 var53 = $175 331 10000 ???? 01 76 var54 = $176 332 10000 ???? 01 77 var55 = $177 333 10000 ???? 01 78 var56 = $178 334 10000 ???? 01 79 var57 = $179 335 10000 ???? 01 7a var58 = $17a 336 10000 ???? 01 7b var59 = $17b 337 10000 ???? 01 7c var60 = $17c 338 10000 ???? 01 7d var61 = $17d 339 10000 ???? 01 7e var62 = $17e 340 10000 ???? 01 7f var63 = $17f 341 10000 ???? 01 80 var64 = $180 342 10000 ???? 01 81 var65 = $181 343 10000 ???? 01 82 var66 = $182 344 10000 ???? 01 83 var67 = $183 345 10000 ???? 01 84 var68 = $184 346 10000 ???? 01 85 var69 = $185 347 10000 ???? 01 86 var70 = $186 348 10000 ???? 01 87 var71 = $187 349 10000 ???? 01 88 var72 = $188 350 10000 ???? 01 89 var73 = $189 351 10000 ???? 01 8a var74 = $18a 352 10000 ???? 01 8b var75 = $18b 353 10000 ???? 01 8c var76 = $18c 354 10000 ???? 01 8d var77 = $18d 355 10000 ???? 01 8e var78 = $18e 356 10000 ???? 01 8f var79 = $18f 357 10000 ???? 01 90 var80 = $190 358 10000 ???? 01 91 var81 = $191 359 10000 ???? 01 92 var82 = $192 360 10000 ???? 01 93 var83 = $193 361 10000 ???? 01 94 var84 = $194 362 10000 ???? 01 95 var85 = $195 363 10000 ???? 01 96 var86 = $196 364 10000 ???? 01 97 var87 = $197 365 10000 ???? 01 98 var88 = $198 366 10000 ???? 01 99 var89 = $199 367 10000 ???? 01 9a var90 = $19a 368 10000 ???? 01 9b var91 = $19b 369 10000 ???? 01 9c var92 = $19c 370 10000 ???? 01 9d var93 = $19d 371 10000 ???? 01 9e var94 = $19e 372 10000 ???? 01 9f var95 = $19f 373 10000 ???? 01 a0 var96 = $1a0 374 10000 ???? 01 a1 var97 = $1a1 375 10000 ???? 01 a2 var98 = $1a2 376 10000 ???? 01 a3 var99 = $1a3 377 10000 ???? 378 U01c2 ???? SEG.U "7800basicRAM" 379 U01a4 ORG $1A4 380 U01a4 381 U01a4 ; MAX allocation locations are in comments... 382 U01a4 00 framecounter DS 1 ; $1A4 383 U01a5 00 countdownseconds DS 1 ; $1A5 384 U01a6 00 00 00 score0 DS 3 ; $1A6 $1A7 $1A8 385 U01a9 00 00 00 score1 DS 3 ; $1A9 $1AA $1AB 386 U01ac 00 pausebuttonflag DS 1 ; $1AC 387 U01ad 00 valbufend DS 1 ; $1AD 388 U01ae 00 valbufendsave DS 1 ; $1AE 389 U01af 00 finescrollx DS 1 ; $1AF 390 U01b0 00 finescrolly DS 1 ; $1B0 391 U01b1 00 joybuttonmode DS 1 ; $1B1 ; track joysticks that were changed to one-button mode 392 U01b2 00 interruptindex DS 1 ; $1B2 393 U01b3 394 U01b3 - ifconst DOUBLEBUFFER 395 U01b3 -doublebufferminimumframetarget DS 1 ; $1B3 396 U01b3 -doublebufferminimumframeindex DS 1 ; $1B4 397 U01b3 endif 398 U01b3 399 U01b3 00 pausedisable DS 1 ; $1B5 400 U01b4 00 XCTRL1s DS 1 ; $1B6 401 U01b5 402 U01b5 - ifconst AVOXVOICE 403 U01b5 -avoxenable DS 1 ; $1B7 404 U01b5 -tempavox DS 1 ; $1B8 405 U01b5 endif 406 U01b5 407 U01b5 - ifconst MUSICTRACKER 408 U01b5 -songtempo DS 1 ; $1B9 409 U01b5 -songtick DS 1 ; $1BA 410 U01b5 - 411 U01b5 -songchannel1layer1loops DS 1 ; $1BB 412 U01b5 -songchannel2layer1loops DS 1 ; $1BC 413 U01b5 -songchannel3layer1loops DS 1 ; $1BD 414 U01b5 -songchannel4layer1loops DS 1 ; $1BE 415 U01b5 - 416 U01b5 -songchannel1layer2loops DS 1 ; $1BF 417 U01b5 -songchannel2layer2loops DS 1 ; $1C0 418 U01b5 -songchannel3layer2loops DS 1 ; $1C1 419 U01b5 -songchannel4layer2loops DS 1 ; $1C2 420 U01b5 - 421 U01b5 -songchannel1layer3loops DS 1 ; $1C3 422 U01b5 -songchannel2layer3loops DS 1 ; $1C4 423 U01b5 -songchannel3layer3loops DS 1 ; $1C5 424 U01b5 -songchannel4layer3loops DS 1 ; $1C6 425 U01b5 - 426 U01b5 -songchannel1busywait DS 1 ; $1C7 427 U01b5 -songchannel2busywait DS 1 ; $1C8 428 U01b5 -songchannel3busywait DS 1 ; $1C9 429 U01b5 -songchannel4busywait DS 1 ; $1CA 430 U01b5 - 431 U01b5 -songchannel1stackdepth DS 1 ; $1CB 432 U01b5 -songchannel2stackdepth DS 1 ; $1CC 433 U01b5 -songchannel3stackdepth DS 1 ; $1CD 434 U01b5 -songchannel4stackdepth DS 1 ; $1CE 435 U01b5 endif 436 U01b5 437 U01b5 00 palframes DS 1 ; $1CF 438 U01b6 00 palfastframe DS 1 ; $1D0 439 U01b7 440 U01b7 - ifconst MOUSESUPPORT 441 U01b7 -port0resolution DS 1 ; $1D1 442 U01b7 -port1resolution DS 1 ; $1D2 443 U01b7 else 444 U01b7 - ifconst TRAKBALLSUPPORT 445 U01b7 -port0resolution DS 1 ; $1D1 446 U01b7 -port1resolution DS 1 ; $1D2 447 U01b7 endif 448 U01b7 endif 449 U01b7 450 U01b7 00 port0control DS 1 ; $1D3 451 U01b8 00 port1control DS 1 ; $1D4 452 U01b9 453 U01b9 ; port#control values... 454 U01b9 ; 1 = proline 455 U01b9 ; 2 = lightgun 456 U01b9 ; 3 = paddle 457 U01b9 ; 4 = trakball 458 U01b9 ; 5 = vcs joystick 459 U01b9 ; 6 = driving 460 U01b9 ; 7 = keypad 461 U01b9 ; 8 = st mouse/cx80 462 U01b9 ; 9 = amiga mouse 463 U01b9 ; 10 = atarivox 464 U01b9 465 U01b9 ; controller 0 data... 466 U01b9 00 paddleposition0 DS 1 ; $1D5 467 U01b9 01 b9 keypadmatrix0a = paddleposition0 468 U01b9 01 b9 drivingposition0 = paddleposition0 469 U01b9 01 b9 trakballx0 = paddleposition0 470 U01b9 01 b9 mousex0 = paddleposition0 471 U01b9 01 b9 lighttgunx0 = paddleposition0 472 U01ba 473 U01ba ; controller 1 data... 474 U01ba 00 paddleposition2 DS 1 ; $1D6 475 U01ba 01 ba keypadmatrix1a = paddleposition2 476 U01ba 01 ba drivingposition1 = paddleposition2 477 U01ba 01 ba trakballx1 = paddleposition2 478 U01ba 01 ba mousex1 = paddleposition2 479 U01ba 01 ba lightgunx1 = paddleposition2 480 U01bb 481 U01bb ; controller 0 altdata... 482 U01bb 00 paddleposition1 DS 1 ; $1D7 483 U01bb 01 bb keypadmatrix0b = paddleposition1 484 U01bb 01 bb trakbally0 = paddleposition1 485 U01bb 01 bb mousey0 = paddleposition1 486 U01bb 01 bb lightguny0 = paddleposition1 487 U01bc 488 U01bc ; controller 1 altdata... 489 U01bc 00 paddleposition3 DS 1 ; $1D8 490 U01bc 01 bc keypadmatrix1b = paddleposition3 491 U01bc 01 bc trakbally1 = paddleposition3 492 U01bc 01 bc mousey1 = paddleposition3 493 U01bc 01 bc lightguny1 = paddleposition3 494 U01bd 495 U01bd ; controller state save. for trakball state+dir codes, rotary position codes 496 U01bd 00 controller0statesave DS 1 ; $1D9 497 U01bd 01 bd paddleprevious0 = controller0statesave 498 U01bd 01 bd mousecodex0 = controller0statesave 499 U01bd 01 bd trakballcodex0 = controller0statesave 500 U01bd 01 bd keypadmatrix0c = controller0statesave 501 U01be 502 U01be 00 controller1statesave DS 1 ; $1DA 503 U01be 01 be paddleprevious2 = controller1statesave 504 U01be 01 be mousecodex1 = controller1statesave 505 U01be 01 be trakballcodex1 = controller1statesave 506 U01be 01 be keypadmatrix1c = controller1statesave 507 U01bf 508 U01bf 00 paddleprevious1 DS 1 ; $1DB 509 U01bf 01 bf keypadmatrix0d = paddleprevious1 510 U01bf 01 bf mousecodey0 = paddleprevious1 511 U01bf 01 bf trakballcodey0 = paddleprevious1 512 U01c0 513 U01c0 00 paddleprevious3 DS 1 ; $1DC 514 U01c0 01 c0 keypadmatrix1d = paddleprevious3 515 U01c0 01 c0 mousecodey1 = paddleprevious3 516 U01c0 01 c0 trakballcodey1 = paddleprevious3 517 U01c1 518 U01c1 - ifconst pokeysupport 519 U01c1 -pokey1frames DS 1 ; $1DD 520 U01c1 -pokey1tick DS 1 ; $1DE 521 U01c1 -pokey2frames DS 1 ; $1DF 522 U01c1 -pokey2tick DS 1 ; $1E0 523 U01c1 -pokey3frames DS 1 ; $1E1 524 U01c1 -pokey3tick DS 1 ; $1E2 525 U01c1 -pokey4frames DS 1 ; $1E3 526 U01c1 -pokey4tick DS 1 ; $1E4 527 U01c1 -pokey1priority DS 1 ; $1E5 528 U01c1 -pokey1offset DS 1 ; $1E6 529 U01c1 -pokey2priority DS 1 ; $1E7 530 U01c1 -pokey2offset DS 1 ; $1E8 531 U01c1 -pokey3priority DS 1 ; $1E9 532 U01c1 -pokey3offset DS 1 ; $1EA 533 U01c1 -pokey4priority DS 1 ; $1EB 534 U01c1 -pokey4offset DS 1 ; $1EC 535 U01c1 endif 536 U01c1 537 U01c1 ; see if we need an interrupthold byte... 538 U01c1 INTERRUPTNEEDED SET 0 539 U01c1 - ifconst .topscreenroutine 540 U01c1 -INTERRUPTNEEDED SET 1 541 U01c1 endif 542 U01c1 - ifconst .bottomscreenroutine 543 U01c1 -INTERRUPTNEEDED SET 1 544 U01c1 endif 545 U01c1 - ifconst .userinterrupt 546 U01c1 -INTERRUPTNEEDED SET 1 547 U01c1 endif 548 U01c1 - if INTERRUPTNEEDED = 1 549 U01c1 -interrupthold DS 1 ; $1ED 550 U01c1 endif 551 U01c1 552 U01c1 ifnconst CANARYOFF 553 U01c1 00 canary DS 1 ; $1EF 554 U01c2 endif 555 U01c2 556 U01c2 557 U01c2 ifnconst bankswitchmode stack allowance: 30 nested subroutines. 558 U01c2 echo " stack allowance:",[($1FF - .)/2]d,"nested subroutines." 559 U01c2 - else 560 U01c2 - echo " stack allowance:",[($1FF - .)/3]d,"nested subroutines." 561 U01c2 endif 562 U01c2 ifnconst CANARYOFF the canary is situated at: $1c1 563 U01c2 echo " the canary is situated at:",[canary] 564 U01c2 - else 565 U01c2 - echo " the canary is disabled." 566 U01c2 endif 567 U01c2 568 U01c2 ; $1EE - $1FF reserved for stack 569 U01c2 570 10000 ???? SEG "GAME" 571 10000 ???? ------- FILE c:\Users\Shane\Documents\my7800projects\platformer_demos\template\platformer_demo_v01.78b.asm ------- FILE 7800basic_variable_redefs.h LEVEL 2 PASS 3 0 10000 ???? include "7800basic_variable_redefs.h" 1 10000 ???? ; This file contains variable mapping and other information for the current project. 2 10000 ???? 3 10000 ???? 00 00 platformer_test_fontCS_mode = $00 4 10000 ???? 00 06 platformer_test_fontCS_width_twoscompliment = $06 5 10000 ???? 00 3a platformer_test_fontCS_width = $3a 6 10000 ???? 00 80 platformer_test_sprite8_tallsprite_00_mode = $80 7 10000 ???? 00 1c platformer_test_sprite8_tallsprite_00_width_twoscompliment = $1c 8 10000 ???? 00 04 platformer_test_sprite8_tallsprite_00_width = $04 9 10000 ???? 00 80 platformer_test_sprite8_mode = $80 10 10000 ???? 00 1c platformer_test_sprite8_width_twoscompliment = $1c 11 10000 ???? 00 04 platformer_test_sprite8_width = $04 12 10000 ???? 00 80 platformer_test_sprite7_tallsprite_00_mode = $80 13 10000 ???? 00 1c platformer_test_sprite7_tallsprite_00_width_twoscompliment = $1c 14 10000 ???? 00 04 platformer_test_sprite7_tallsprite_00_width = $04 15 10000 ???? 00 80 platformer_test_sprite7_mode = $80 16 10000 ???? 00 1c platformer_test_sprite7_width_twoscompliment = $1c 17 10000 ???? 00 04 platformer_test_sprite7_width = $04 18 10000 ???? 00 80 platformer_test_sprite6_tallsprite_00_mode = $80 19 10000 ???? 00 1c platformer_test_sprite6_tallsprite_00_width_twoscompliment = $1c 20 10000 ???? 00 04 platformer_test_sprite6_tallsprite_00_width = $04 21 10000 ???? 00 80 platformer_test_sprite6_mode = $80 22 10000 ???? 00 1c platformer_test_sprite6_width_twoscompliment = $1c 23 10000 ???? 00 04 platformer_test_sprite6_width = $04 24 10000 ???? 00 80 platformer_test_sprite5_tallsprite_00_mode = $80 25 10000 ???? 00 1c platformer_test_sprite5_tallsprite_00_width_twoscompliment = $1c 26 10000 ???? 00 04 platformer_test_sprite5_tallsprite_00_width = $04 27 10000 ???? 00 80 platformer_test_sprite5_mode = $80 28 10000 ???? 00 1c platformer_test_sprite5_width_twoscompliment = $1c 29 10000 ???? 00 04 platformer_test_sprite5_width = $04 30 10000 ???? 00 80 platformer_test_sprite4_tallsprite_00_mode = $80 31 10000 ???? 00 1c platformer_test_sprite4_tallsprite_00_width_twoscompliment = $1c 32 10000 ???? 00 04 platformer_test_sprite4_tallsprite_00_width = $04 33 10000 ???? 00 80 platformer_test_sprite4_mode = $80 34 10000 ???? 00 1c platformer_test_sprite4_width_twoscompliment = $1c 35 10000 ???? 00 04 platformer_test_sprite4_width = $04 36 10000 ???? 00 80 platformer_test_sprite3_tallsprite_00_mode = $80 37 10000 ???? 00 1c platformer_test_sprite3_tallsprite_00_width_twoscompliment = $1c 38 10000 ???? 00 04 platformer_test_sprite3_tallsprite_00_width = $04 39 10000 ???? 00 80 platformer_test_sprite3_mode = $80 40 10000 ???? 00 1c platformer_test_sprite3_width_twoscompliment = $1c 41 10000 ???? 00 04 platformer_test_sprite3_width = $04 42 10000 ???? 00 80 platformer_test_sprite2_tallsprite_00_mode = $80 43 10000 ???? 00 1c platformer_test_sprite2_tallsprite_00_width_twoscompliment = $1c 44 10000 ???? 00 04 platformer_test_sprite2_tallsprite_00_width = $04 45 10000 ???? 00 80 platformer_test_sprite2_mode = $80 46 10000 ???? 00 1c platformer_test_sprite2_width_twoscompliment = $1c 47 10000 ???? 00 04 platformer_test_sprite2_width = $04 48 10000 ???? 00 80 platformer_test_sprite1_tallsprite_00_mode = $80 49 10000 ???? 00 1c platformer_test_sprite1_tallsprite_00_width_twoscompliment = $1c 50 10000 ???? 00 04 platformer_test_sprite1_tallsprite_00_width = $04 51 10000 ???? 00 80 platformer_test_sprite1_mode = $80 52 10000 ???? 00 1c platformer_test_sprite1_width_twoscompliment = $1c 53 10000 ???? 00 04 platformer_test_sprite1_width = $04 54 10000 ???? 00 80 platformer_test_sprite0_tallsprite_00_mode = $80 55 10000 ???? 00 1c platformer_test_sprite0_tallsprite_00_width_twoscompliment = $1c 56 10000 ???? 00 04 platformer_test_sprite0_tallsprite_00_width = $04 57 10000 ???? 00 80 platformer_test_sprite0_mode = $80 58 10000 ???? 00 1c platformer_test_sprite0_width_twoscompliment = $1c 59 10000 ???? 00 04 platformer_test_sprite0_width = $04 60 10000 ???? 00 00 platformer_test_tiles_ramchar_tallsprite_00_mode = $00 61 10000 ???? 00 0c platformer_test_tiles_ramchar_tallsprite_00_width_twoscompliment = $0c 62 10000 ???? 00 14 platformer_test_tiles_ramchar_tallsprite_00_width = $14 63 10000 ???? 00 00 platformer_test_tiles_ramchar_mode = $00 64 10000 ???? 00 0c platformer_test_tiles_ramchar_width_twoscompliment = $0c 65 10000 ???? 00 14 platformer_test_tiles_ramchar_width = $14 66 10000 ???? 01 e0 level4_length = .skipL0110-level4 67 10000 ???? 68 10000 ???? 01 e0 level3_length = .skipL0109-level3 69 10000 ???? 70 10000 ???? 01 e0 level2_length = .skipL0108-level2 71 10000 ???? 72 10000 ???? 01 e0 level1_length = .skipL0107-level1 73 10000 ???? 74 10000 ???? 00 0f platformer_test_fontCS_color1 = $0f 75 10000 ???? 00 00 platformer_test_fontCS_color0 = $00 76 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color15 = 0 77 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color14 = 0 78 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color13 = 0 79 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color12 = 0 80 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color11 = 0 81 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color10 = 0 82 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color9 = 0 83 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color8 = 0 84 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color7 = 0 85 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color6 = $00 86 10000 ???? 00 68 platformer_test_sprite8_tallsprite_00_color5 = $68 87 10000 ???? 00 6c platformer_test_sprite8_tallsprite_00_color4 = $6c 88 10000 ???? 00 08 platformer_test_sprite8_tallsprite_00_color3 = $08 89 10000 ???? 00 0f platformer_test_sprite8_tallsprite_00_color2 = $0f 90 10000 ???? 00 04 platformer_test_sprite8_tallsprite_00_color1 = $04 91 10000 ???? 00 00 platformer_test_sprite8_tallsprite_00_color0 = $00 92 10000 ???? 00 00 platformer_test_sprite8_color15 = 0 93 10000 ???? 00 00 platformer_test_sprite8_color14 = 0 94 10000 ???? 00 00 platformer_test_sprite8_color13 = 0 95 10000 ???? 00 00 platformer_test_sprite8_color12 = 0 96 10000 ???? 00 00 platformer_test_sprite8_color11 = 0 97 10000 ???? 00 00 platformer_test_sprite8_color10 = 0 98 10000 ???? 00 00 platformer_test_sprite8_color9 = 0 99 10000 ???? 00 00 platformer_test_sprite8_color8 = 0 100 10000 ???? 00 00 platformer_test_sprite8_color7 = 0 101 10000 ???? 00 00 platformer_test_sprite8_color6 = $00 102 10000 ???? 00 68 platformer_test_sprite8_color5 = $68 103 10000 ???? 00 6c platformer_test_sprite8_color4 = $6c 104 10000 ???? 00 08 platformer_test_sprite8_color3 = $08 105 10000 ???? 00 0f platformer_test_sprite8_color2 = $0f 106 10000 ???? 00 04 platformer_test_sprite8_color1 = $04 107 10000 ???? 00 00 platformer_test_sprite8_color0 = $00 108 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color15 = 0 109 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color14 = 0 110 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color13 = 0 111 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color12 = 0 112 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color11 = 0 113 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color10 = 0 114 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color9 = 0 115 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color8 = 0 116 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color7 = 0 117 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color6 = $00 118 10000 ???? 00 68 platformer_test_sprite7_tallsprite_00_color5 = $68 119 10000 ???? 00 0f platformer_test_sprite7_tallsprite_00_color4 = $0f 120 10000 ???? 00 6c platformer_test_sprite7_tallsprite_00_color3 = $6c 121 10000 ???? 00 08 platformer_test_sprite7_tallsprite_00_color2 = $08 122 10000 ???? 00 04 platformer_test_sprite7_tallsprite_00_color1 = $04 123 10000 ???? 00 00 platformer_test_sprite7_tallsprite_00_color0 = $00 124 10000 ???? 00 00 platformer_test_sprite7_color15 = 0 125 10000 ???? 00 00 platformer_test_sprite7_color14 = 0 126 10000 ???? 00 00 platformer_test_sprite7_color13 = 0 127 10000 ???? 00 00 platformer_test_sprite7_color12 = 0 128 10000 ???? 00 00 platformer_test_sprite7_color11 = 0 129 10000 ???? 00 00 platformer_test_sprite7_color10 = 0 130 10000 ???? 00 00 platformer_test_sprite7_color9 = 0 131 10000 ???? 00 00 platformer_test_sprite7_color8 = 0 132 10000 ???? 00 00 platformer_test_sprite7_color7 = 0 133 10000 ???? 00 00 platformer_test_sprite7_color6 = $00 134 10000 ???? 00 68 platformer_test_sprite7_color5 = $68 135 10000 ???? 00 0f platformer_test_sprite7_color4 = $0f 136 10000 ???? 00 6c platformer_test_sprite7_color3 = $6c 137 10000 ???? 00 08 platformer_test_sprite7_color2 = $08 138 10000 ???? 00 04 platformer_test_sprite7_color1 = $04 139 10000 ???? 00 00 platformer_test_sprite7_color0 = $00 140 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color15 = 0 141 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color14 = 0 142 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color13 = 0 143 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color12 = 0 144 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color11 = 0 145 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color10 = 0 146 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color9 = 0 147 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color8 = 0 148 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color7 = 0 149 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color6 = $00 150 10000 ???? 00 68 platformer_test_sprite6_tallsprite_00_color5 = $68 151 10000 ???? 00 6c platformer_test_sprite6_tallsprite_00_color4 = $6c 152 10000 ???? 00 04 platformer_test_sprite6_tallsprite_00_color3 = $04 153 10000 ???? 00 0f platformer_test_sprite6_tallsprite_00_color2 = $0f 154 10000 ???? 00 08 platformer_test_sprite6_tallsprite_00_color1 = $08 155 10000 ???? 00 00 platformer_test_sprite6_tallsprite_00_color0 = $00 156 10000 ???? 00 00 platformer_test_sprite6_color15 = 0 157 10000 ???? 00 00 platformer_test_sprite6_color14 = 0 158 10000 ???? 00 00 platformer_test_sprite6_color13 = 0 159 10000 ???? 00 00 platformer_test_sprite6_color12 = 0 160 10000 ???? 00 00 platformer_test_sprite6_color11 = 0 161 10000 ???? 00 00 platformer_test_sprite6_color10 = 0 162 10000 ???? 00 00 platformer_test_sprite6_color9 = 0 163 10000 ???? 00 00 platformer_test_sprite6_color8 = 0 164 10000 ???? 00 00 platformer_test_sprite6_color7 = 0 165 10000 ???? 00 00 platformer_test_sprite6_color6 = $00 166 10000 ???? 00 68 platformer_test_sprite6_color5 = $68 167 10000 ???? 00 6c platformer_test_sprite6_color4 = $6c 168 10000 ???? 00 04 platformer_test_sprite6_color3 = $04 169 10000 ???? 00 0f platformer_test_sprite6_color2 = $0f 170 10000 ???? 00 08 platformer_test_sprite6_color1 = $08 171 10000 ???? 00 00 platformer_test_sprite6_color0 = $00 172 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color15 = 0 173 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color14 = 0 174 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color13 = 0 175 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color12 = 0 176 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color11 = 0 177 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color10 = 0 178 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color9 = 0 179 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color8 = 0 180 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color7 = 0 181 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color6 = $00 182 10000 ???? 00 68 platformer_test_sprite5_tallsprite_00_color5 = $68 183 10000 ???? 00 6c platformer_test_sprite5_tallsprite_00_color4 = $6c 184 10000 ???? 00 0f platformer_test_sprite5_tallsprite_00_color3 = $0f 185 10000 ???? 00 08 platformer_test_sprite5_tallsprite_00_color2 = $08 186 10000 ???? 00 04 platformer_test_sprite5_tallsprite_00_color1 = $04 187 10000 ???? 00 00 platformer_test_sprite5_tallsprite_00_color0 = $00 188 10000 ???? 00 00 platformer_test_sprite5_color15 = 0 189 10000 ???? 00 00 platformer_test_sprite5_color14 = 0 190 10000 ???? 00 00 platformer_test_sprite5_color13 = 0 191 10000 ???? 00 00 platformer_test_sprite5_color12 = 0 192 10000 ???? 00 00 platformer_test_sprite5_color11 = 0 193 10000 ???? 00 00 platformer_test_sprite5_color10 = 0 194 10000 ???? 00 00 platformer_test_sprite5_color9 = 0 195 10000 ???? 00 00 platformer_test_sprite5_color8 = 0 196 10000 ???? 00 00 platformer_test_sprite5_color7 = 0 197 10000 ???? 00 00 platformer_test_sprite5_color6 = $00 198 10000 ???? 00 68 platformer_test_sprite5_color5 = $68 199 10000 ???? 00 6c platformer_test_sprite5_color4 = $6c 200 10000 ???? 00 0f platformer_test_sprite5_color3 = $0f 201 10000 ???? 00 08 platformer_test_sprite5_color2 = $08 202 10000 ???? 00 04 platformer_test_sprite5_color1 = $04 203 10000 ???? 00 00 platformer_test_sprite5_color0 = $00 204 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color15 = 0 205 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color14 = 0 206 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color13 = 0 207 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color12 = 0 208 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color11 = 0 209 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color10 = 0 210 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color9 = 0 211 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color8 = 0 212 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color7 = 0 213 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color6 = $00 214 10000 ???? 00 68 platformer_test_sprite4_tallsprite_00_color5 = $68 215 10000 ???? 00 08 platformer_test_sprite4_tallsprite_00_color4 = $08 216 10000 ???? 00 0f platformer_test_sprite4_tallsprite_00_color3 = $0f 217 10000 ???? 00 6c platformer_test_sprite4_tallsprite_00_color2 = $6c 218 10000 ???? 00 04 platformer_test_sprite4_tallsprite_00_color1 = $04 219 10000 ???? 00 00 platformer_test_sprite4_tallsprite_00_color0 = $00 220 10000 ???? 00 00 platformer_test_sprite4_color15 = 0 221 10000 ???? 00 00 platformer_test_sprite4_color14 = 0 222 10000 ???? 00 00 platformer_test_sprite4_color13 = 0 223 10000 ???? 00 00 platformer_test_sprite4_color12 = 0 224 10000 ???? 00 00 platformer_test_sprite4_color11 = 0 225 10000 ???? 00 00 platformer_test_sprite4_color10 = 0 226 10000 ???? 00 00 platformer_test_sprite4_color9 = 0 227 10000 ???? 00 00 platformer_test_sprite4_color8 = 0 228 10000 ???? 00 00 platformer_test_sprite4_color7 = 0 229 10000 ???? 00 00 platformer_test_sprite4_color6 = $00 230 10000 ???? 00 68 platformer_test_sprite4_color5 = $68 231 10000 ???? 00 08 platformer_test_sprite4_color4 = $08 232 10000 ???? 00 0f platformer_test_sprite4_color3 = $0f 233 10000 ???? 00 6c platformer_test_sprite4_color2 = $6c 234 10000 ???? 00 04 platformer_test_sprite4_color1 = $04 235 10000 ???? 00 00 platformer_test_sprite4_color0 = $00 236 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color15 = 0 237 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color14 = 0 238 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color13 = 0 239 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color12 = 0 240 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color11 = 0 241 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color10 = 0 242 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color9 = 0 243 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color8 = 0 244 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color7 = 0 245 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color6 = $00 246 10000 ???? 00 68 platformer_test_sprite3_tallsprite_00_color5 = $68 247 10000 ???? 00 0f platformer_test_sprite3_tallsprite_00_color4 = $0f 248 10000 ???? 00 6c platformer_test_sprite3_tallsprite_00_color3 = $6c 249 10000 ???? 00 08 platformer_test_sprite3_tallsprite_00_color2 = $08 250 10000 ???? 00 04 platformer_test_sprite3_tallsprite_00_color1 = $04 251 10000 ???? 00 00 platformer_test_sprite3_tallsprite_00_color0 = $00 252 10000 ???? 00 00 platformer_test_sprite3_color15 = 0 253 10000 ???? 00 00 platformer_test_sprite3_color14 = 0 254 10000 ???? 00 00 platformer_test_sprite3_color13 = 0 255 10000 ???? 00 00 platformer_test_sprite3_color12 = 0 256 10000 ???? 00 00 platformer_test_sprite3_color11 = 0 257 10000 ???? 00 00 platformer_test_sprite3_color10 = 0 258 10000 ???? 00 00 platformer_test_sprite3_color9 = 0 259 10000 ???? 00 00 platformer_test_sprite3_color8 = 0 260 10000 ???? 00 00 platformer_test_sprite3_color7 = 0 261 10000 ???? 00 00 platformer_test_sprite3_color6 = $00 262 10000 ???? 00 68 platformer_test_sprite3_color5 = $68 263 10000 ???? 00 0f platformer_test_sprite3_color4 = $0f 264 10000 ???? 00 6c platformer_test_sprite3_color3 = $6c 265 10000 ???? 00 08 platformer_test_sprite3_color2 = $08 266 10000 ???? 00 04 platformer_test_sprite3_color1 = $04 267 10000 ???? 00 00 platformer_test_sprite3_color0 = $00 268 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color15 = 0 269 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color14 = 0 270 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color13 = 0 271 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color12 = 0 272 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color11 = 0 273 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color10 = 0 274 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color9 = 0 275 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color8 = 0 276 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color7 = 0 277 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color6 = $00 278 10000 ???? 00 68 platformer_test_sprite2_tallsprite_00_color5 = $68 279 10000 ???? 00 6c platformer_test_sprite2_tallsprite_00_color4 = $6c 280 10000 ???? 00 08 platformer_test_sprite2_tallsprite_00_color3 = $08 281 10000 ???? 00 04 platformer_test_sprite2_tallsprite_00_color2 = $04 282 10000 ???? 00 0f platformer_test_sprite2_tallsprite_00_color1 = $0f 283 10000 ???? 00 00 platformer_test_sprite2_tallsprite_00_color0 = $00 284 10000 ???? 00 00 platformer_test_sprite2_color15 = 0 285 10000 ???? 00 00 platformer_test_sprite2_color14 = 0 286 10000 ???? 00 00 platformer_test_sprite2_color13 = 0 287 10000 ???? 00 00 platformer_test_sprite2_color12 = 0 288 10000 ???? 00 00 platformer_test_sprite2_color11 = 0 289 10000 ???? 00 00 platformer_test_sprite2_color10 = 0 290 10000 ???? 00 00 platformer_test_sprite2_color9 = 0 291 10000 ???? 00 00 platformer_test_sprite2_color8 = 0 292 10000 ???? 00 00 platformer_test_sprite2_color7 = 0 293 10000 ???? 00 00 platformer_test_sprite2_color6 = $00 294 10000 ???? 00 68 platformer_test_sprite2_color5 = $68 295 10000 ???? 00 6c platformer_test_sprite2_color4 = $6c 296 10000 ???? 00 08 platformer_test_sprite2_color3 = $08 297 10000 ???? 00 04 platformer_test_sprite2_color2 = $04 298 10000 ???? 00 0f platformer_test_sprite2_color1 = $0f 299 10000 ???? 00 00 platformer_test_sprite2_color0 = $00 300 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color15 = 0 301 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color14 = 0 302 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color13 = 0 303 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color12 = 0 304 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color11 = 0 305 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color10 = 0 306 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color9 = 0 307 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color8 = 0 308 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color7 = 0 309 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color6 = $00 310 10000 ???? 00 68 platformer_test_sprite1_tallsprite_00_color5 = $68 311 10000 ???? 00 6c platformer_test_sprite1_tallsprite_00_color4 = $6c 312 10000 ???? 00 04 platformer_test_sprite1_tallsprite_00_color3 = $04 313 10000 ???? 00 08 platformer_test_sprite1_tallsprite_00_color2 = $08 314 10000 ???? 00 0f platformer_test_sprite1_tallsprite_00_color1 = $0f 315 10000 ???? 00 00 platformer_test_sprite1_tallsprite_00_color0 = $00 316 10000 ???? 00 00 platformer_test_sprite1_color15 = 0 317 10000 ???? 00 00 platformer_test_sprite1_color14 = 0 318 10000 ???? 00 00 platformer_test_sprite1_color13 = 0 319 10000 ???? 00 00 platformer_test_sprite1_color12 = 0 320 10000 ???? 00 00 platformer_test_sprite1_color11 = 0 321 10000 ???? 00 00 platformer_test_sprite1_color10 = 0 322 10000 ???? 00 00 platformer_test_sprite1_color9 = 0 323 10000 ???? 00 00 platformer_test_sprite1_color8 = 0 324 10000 ???? 00 00 platformer_test_sprite1_color7 = 0 325 10000 ???? 00 00 platformer_test_sprite1_color6 = $00 326 10000 ???? 00 68 platformer_test_sprite1_color5 = $68 327 10000 ???? 00 6c platformer_test_sprite1_color4 = $6c 328 10000 ???? 00 04 platformer_test_sprite1_color3 = $04 329 10000 ???? 00 08 platformer_test_sprite1_color2 = $08 330 10000 ???? 00 0f platformer_test_sprite1_color1 = $0f 331 10000 ???? 00 00 platformer_test_sprite1_color0 = $00 332 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color15 = 0 333 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color14 = 0 334 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color13 = 0 335 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color12 = 0 336 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color11 = 0 337 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color10 = 0 338 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color9 = 0 339 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color8 = 0 340 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color7 = 0 341 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color6 = $00 342 10000 ???? 00 68 platformer_test_sprite0_tallsprite_00_color5 = $68 343 10000 ???? 00 6c platformer_test_sprite0_tallsprite_00_color4 = $6c 344 10000 ???? 00 04 platformer_test_sprite0_tallsprite_00_color3 = $04 345 10000 ???? 00 08 platformer_test_sprite0_tallsprite_00_color2 = $08 346 10000 ???? 00 0f platformer_test_sprite0_tallsprite_00_color1 = $0f 347 10000 ???? 00 00 platformer_test_sprite0_tallsprite_00_color0 = $00 348 10000 ???? 00 00 platformer_test_sprite0_color15 = 0 349 10000 ???? 00 00 platformer_test_sprite0_color14 = 0 350 10000 ???? 00 00 platformer_test_sprite0_color13 = 0 351 10000 ???? 00 00 platformer_test_sprite0_color12 = 0 352 10000 ???? 00 00 platformer_test_sprite0_color11 = 0 353 10000 ???? 00 00 platformer_test_sprite0_color10 = 0 354 10000 ???? 00 00 platformer_test_sprite0_color9 = 0 355 10000 ???? 00 00 platformer_test_sprite0_color8 = 0 356 10000 ???? 00 00 platformer_test_sprite0_color7 = 0 357 10000 ???? 00 00 platformer_test_sprite0_color6 = $00 358 10000 ???? 00 68 platformer_test_sprite0_color5 = $68 359 10000 ???? 00 6c platformer_test_sprite0_color4 = $6c 360 10000 ???? 00 04 platformer_test_sprite0_color3 = $04 361 10000 ???? 00 08 platformer_test_sprite0_color2 = $08 362 10000 ???? 00 0f platformer_test_sprite0_color1 = $0f 363 10000 ???? 00 00 platformer_test_sprite0_color0 = $00 364 10000 ???? 00 00 platformer_test_tiles_ramchar_tallsprite_00_color3 = $00 365 10000 ???? 00 08 platformer_test_tiles_ramchar_tallsprite_00_color2 = $08 366 10000 ???? 00 04 platformer_test_tiles_ramchar_tallsprite_00_color1 = $04 367 10000 ???? 00 00 platformer_test_tiles_ramchar_tallsprite_00_color0 = $00 368 10000 ???? 00 00 platformer_test_tiles_ramchar_color3 = $00 369 10000 ???? 00 08 platformer_test_tiles_ramchar_color2 = $08 370 10000 ???? 00 04 platformer_test_tiles_ramchar_color1 = $04 371 10000 ???? 00 00 platformer_test_tiles_ramchar_color0 = $00 372 10000 ???? 23 10 vSpeed = $2310 373 10000 ???? 374 10000 ???? 23 00 hSpeed = $2300 375 10000 ???? 376 10000 ???? 22 00 screendata = $2200 377 10000 ???? 378 10000 ???? 01 50 level = var16 379 10000 ???? 380 10000 ???? 01 4f pTemp2 = var15 381 10000 ???? 382 10000 ???? 01 4e pTemp1 = var14 383 10000 ???? 384 10000 ???? 01 4d gen_frame = var13 385 10000 ???? 386 10000 ???? 01 4c playerChar = var12 387 10000 ???? 388 10000 ???? 01 4b player_aniframe = var11 389 10000 ???? 390 10000 ???? 01 4a player_dir = var10 391 10000 ???? 392 10000 ???? 01 49 player_moving = var9 393 10000 ???? 394 10000 ???? 01 48 button2_Debounce = var8 395 10000 ???? 396 10000 ???? 01 47 button1_Debounce = var7 397 10000 ???? 398 10000 ???? 01 46 joyposright = var6 399 10000 ???? 400 10000 ???? 01 45 joyposleft = var5 401 10000 ???? 402 10000 ???? 01 44 joyposup = var4 403 10000 ???? 404 10000 ???? 01 43 joyposdown = var3 405 10000 ???? 406 10000 ???? 01 42 player_y = var2 407 10000 ???? 408 10000 ???? 01 41 player_x = var1 409 10000 ???? 410 10000 ???? 01 40 frameCounter = var0 411 10000 ???? 412 10000 ???? 00 01 collisionwrap = 1 413 10000 ???? 00 01 NTSC = 1 414 10000 ???? 00 c0 SCREENHEIGHT = 192 415 10000 ???? 00 01 CHECKOVERWRITE = 1 416 10000 ???? 00 08 ZONEHEIGHT = 8 417 10000 ???? 00 01 ROM48K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\platformer_demos\template\platformer_demo_v01.78b.asm 555 10000 ???? 556 10000 ???? ; A BEAD header gets automatically incorportated into the ROM header. 557 10000 ???? ; For more BEAD executable info, check out the spec... 558 10000 ???? ; http://7800.8bitdev.org/index.php/The_Atari_7800_BEAD_Execuable_Specification 559 10000 ???? 560 10000 ???? 00 01 GAMEDESCRIPTIONSET = 1 561 10000 ???? 4e 61 6d 65 GAMEDESCRIPTION = "Test Name" 562 10000 ???? 563 10000 ???? 00 40 BDHSC = %01000000 564 10000 ???? 00 20 BDYM = %00100000 565 10000 ???? 00 10 BDPOKEY = %00010000 566 10000 ???? 00 08 BDROF = %00001000 567 10000 ???? 00 00 BD16K = %00000000 568 10000 ???? 00 01 BD32K = %00000001 569 10000 ???? 00 02 BD48K = %00000010 570 10000 ???? 00 05 BD1800 = %00000101 571 10000 ???? 00 06 BD4000 = %00000110 572 10000 ???? 573 10000 ???? - ifconst ROM32K 574 10000 ???? -BEADHEADER = 1 575 10000 ???? endif 576 10000 ???? ifconst ROM48K 577 10000 ???? 00 01 BEADHEADER = 1 578 10000 ???? endif 579 10000 ???? 580 10000 ???? ifconst BEADHEADER 581 10000 ???? BEADHARDWARE SET 0 582 10000 ???? - ifconst ROM16K 583 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD16K) 584 10000 ???? endif 585 10000 ???? - ifconst ROM32K 586 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD32K) 587 10000 ???? endif 588 10000 ???? ifconst ROM48K 589 10000 ???? BEADHARDWARE SET (BEADHARDWARE|BD48K) 590 10000 ???? endif 591 10000 ???? - ifconst pokeysupport 592 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDPOKEY) 593 10000 ???? endif 594 10000 ???? - ifconst HSSUPPORT 595 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDHSC) 596 10000 ???? endif 597 10000 ???? endif 598 10000 ???? 599 10000 ???? ;start address of cart... 600 10000 ???? ifconst ROM48K 601 4000 ORG $4000,0 602 4000 ifconst BEADHEADER 603 4000 be ad 02 .byte.b $BE,$AD,BEADHARDWARE 604 4003 ifconst GAMEDESCRIPTIONSET 605 4003 18 CLC 606 4004 90 0a BCC _SKIPDESCRIPTION 607 4006 54 65 73 74* .byte.b GAMEDESCRIPTION,0 608 4010 _SKIPDESCRIPTION 609 4010 endif 610 4010 6c fc ff jmp ($FFFC) 611 4013 endif 612 4013 - else 613 4013 - ifconst bankswitchmode 614 4013 - ifconst ROMAT4K 615 4013 - ORG $4000,0 616 4013 - RORG $4000 617 4013 - else 618 4013 - ORG $8000,0 619 4013 - RORG $8000 620 4013 - endif 621 4013 - else ; not bankswitchmode 622 4013 - ifconst ROM16K 623 4013 - ORG $C000,0 624 4013 - ifconst BEADHEADER 625 4013 - .byte $BE,$AD,BEADHARDWARE 626 4013 - ifconst GAMEDESCRIPTION 627 4013 - CLC 628 4013 - BCC _SKIPDESCRIPTION 629 4013 - .byte GAMEDESCRIPTION,0 630 4013 -_SKIPDESCRIPTION 631 4013 - endif 632 4013 - jmp ($FFFC) 633 4013 - endif 634 4013 - else 635 4013 - ifconst ROM8K 636 4013 - ORG $E000,0 637 4013 - else 638 4013 - ORG $8000,0 639 4013 - ifconst BEADHEADER 640 4013 - .byte $BE,$AD,BEADHARDWARE 641 4013 - ifconst GAMEDESCRIPTION 642 4013 - CLC 643 4013 - BCC _SKIPDESCRIPTION 644 4013 - .byte GAMEDESCRIPTION,0 645 4013 -_SKIPDESCRIPTION 646 4013 - endif 647 4013 - jmp ($FFFC) 648 4013 - endif 649 4013 - endif 650 4013 - endif 651 4013 - endif 652 4013 endif 653 4013 654 4013 ;7800basic v0.18 Mar 14 2021 14:27:24 655 4013 SPACEOVERFLOW SET 0 656 4013 game 657 4013 . 658 4013 ;; 659 4013 660 4013 . 661 4013 ;; 662 4013 663 4013 .L00 ;; set romsize 48k 664 4013 665 4013 .L01 ;; set zoneheight 8 666 4013 667 4013 .L02 ;; set zoneprotection on 668 4013 669 4013 .L03 ;; set basepath gfx 670 4013 671 4013 .L04 ;; set tallsprite on 672 4013 673 4013 .L05 ;; set pauseroutine on 674 4013 675 4013 .L06 ;; set screenheight 192 676 4013 677 4013 .L07 ;; set tv ntsc 678 4013 679 4013 .L08 ;; set collisionwrap on 680 4013 681 4013 .L09 ;; set doublewide off 682 4013 683 4013 .L010 ;; displaymode 160A 684 4013 685 4013 a9 40 lda #%01000000 ;Enable DMA, mode=160x2/160x4 686 4015 85 3c sta CTRL 687 4017 688 4017 8d 07 21 sta sCTRL 689 401a 690 401a . 691 401a ;; 692 401a 693 401a .L011 ;; dim frameCounter = var0 694 401a 695 401a .L012 ;; dim player_x = var1 696 401a 697 401a .L013 ;; dim player_y = var2 698 401a 699 401a .L014 ;; dim joyposdown = var3 700 401a 701 401a .L015 ;; dim joyposup = var4 702 401a 703 401a .L016 ;; dim joyposleft = var5 704 401a 705 401a .L017 ;; dim joyposright = var6 706 401a 707 401a .L018 ;; dim button1_Debounce = var7 708 401a 709 401a .L019 ;; dim button2_Debounce = var8 710 401a 711 401a .L020 ;; dim player_moving = var9 712 401a 713 401a .L021 ;; dim player_dir = var10 714 401a 715 401a .L022 ;; dim player_aniframe = var11 716 401a 717 401a .L023 ;; dim playerChar = var12 718 401a 719 401a .L024 ;; dim gen_frame = var13 720 401a 721 401a .L025 ;; dim pTemp1 = var14 722 401a 723 401a .L026 ;; dim pTemp2 = var15 724 401a 725 401a .L027 ;; dim level = var16 726 401a 727 401a .L028 ;; dim screendata = $2200 728 401a 729 401a .L029 ;; dim hSpeed = $2300 730 401a 731 401a .L030 ;; dim vSpeed = $2310 732 401a 733 401a . 734 401a ;; 735 401a 736 401a . 737 401a ;; 738 401a 739 401a .L031 ;; BACKGRND = $00 740 401a 741 401a a9 00 LDA #$00 742 401c 85 20 STA BACKGRND 743 401e .L032 ;; P0C1 = $57 : P0C2 = $0F : P0C3 = $6C 744 401e 745 401e a9 57 LDA #$57 746 4020 85 21 STA P0C1 747 4022 a9 0f LDA #$0F 748 4024 85 22 STA P0C2 749 4026 a9 6c LDA #$6C 750 4028 85 23 STA P0C3 751 402a .L033 ;; P1C1 = $90 : P1C2 = $AF : P1C3 = $96 752 402a 753 402a a9 90 LDA #$90 754 402c 85 25 STA P1C1 755 402e a9 af LDA #$AF 756 4030 85 26 STA P1C2 757 4032 a9 96 LDA #$96 758 4034 85 27 STA P1C3 759 4036 .L034 ;; P2C1 = $10 : P2C2 = $1C : P2C3 = $15 760 4036 761 4036 a9 10 LDA #$10 762 4038 85 29 STA P2C1 763 403a a9 1c LDA #$1C 764 403c 85 2a STA P2C2 765 403e a9 15 LDA #$15 766 4040 85 2b STA P2C3 767 4042 .L035 ;; P3C1 = $01 : P3C2 = $09 : P3C3 = $05 768 4042 769 4042 a9 01 LDA #$01 770 4044 85 2d STA P3C1 771 4046 a9 09 LDA #$09 772 4048 85 2e STA P3C2 773 404a a9 05 LDA #$05 774 404c 85 2f STA P3C3 775 404e . 776 404e ;; 777 404e 778 404e . 779 404e ;; 780 404e 781 404e . 782 404e ;; 783 404e 784 404e . 785 404e ;; 786 404e 787 404e . 788 404e ;; 789 404e 790 404e .init 791 404e ;; init 792 404e 793 404e .L036 ;; frameCounter = 0 794 404e 795 404e a9 00 LDA #0 796 4050 8d 40 01 STA frameCounter 797 4053 .L037 ;; player_x = 0 : player_y = 0 798 4053 799 4053 a9 00 LDA #0 800 4055 8d 41 01 STA player_x 801 4058 8d 42 01 STA player_y 802 405b .L038 ;; joyposdown = 0 : joyposup = 0 : joyposleft = 0 : joyposright = 0 803 405b 804 405b a9 00 LDA #0 805 405d 8d 43 01 STA joyposdown 806 4060 8d 44 01 STA joyposup 807 4063 8d 45 01 STA joyposleft 808 4066 8d 46 01 STA joyposright 809 4069 .L039 ;; button1_Debounce = 0 : button2_Debounce = 0 810 4069 811 4069 a9 00 LDA #0 812 406b 8d 47 01 STA button1_Debounce 813 406e 8d 48 01 STA button2_Debounce 814 4071 .L040 ;; player_moving = 0 : player_dir = 0 : player_aniframe = 0 : playerChar = 0 815 4071 816 4071 a9 00 LDA #0 817 4073 8d 49 01 STA player_moving 818 4076 8d 4a 01 STA player_dir 819 4079 8d 4b 01 STA player_aniframe 820 407c 8d 4c 01 STA playerChar 821 407f .L041 ;; gen_frame = 0 : hSpeed = 0 : vSpeed = 0 822 407f 823 407f a9 00 LDA #0 824 4081 8d 4d 01 STA gen_frame 825 4084 8d 00 23 STA hSpeed 826 4087 8d 10 23 STA vSpeed 827 408a . 828 408a ;; 829 408a 830 408a . 831 408a ;; 832 408a 833 408a .L042 ;; incgraphic platformer_test_tiles_ramchar.png 160A 3 834 408a 835 408a .L043 ;; incgraphic platformer_test_sprite0.png 160B 0 836 408a 837 408a .L044 ;; incgraphic platformer_test_sprite1.png 160B 0 838 408a 839 408a .L045 ;; incgraphic platformer_test_sprite2.png 160B 0 840 408a 841 408a .L046 ;; incgraphic platformer_test_sprite3.png 160B 0 842 408a 843 408a .L047 ;; incgraphic platformer_test_sprite4.png 160B 0 844 408a 845 408a .L048 ;; incgraphic platformer_test_sprite5.png 160B 0 846 408a 847 408a .L049 ;; incgraphic platformer_test_sprite6.png 160B 0 848 408a 849 408a .L050 ;; incgraphic platformer_test_sprite7.png 160B 0 850 408a 851 408a .L051 ;; incgraphic platformer_test_sprite8.png 160B 0 852 408a 853 408a .L052 ;; incgraphic platformer_test_fontCS.png 160A 0 854 408a 855 408a . 856 408a ;; 857 408a 858 408a .L053 ;; gosub titlescreen 859 408a 860 408a 20 8b 41 jsr .titlescreen 861 408d 862 408d .L054 ;; gosub initialise_gamescreen 863 408d 864 408d 20 c8 42 jsr .initialise_gamescreen 865 4090 866 4090 .main 867 4090 ;; main 868 4090 869 4090 .L055 ;; restorescreen 870 4090 871 4090 20 91 f0 jsr restorescreen 872 4093 .L056 ;; if switchreset then reboot 873 4093 874 4093 20 09 f4 jsr checkresetswitch 875 4096 d0 03 BNE .skipL056 876 4098 .condpart0 877 4098 4c f6 f4 JMP START 878 409b .skipL056 879 409b .L057 ;; frameCounter = frameCounter + 1 880 409b 881 409b ad 40 01 LDA frameCounter 882 409e 18 CLC 883 409f 69 01 ADC #1 884 40a1 8d 40 01 STA frameCounter 885 40a4 .L058 ;; if frameCounter > 10 then frameCounter = 0 886 40a4 887 40a4 a9 0a LDA #10 888 40a6 cd 40 01 CMP frameCounter 889 40a9 b0 05 BCS .skipL058 890 40ab .condpart1 891 40ab a9 00 LDA #0 892 40ad 8d 40 01 STA frameCounter 893 40b0 .skipL058 894 40b0 .L059 ;; drawscreen 895 40b0 896 40b0 20 b3 f0 jsr drawscreen 897 40b3 . 898 40b3 ;; 899 40b3 900 40b3 .L060 ;; gen_frame = gen_frame + 1 901 40b3 902 40b3 ad 4d 01 LDA gen_frame 903 40b6 18 CLC 904 40b7 69 01 ADC #1 905 40b9 8d 4d 01 STA gen_frame 906 40bc .L061 ;; if ( gen_frame & ) = 0 then player_aniframe = ( player_aniframe + 1 ) & 3 907 40bc 908 40bc ; complex condition detected 909 40bc ; complex statement detected 910 40bc 2d 4d 01 AND gen_frame 911 40bf c9 00 CMP #0 912 40c1 d0 0b BNE .skipL061 913 40c3 .condpart2 914 40c3 ; complex statement detected 915 40c3 ad 4b 01 LDA player_aniframe 916 40c6 18 CLC 917 40c7 69 01 ADC #1 918 40c9 29 03 AND #3 919 40cb 8d 4b 01 STA player_aniframe 920 40ce .skipL061 921 40ce .L062 ;; if ( gen_frame & 1 ) then joydone 922 40ce 923 40ce ; complex statement detected 924 40ce ad 4d 01 LDA gen_frame 925 40d1 29 01 AND #1 926 40d3 if ((* - .joydone) < 127) && ((* - .joydone) > -128) 927 40d3 d0 31 BNE .joydone 928 40d5 - else 929 40d5 - beq .0skipjoydone 930 40d5 - jmp .joydone 931 40d5 -.0skipjoydone 932 40d5 endif 933 40d5 .skipL062 934 40d5 .condpart3 935 40d5 .skipL062 936 40d5 .L063 ;; if joy0left then player_dir = 0 : player_x = player_x - 1 : goto joydone 937 40d5 938 40d5 2c 80 02 bit SWCHA 939 40d8 70 11 BVS .skipL063 940 40da .condpart4 941 40da a9 00 LDA #0 942 40dc 8d 4a 01 STA player_dir 943 40df ad 41 01 LDA player_x 944 40e2 38 SEC 945 40e3 e9 01 SBC #1 946 40e5 8d 41 01 STA player_x 947 40e8 4c 06 41 jmp .joydone 948 40eb 949 40eb .skipL063 950 40eb .L064 ;; if joy0right then player_dir = 1 : player_x = player_x + 1 : goto joydone 951 40eb 952 40eb 2c 80 02 bit SWCHA 953 40ee 30 11 BMI .skipL064 954 40f0 .condpart5 955 40f0 a9 01 LDA #1 956 40f2 8d 4a 01 STA player_dir 957 40f5 ad 41 01 LDA player_x 958 40f8 18 CLC 959 40f9 69 01 ADC #1 960 40fb 8d 41 01 STA player_x 961 40fe 4c 06 41 jmp .joydone 962 4101 963 4101 .skipL064 964 4101 .L065 ;; player_aniframe = 0 965 4101 966 4101 a9 00 LDA #0 967 4103 8d 4b 01 STA player_aniframe 968 4106 .joydone 969 4106 ;; joydone 970 4106 971 4106 .L066 ;; pTemp1 = ( player_x + 4 ) / 8 972 4106 973 4106 ; complex statement detected 974 4106 ad 41 01 LDA player_x 975 4109 18 CLC 976 410a 69 04 ADC #4 977 410c 4a lsr 978 410d 4a lsr 979 410e 4a lsr 980 410f 8d 4e 01 STA pTemp1 981 4112 .L067 ;; pTemp2 = player_y / 8 982 4112 983 4112 ad 42 01 LDA player_y 984 4115 4a lsr 985 4116 4a lsr 986 4117 4a lsr 987 4118 8d 4f 01 STA pTemp2 988 411b .L068 ;; pTemp2 = pTemp2 + 1 989 411b 990 411b ad 4f 01 LDA pTemp2 991 411e 18 CLC 992 411f 69 01 ADC #1 993 4121 8d 4f 01 STA pTemp2 994 4124 . 995 4124 ;; 996 4124 997 4124 .L069 ;; if pTemp1 > 19 || pTemp2 > 23 then goto falling 998 4124 999 4124 a9 13 LDA #19 1000 4126 cd 4e 01 CMP pTemp1 1001 4129 b0 03 BCS .skipL069 1002 412b .condpart6 1003 412b 4c 35 41 jmp .condpart7 1004 412e .skipL069 1005 412e a9 17 LDA #23 1006 4130 cd 4f 01 CMP pTemp2 1007 4133 b0 03 BCS .skip0OR 1008 4135 .condpart7 1009 4135 4c 79 41 jmp .falling 1010 4138 1011 4138 .skip0OR 1012 4138 . 1013 4138 ;; 1014 4138 1015 4138 .L070 ;; playerChar = peekchar ( screendata , pTemp1 , pTemp2 , 20 , 24 ) 1016 4138 1017 4138 ac 4f 01 ldy pTemp2 1018 413b b9 aa e7 lda screendata_mult_lo,y 1019 413e 85 42 sta temp1 1020 4140 b9 c2 e7 lda screendata_mult_hi,y 1021 4143 85 43 sta temp2 1022 4145 ac 4e 01 ldy pTemp1 1023 4148 b1 42 lda (temp1),y 1024 414a 8d 4c 01 STA playerChar 1025 414d . 1026 414d ;; 1027 414d 1028 414d .player_jump 1029 414d ;; player_jump 1030 414d 1031 414d .L071 ;; if joy0fire then player_y = player_y - 1 1032 414d 1033 414d 2c 02 21 bit sINPT1 1034 4150 10 09 BPL .skipL071 1035 4152 .condpart8 1036 4152 ad 42 01 LDA player_y 1037 4155 38 SEC 1038 4156 e9 01 SBC #1 1039 4158 8d 42 01 STA player_y 1040 415b .skipL071 1041 415b .L072 ;; if !joy0fire then button1_Debounce = 0 : button2_Debounce = 0 1042 415b 1043 415b 2c 02 21 bit sINPT1 1044 415e 30 08 BMI .skipL072 1045 4160 .condpart9 1046 4160 a9 00 LDA #0 1047 4162 8d 47 01 STA button1_Debounce 1048 4165 8d 48 01 STA button2_Debounce 1049 4168 .skipL072 1050 4168 .L073 ;; if button1_Debounce = 0 && button2_Debounce = 0 then goto falling 1051 4168 1052 4168 ad 47 01 LDA button1_Debounce 1053 416b c9 00 CMP #0 1054 416d d0 0a BNE .skipL073 1055 416f .condpart10 1056 416f ad 48 01 LDA button2_Debounce 1057 4172 c9 00 CMP #0 1058 4174 d0 03 BNE .skip10then 1059 4176 .condpart11 1060 4176 4c 79 41 jmp .falling 1061 4179 1062 4179 .skip10then 1063 4179 .skipL073 1064 4179 . 1065 4179 ;; 1066 4179 1067 4179 .falling 1068 4179 ;; falling 1069 4179 1070 4179 .L074 ;; player_y = player_y + 1 1071 4179 1072 4179 ad 42 01 LDA player_y 1073 417c 18 CLC 1074 417d 69 01 ADC #1 1075 417f 8d 42 01 STA player_y 1076 4182 .done_falling 1077 4182 ;; done_falling 1078 4182 1079 4182 . 1080 4182 ;; 1081 4182 1082 4182 .L075 ;; gosub draw_sprites 1083 4182 1084 4182 20 44 42 jsr .draw_sprites 1085 4185 1086 4185 .L076 ;; gosub load_level 1087 4185 1088 4185 20 cf 42 jsr .load_level 1089 4188 1090 4188 .L077 ;; goto main 1091 4188 1092 4188 4c 90 40 jmp .main 1093 418b 1094 418b . 1095 418b ;; 1096 418b 1097 418b .titlescreen 1098 418b ;; titlescreen 1099 418b 1100 418b .L078 ;; characterset platformer_test_fontCS 1101 418b 1102 418b a9 e0 lda #>platformer_test_fontCS 1103 418d 8d 0b 21 sta sCHARBASE 1104 4190 1105 4190 85 34 sta CHARBASE 1106 4192 a9 60 lda #(platformer_test_fontCS_mode | %01100000) 1107 4194 8d 06 21 sta charactermode 1108 4197 1109 4197 .L079 ;; alphachars '0123456789 .,?!:;`abcdefghijklmnopqrstuvwxyz@#$%^&*()/-_=+' 1110 4197 1111 4197 .L080 ;; plotchars 'platformer^demo^by' 0 38 2 1112 4197 1113 4197 4c ac 41 JMP skipalphadata0 1114 419a alphadata0 1115 419a 91 .byte.b (alphadata0 1138 41b2 85 43 sta temp2 1139 41b4 1140 41b4 a9 0e lda #14 ; width in two's complement 1141 41b6 09 00 ora #0 ; palette left shifted 5 bits 1142 41b8 85 44 sta temp3 1143 41ba a9 26 lda #38 1144 41bc 85 45 sta temp4 1145 41be 1146 41be a9 02 lda #2 1147 41c0 1148 41c0 85 46 sta temp5 1149 41c2 1150 41c2 20 4c f3 jsr plotcharacters 1151 41c5 .L081 ;; plotchars 'shane^skekel.' 0 48 4 1152 41c5 1153 41c5 4c d5 41 JMP skipalphadata1 1154 41c8 alphadata1 1155 41c8 94 .byte.b (alphadata1 1173 41db 85 43 sta temp2 1174 41dd 1175 41dd a9 13 lda #19 ; width in two's complement 1176 41df 09 00 ora #0 ; palette left shifted 5 bits 1177 41e1 85 44 sta temp3 1178 41e3 a9 30 lda #48 1179 41e5 85 45 sta temp4 1180 41e7 1181 41e7 a9 04 lda #4 1182 41e9 1183 41e9 85 46 sta temp5 1184 41eb 1185 41eb 20 4c f3 jsr plotcharacters 1186 41ee .L082 ;; plotchars 'press^fire!' 1 56 8 1187 41ee 1188 41ee 4c fc 41 JMP skipalphadata2 1189 41f1 alphadata2 1190 41f1 91 .byte.b (alphadata2 1206 4202 85 43 sta temp2 1207 4204 1208 4204 a9 15 lda #21 ; width in two's complement 1209 4206 09 20 ora #32 ; palette left shifted 5 bits 1210 4208 85 44 sta temp3 1211 420a a9 38 lda #56 1212 420c 85 45 sta temp4 1213 420e 1214 420e a9 08 lda #8 1215 4210 1216 4210 85 46 sta temp5 1217 4212 1218 4212 20 4c f3 jsr plotcharacters 1219 4215 .L083 ;; savescreen 1220 4215 1221 4215 20 a3 f0 jsr savescreen 1222 4218 .L084 ;; drawscreen 1223 4218 1224 4218 20 b3 f0 jsr drawscreen 1225 421b . 1226 421b ;; 1227 421b 1228 421b .titlescreenloop 1229 421b ;; titlescreenloop 1230 421b 1231 421b .L085 ;; restorescreen 1232 421b 1233 421b 20 91 f0 jsr restorescreen 1234 421e .L086 ;; if switchreset then reboot 1235 421e 1236 421e 20 09 f4 jsr checkresetswitch 1237 4221 d0 03 BNE .skipL086 1238 4223 .condpart12 1239 4223 4c f6 f4 JMP START 1240 4226 .skipL086 1241 4226 .L087 ;; if joy0fire then clearscreen : savescreen : goto main 1242 4226 1243 4226 2c 02 21 bit sINPT1 1244 4229 10 09 BPL .skipL087 1245 422b .condpart13 1246 422b 20 7f f0 jsr clearscreen 1247 422e 20 a3 f0 jsr savescreen 1248 4231 4c 90 40 jmp .main 1249 4234 1250 4234 .skipL087 1251 4234 .L088 ;; if !joy0fire then button1_Debounce = 0 : button2_Debounce = 0 1252 4234 1253 4234 2c 02 21 bit sINPT1 1254 4237 30 08 BMI .skipL088 1255 4239 .condpart14 1256 4239 a9 00 LDA #0 1257 423b 8d 47 01 STA button1_Debounce 1258 423e 8d 48 01 STA button2_Debounce 1259 4241 .skipL088 1260 4241 .L089 ;; goto titlescreenloop 1261 4241 1262 4241 4c 1b 42 jmp .titlescreenloop 1263 4244 1264 4244 . 1265 4244 ;; 1266 4244 1267 4244 .draw_sprites 1268 4244 ;; draw_sprites 1269 4244 1270 4244 .L090 ;; pTemp1 = player_dir + player_aniframe 1271 4244 1272 4244 ad 4a 01 LDA player_dir 1273 4247 18 CLC 1274 4248 6d 4b 01 ADC player_aniframe 1275 424b 8d 4e 01 STA pTemp1 1276 424e .L091 ;; plotsprite platformer_test_sprite0 0 player_x player_y pTemp1 1277 424e 1278 424e a9 28 lda #platformer_test_sprite0 1290 425f 85 43 sta temp2 1291 4261 1292 4261 a9 1c lda #(0|platformer_test_sprite0_width_twoscompliment) 1293 4263 85 44 sta temp3 1294 4265 1295 4265 ad 41 01 lda player_x 1296 4268 85 45 sta temp4 1297 426a 1298 426a ad 42 01 lda player_y 1299 426d 85 46 sta temp5 1300 426f 1301 426f a9 c0 lda #(platformer_test_sprite0_mode|%01000000) 1302 4271 85 47 sta temp6 1303 4273 1304 4273 20 93 f2 jsr plotsprite 1305 4276 ; +tall sprite replot 1306 4276 18 clc 1307 4277 a5 42 lda temp1 1308 4279 69 04 adc #platformer_test_sprite0_width 1309 427b 85 42 sta temp1 1310 427d a5 46 lda temp5 1311 427f 69 08 adc #WZONEHEIGHT 1312 4281 85 46 sta temp5 1313 4283 20 93 f2 jsr plotsprite 1314 4286 .L092 ;; pTemp2 = player_y - 8 1315 4286 1316 4286 ad 42 01 LDA player_y 1317 4289 38 SEC 1318 428a e9 08 SBC #8 1319 428c 8d 4f 01 STA pTemp2 1320 428f .L093 ;; plotsprite platformer_test_sprite0 0 player_x pTemp2 pTemp1 1321 428f 1322 428f a9 28 lda #platformer_test_sprite0 1334 42a0 85 43 sta temp2 1335 42a2 1336 42a2 a9 1c lda #(0|platformer_test_sprite0_width_twoscompliment) 1337 42a4 85 44 sta temp3 1338 42a6 1339 42a6 ad 41 01 lda player_x 1340 42a9 85 45 sta temp4 1341 42ab 1342 42ab ad 4f 01 lda pTemp2 1343 42ae 85 46 sta temp5 1344 42b0 1345 42b0 a9 c0 lda #(platformer_test_sprite0_mode|%01000000) 1346 42b2 85 47 sta temp6 1347 42b4 1348 42b4 20 93 f2 jsr plotsprite 1349 42b7 ; +tall sprite replot 1350 42b7 18 clc 1351 42b8 a5 42 lda temp1 1352 42ba 69 04 adc #platformer_test_sprite0_width 1353 42bc 85 42 sta temp1 1354 42be a5 46 lda temp5 1355 42c0 69 08 adc #WZONEHEIGHT 1356 42c2 85 46 sta temp5 1357 42c4 20 93 f2 jsr plotsprite 1358 42c7 .L094 ;; return 1359 42c7 1360 42c7 60 RTS 1361 42c8 . 1362 42c8 ;; 1363 42c8 1364 42c8 .initialise_gamescreen 1365 42c8 ;; initialise_gamescreen 1366 42c8 1367 42c8 .L095 ;; clearscreen 1368 42c8 1369 42c8 20 7f f0 jsr clearscreen 1370 42cb . 1371 42cb ;; 1372 42cb 1373 42cb .L096 ;; savescreen 1374 42cb 1375 42cb 20 a3 f0 jsr savescreen 1376 42ce .L097 ;; return 1377 42ce 1378 42ce 60 RTS 1379 42cf . 1380 42cf ;; 1381 42cf 1382 42cf .load_level 1383 42cf ;; load_level 1384 42cf 1385 42cf .L098 ;; player_x = 40 1386 42cf 1387 42cf a9 28 LDA #40 1388 42d1 8d 41 01 STA player_x 1389 42d4 .L099 ;; player_y = 2 1390 42d4 1391 42d4 a9 02 LDA #2 1392 42d6 8d 42 01 STA player_y 1393 42d9 . 1394 42d9 ;; 1395 42d9 1396 42d9 . 1397 42d9 ;; 1398 42d9 1399 42d9 .L0100 ;; level = level & 3 1400 42d9 1401 42d9 ad 50 01 LDA level 1402 42dc 29 03 AND #3 1403 42de 8d 50 01 STA level 1404 42e1 .L0101 ;; if level = 0 then memcpy screendata level1 480 1405 42e1 1406 42e1 ad 50 01 LDA level 1407 42e4 c9 00 CMP #0 1408 42e6 d0 21 BNE .skipL0101 1409 42e8 .condpart15 1410 42e8 a0 00 ldy #0 1411 42ea memcpyloop5 1412 42ea b9 85 43 lda level1+0,y 1413 42ed 99 00 22 sta screendata+0,y 1414 42f0 88 dey 1415 42f1 d0 f7 bne memcpyloop5 1416 42f3 a0 e0 ldy #224 1417 42f5 memcpyloop6 1418 42f5 b9 84 44 lda level1-1+256,y 1419 42f8 99 ff 22 sta screendata-1+256,y 1420 42fb 88 dey 1421 42fc d0 f7 bne memcpyloop6 1422 42fe a0 e0 ldy #224 1423 4300 memcpyloop7 1424 4300 b9 84 43 lda level1-1,y 1425 4303 99 ff 21 sta screendata-1,y 1426 4306 88 dey 1427 4307 d0 f7 bne memcpyloop7 1428 4309 .skipL0101 1429 4309 .L0102 ;; if level = 1 then memcpy screendata level2 480 1430 4309 1431 4309 ad 50 01 LDA level 1432 430c c9 01 CMP #1 1433 430e d0 21 BNE .skipL0102 1434 4310 .condpart16 1435 4310 a0 00 ldy #0 1436 4312 memcpyloop8 1437 4312 b9 68 45 lda level2+0,y 1438 4315 99 00 22 sta screendata+0,y 1439 4318 88 dey 1440 4319 d0 f7 bne memcpyloop8 1441 431b a0 e0 ldy #224 1442 431d memcpyloop9 1443 431d b9 67 46 lda level2-1+256,y 1444 4320 99 ff 22 sta screendata-1+256,y 1445 4323 88 dey 1446 4324 d0 f7 bne memcpyloop9 1447 4326 a0 e0 ldy #224 1448 4328 memcpyloop10 1449 4328 b9 67 45 lda level2-1,y 1450 432b 99 ff 21 sta screendata-1,y 1451 432e 88 dey 1452 432f d0 f7 bne memcpyloop10 1453 4331 .skipL0102 1454 4331 .L0103 ;; if level = 2 then memcpy screendata level3 480 1455 4331 1456 4331 ad 50 01 LDA level 1457 4334 c9 02 CMP #2 1458 4336 d0 21 BNE .skipL0103 1459 4338 .condpart17 1460 4338 a0 00 ldy #0 1461 433a memcpyloop11 1462 433a b9 4b 47 lda level3+0,y 1463 433d 99 00 22 sta screendata+0,y 1464 4340 88 dey 1465 4341 d0 f7 bne memcpyloop11 1466 4343 a0 e0 ldy #224 1467 4345 memcpyloop12 1468 4345 b9 4a 48 lda level3-1+256,y 1469 4348 99 ff 22 sta screendata-1+256,y 1470 434b 88 dey 1471 434c d0 f7 bne memcpyloop12 1472 434e a0 e0 ldy #224 1473 4350 memcpyloop13 1474 4350 b9 4a 47 lda level3-1,y 1475 4353 99 ff 21 sta screendata-1,y 1476 4356 88 dey 1477 4357 d0 f7 bne memcpyloop13 1478 4359 .skipL0103 1479 4359 .L0104 ;; if level = 3 then memcpy screendata level4 480 1480 4359 1481 4359 ad 50 01 LDA level 1482 435c c9 03 CMP #3 1483 435e d0 21 BNE .skipL0104 1484 4360 .condpart18 1485 4360 a0 00 ldy #0 1486 4362 memcpyloop14 1487 4362 b9 2e 49 lda level4+0,y 1488 4365 99 00 22 sta screendata+0,y 1489 4368 88 dey 1490 4369 d0 f7 bne memcpyloop14 1491 436b a0 e0 ldy #224 1492 436d memcpyloop15 1493 436d b9 2d 4a lda level4-1+256,y 1494 4370 99 ff 22 sta screendata-1+256,y 1495 4373 88 dey 1496 4374 d0 f7 bne memcpyloop15 1497 4376 a0 e0 ldy #224 1498 4378 memcpyloop16 1499 4378 b9 2d 49 lda level4-1,y 1500 437b 99 ff 21 sta screendata-1,y 1501 437e 88 dey 1502 437f d0 f7 bne memcpyloop16 1503 4381 .skipL0104 1504 4381 .L0105 ;; return 1505 4381 1506 4381 60 RTS 1507 4382 . 1508 4382 ;; 1509 4382 1510 4382 .L0106 ;; alphachars ' abcdefghi' 1511 4382 1512 4382 . 1513 4382 ;; 1514 4382 1515 4382 .L0107 ;; alphadata level1 platformer_test_tiles_ramchar 1516 4382 1517 4382 4c 65 45 JMP .skipL0107 1518 4385 level1 1519 4385 00 .byte.b ((screendata+0) 3866 e7c3 22 .byte.b >(screendata+20) 3867 e7c4 22 .byte.b >(screendata+40) 3868 e7c5 22 .byte.b >(screendata+60) 3869 e7c6 22 .byte.b >(screendata+80) 3870 e7c7 22 .byte.b >(screendata+100) 3871 e7c8 22 .byte.b >(screendata+120) 3872 e7c9 22 .byte.b >(screendata+140) 3873 e7ca 22 .byte.b >(screendata+160) 3874 e7cb 22 .byte.b >(screendata+180) 3875 e7cc 22 .byte.b >(screendata+200) 3876 e7cd 22 .byte.b >(screendata+220) 3877 e7ce 22 .byte.b >(screendata+240) 3878 e7cf 23 .byte.b >(screendata+260) 3879 e7d0 23 .byte.b >(screendata+280) 3880 e7d1 23 .byte.b >(screendata+300) 3881 e7d2 23 .byte.b >(screendata+320) 3882 e7d3 23 .byte.b >(screendata+340) 3883 e7d4 23 .byte.b >(screendata+360) 3884 e7d5 23 .byte.b >(screendata+380) 3885 e7d6 23 .byte.b >(screendata+400) 3886 e7d7 23 .byte.b >(screendata+420) 3887 e7d8 23 .byte.b >(screendata+440) 3888 e7d9 23 .byte.b >(screendata+460) 3889 e7da - if SPACEOVERFLOW > 0 3890 e7da - echo "" 3891 e7da - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 3892 e7da - echo "######## look above for areas with negative ROM space left." 3893 e7da - echo "######## Aborting assembly." 3894 e7da - ERR 3895 e7da endif 3896 e7da 3897 e7da 3898 e7da ; Provided under the CC0 license. See the included LICENSE.txt for details. 3899 e7da 3900 e7da ifnconst bankswitchmode 3901 e7da if ( * < $f000 ) 3902 f000 ORG $F000 3903 f000 endif 3904 f000 - else 3905 f000 - ifconst ROM128K 3906 f000 - if ( * < $f000 ) 3907 f000 - ORG $27000 3908 f000 - RORG $F000 3909 f000 - endif 3910 f000 - endif 3911 f000 - ifconst ROM144K 3912 f000 - if ( * < $f000 ) 3913 f000 - ORG $27000 3914 f000 - RORG $F000 3915 f000 - endif 3916 f000 - endif 3917 f000 - ifconst ROM256K 3918 f000 - if ( * < $f000 ) 3919 f000 - ORG $47000 3920 f000 - RORG $F000 3921 f000 - endif 3922 f000 - endif 3923 f000 - ifconst ROM272K 3924 f000 - if ( * < $f000 ) 3925 f000 - ORG $47000 3926 f000 - RORG $F000 3927 f000 - endif 3928 f000 - endif 3929 f000 - ifconst ROM512K 3930 f000 - if ( * < $f000 ) 3931 f000 - ORG $87000 3932 f000 - RORG $F000 3933 f000 - endif 3934 f000 - endif 3935 f000 - ifconst ROM528K 3936 f000 - if ( * < $f000 ) 3937 f000 - ORG $87000 3938 f000 - RORG $F000 3939 f000 - endif 3940 f000 - endif 3941 f000 endif 3942 f000 3943 f000 ; all of these "modules" have conditional clauses in them, so even though 3944 f000 ; they're always included here, they don't take up rom unless the user 3945 f000 ; explicitly enables support for the feature. 3946 f000 3947 f000 ifnconst included.7800vox.asm ------- FILE 7800vox.asm LEVEL 2 PASS 3 0 f000 include 7800vox.asm 1 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 f000 3 f000 ; AtariVox 7800basic wrapper 4 f000 5 f000 ; to be called with 6 f000 ; A=# of bytes 7 f000 ; 8 f000 9 f000 - ifconst HSSUPPORT 10 f000 - 11 f000 -AVoxReadBytes 12 f000 - sta temp8 13 f000 - jsr i2c_startwrite 14 f000 - bcs eeprom_error 15 f000 - 16 f000 - lda HSVoxHi 17 f000 - jsr i2c_txbyte 18 f000 - lda HSVoxLo 19 f000 - jsr i2c_txbyte 20 f000 - jsr i2c_stopwrite 21 f000 - 22 f000 - jsr i2c_startread 23 f000 - 24 f000 - ldx #0 25 f000 -AVoxReadBytesLoop 26 f000 - jsr i2c_rxbyte 27 f000 - sta eeprombuffer,x 28 f000 - inx 29 f000 - cpx temp8 30 f000 - bne AVoxReadBytesLoop 31 f000 - jsr i2c_stopread 32 f000 - lda #0 33 f000 - rts 34 f000 - 35 f000 - ; to be called with 36 f000 - ; A=# of bytes 37 f000 - ; 38 f000 - 39 f000 -AVoxWriteBytes 40 f000 - sta temp8 41 f000 - jsr i2c_startwrite 42 f000 - bcs eeprom_error 43 f000 - 44 f000 - lda HSVoxHi 45 f000 - jsr i2c_txbyte 46 f000 - lda HSVoxLo 47 f000 - jsr i2c_txbyte 48 f000 - 49 f000 - ldx #$00 50 f000 -AVoxWriteBytesLoop 51 f000 - lda eeprombuffer,x 52 f000 - jsr i2c_txbyte 53 f000 - inx 54 f000 - cpx temp8 55 f000 - bne AVoxWriteBytesLoop 56 f000 - jsr i2c_stopwrite 57 f000 - 58 f000 - lda #0 59 f000 - rts 60 f000 - 61 f000 -eeprom_error 62 f000 - lda #$ff 63 f000 - rts 64 f000 - 65 f000 -AVoxDetect 66 f000 - 67 f000 - jsr i2c_startwrite 68 f000 - bcs eeprom_error 69 f000 - lda #$30 70 f000 - jsr i2c_txbyte 71 f000 - lda #$00 72 f000 - jsr i2c_txbyte 73 f000 - jsr i2c_stopwrite 74 f000 - rts 75 f000 - 76 f000 - include "i2c7800.inc" 77 f000 - I2C_SUBS temp9 78 f000 - 79 f000 endif 80 f000 ------- FILE c:\Users\Shane\Documents\my7800projects\platformer_demos\template\platformer_demo_v01.78b.asm 3949 f000 endif 3950 f000 ifnconst included.pokeysound.asm ------- FILE pokeysound.asm LEVEL 2 PASS 3 0 f000 include pokeysound.asm 1 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 f000 3 f000 4 f000 - ifconst pokeysupport 5 f000 - 6 f000 -pokeysoundmodulestart 7 f000 - 8 f000 -mutepokey 9 f000 - lda #0 10 f000 - ldy #7 11 f000 -mutepokeyloop 12 f000 - sta pokey1pointlo,y 13 f000 - sta (pokeybaselo),y 14 f000 - dey 15 f000 - bpl mutepokeyloop 16 f000 - rts 17 f000 - 18 f000 -checkpokeyplaying 19 f000 - ldx #6 20 f000 -checkpokeyplayingloop 21 f000 - lda pokey1pointlo,x 22 f000 - ora pokey1pointhi,x 23 f000 - beq pokeychannelinactive 24 f000 - jsr playpokeysfxA ; x=channel*2 25 f000 -pokeychannelinactive 26 f000 - dex 27 f000 - dex 28 f000 - bpl checkpokeyplayingloop 29 f000 - rts 30 f000 - 31 f000 -playpokeysfxA 32 f000 - txa 33 f000 - tay 34 f000 - lda pokey1tick,x 35 f000 - beq playpokeysfxAcont 36 f000 - sec 37 f000 - sbc #1 38 f000 - sta pokey1tick,x ; sound resolution is >1 frame, and we're mid-tock... 39 f000 - rts 40 f000 - 41 f000 -playpokeysfxAcont 42 f000 - lda pokey1frames,x ; set the frame countdown for this sound chunk 43 f000 - sta pokey1tick,x 44 f000 - 45 f000 - lda pokey1priority,x ; decrease the sound's priority if its non-zero 46 f000 - beq playpokeysfxAcont2 47 f000 - sec 48 f000 - sbc #1 49 f000 - sta pokey1priority,x 50 f000 -playpokeysfxAcont2 51 f000 - 52 f000 - ; *** FREQUENCY 53 f000 - lda (pokey1pointlo,x) 54 f000 - sta inttemp1 55 f000 - clc 56 f000 - adc pokey1offset,x ; take into account any pitch modification 57 f000 - sta (pokeybaselo),y ; PAUDF0,0 58 f000 - 59 f000 - ;advance the data pointer +1 60 f000 - inc pokey1pointlo,x 61 f000 - bne skippokeyhiinc1 62 f000 - inc pokey1pointhi,x 63 f000 -skippokeyhiinc1 64 f000 - 65 f000 - ; *** WAVE 66 f000 - lda (pokey1pointlo,x) 67 f000 - asl 68 f000 - asl 69 f000 - asl 70 f000 - asl ; x16 71 f000 - 72 f000 - ;advance the data pointer +1 73 f000 - inc pokey1pointlo,x 74 f000 - bne skippokeyhiinc2 75 f000 - inc pokey1pointhi,x 76 f000 -skippokeyhiinc2 77 f000 - 78 f000 - ora (pokey1pointlo,x) 79 f000 - iny 80 f000 - sta (pokeybaselo),y 81 f000 - 82 f000 - ora inttemp1 ; check if F|C|V=0 83 f000 - beq zeropokeypoint ; if so, we're at the end of the sound. 84 f000 - 85 f000 - ; advance the pointer +1, on to the next sound chunk 86 f000 - inc pokey1pointlo,x 87 f000 - bne skippokeyhiinc3 88 f000 - inc pokey1pointhi,x 89 f000 -skippokeyhiinc3 90 f000 - rts 91 f000 - 92 f000 -zeropokeypoint 93 f000 - sta pokey1pointlo,x 94 f000 - sta pokey1pointhi,x 95 f000 - sta pokey1priority,x 96 f000 - rts 97 f000 - 98 f000 -schedulepokeysfx 99 f000 - ldx #6 100 f000 -schedulepokeysfxloop 101 f000 - lda pokey1pointlo,x 102 f000 - ora pokey1pointhi,x 103 f000 - bne schedulespokeysearch 104 f000 - jmp schedulepokeyX ; we found an unused channel, so use it... 105 f000 -schedulespokeysearch 106 f000 - dex 107 f000 - dex 108 f000 - bpl schedulepokeysfxloop 109 f000 - 110 f000 - ; if we're here, all 4 channels are presently playing a sound... 111 f000 - ldy #1 112 f000 - lda (sfxinstrumentlo),y ; peek at the priority of this sfx... 113 f000 - bne schedulepokeysfxcont1 114 f000 - rts ; ...and skip it if it's 0 priority 115 f000 -schedulepokeysfxcont1 116 f000 - 117 f000 - ; figure out which current sound has the lowest priority... 118 f000 - lda #0 119 f000 - sta temp8 120 f000 - lda pokey1priority 121 f000 - sta temp9 122 f000 - ldx #6 123 f000 -findlowprioritypokeyloop 124 f000 - lda pokey1priority,x 125 f000 - cmp temp9 126 f000 - bcs findlowprioritypokeyloopcontinue 127 f000 - sta temp9 128 f000 - stx temp8 129 f000 -findlowprioritypokeyloopcontinue 130 f000 - dex 131 f000 - dex 132 f000 - bne findlowprioritypokeyloop 133 f000 - ldx temp8 ; the low priority channel we'll interrupt 134 f000 - 135 f000 -schedulepokeyX 136 f000 - ;called with X=2*pokey channel to play on... 137 f000 - ldy #1 ; get priority and sound-resolution (in frames) 138 f000 - lda (sfxinstrumentlo),y 139 f000 - sta pokey1priority,x 140 f000 - iny 141 f000 - lda (sfxinstrumentlo),y 142 f000 - sta pokey1frames,x 143 f000 - 144 f000 - lda sfxinstrumentlo 145 f000 - clc 146 f000 - adc #3 147 f000 - sta pokey1pointlo,x 148 f000 - lda sfxinstrumenthi 149 f000 - adc #0 150 f000 - sta pokey1pointhi,x 151 f000 - lda temp3 152 f000 - sta pokey1offset,x 153 f000 - lda #0 154 f000 - sta pokey1tick,x 155 f000 - rts 156 f000 - 157 f000 - ; pokey detection routine. we check for pokey in the XBOARD/XM location, 158 f000 - ; and the standard $4000 location. 159 f000 - ; if pokey the pokey is present, this routine will reset it. 160 f000 - 161 f000 -detectpokeylocation 162 f000 - ;XBoard/XM... 163 f000 - ldx #2 164 f000 -detectpokeyloop 165 f000 - lda XCTRL1s 166 f000 - ora #%00010100 167 f000 - and POKEYXMMASK,x 168 f000 - sta XCTRL1s 169 f000 - sta XCTRL1 170 f000 - 171 f000 - lda POKEYCHECKLO,x 172 f000 - sta pokeybaselo 173 f000 - lda POKEYCHECKHI,x 174 f000 - sta pokeybasehi 175 f000 - jsr checkforpokey 176 f000 - lda pokeydetected 177 f000 - beq foundpokeychip 178 f000 - dex 179 f000 - bpl detectpokeyloop 180 f000 -foundpokeychip 181 f000 - eor #$ff ; invert state for 7800basic if...then test 182 f000 - sta pokeydetected 183 f000 - rts 184 f000 - 185 f000 -POKEYXMMASK 186 f000 - ; XM POKEY on XM POKEY off XM POKEY off 187 f000 - .byte %11111111, %11101111, %11101111 188 f000 - 189 f000 -POKEYCHECKLO 190 f000 - .byte <$0450, <$0450, <$4000 191 f000 -POKEYCHECKHI 192 f000 - .byte >$0450, >$0450, >$4000 193 f000 - 194 f000 -checkforpokey 195 f000 - ldy #$0f 196 f000 - lda #$00 197 f000 - sta pokeydetected ; start off by assuming pokey will be detected 198 f000 -resetpokeyregistersloop 199 f000 - sta (pokeybase),y 200 f000 - dey 201 f000 - bpl resetpokeyregistersloop 202 f000 - 203 f000 - ldy #PAUDCTL 204 f000 - sta (pokeybase),y 205 f000 - ldy #PSKCTL 206 f000 - sta (pokeybase),y 207 f000 - 208 f000 - ; let the dust settle... 209 f000 - nop 210 f000 - nop 211 f000 - nop 212 f000 - 213 f000 - lda #4 214 f000 - sta temp9 215 f000 -pokeycheckloop1 216 f000 - ; we're in reset, so the RANDOM register should read $ff... 217 f000 - ldy #PRANDOM 218 f000 - lda (pokeybase),y 219 f000 - cmp #$ff 220 f000 - bne nopokeydetected 221 f000 - dec temp9 222 f000 - bne pokeycheckloop1 223 f000 - 224 f000 - ; take pokey out of reset... 225 f000 - ldy #PSKCTL 226 f000 - lda #3 227 f000 - sta (pokeybase),y 228 f000 - ldy #PAUDCTL 229 f000 - lda #0 230 f000 - sta (pokeybase),y 231 f000 - 232 f000 - ; let the dust settle again... 233 f000 - nop 234 f000 - nop 235 f000 - nop 236 f000 - 237 f000 - lda #4 238 f000 - sta temp9 239 f000 -pokeycheckloop2 240 f000 - ; we're out of reset, so RANDOM should read non-$ff... 241 f000 - ldy #PRANDOM 242 f000 - lda (pokeybase),y 243 f000 - cmp #$ff 244 f000 - beq skippokeycheckreturn 245 f000 - rts 246 f000 -skippokeycheckreturn 247 f000 - dec temp9 248 f000 - bne pokeycheckloop2 249 f000 -nopokeydetected 250 f000 - dec pokeydetected ; pokeydetected=#$ff 251 f000 - rts 252 f000 - 253 f000 -pokeysoundmoduleend 254 f000 - 255 f000 - echo " pokeysound assembly: ",[(pokeysoundmoduleend-pokeysoundmodulestart)]d," bytes" 256 f000 - 257 f000 endif ------- FILE c:\Users\Shane\Documents\my7800projects\platformer_demos\template\platformer_demo_v01.78b.asm 3952 f000 endif 3953 f000 ifnconst included.tracker.asm ------- FILE tracker.asm LEVEL 2 PASS 3 0 f000 include tracker.asm 1 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 f000 3 f000 4 f000 - ifconst MUSICTRACKER 5 f000 - ; ** songtempo lists how many 256ths of a frame a 16th note lasts 6 f000 - ; ** the player operates on a 16th note grid. 7 f000 - 8 f000 -servicesongover 9 f000 - rts 10 f000 -servicesong 11 f000 - lda songtempo 12 f000 - beq servicesongover ; ** if song is off/paused then return 13 f000 -servicesongcontinue 14 f000 - lda sfxschedulelock 15 f000 - sta sfxschedulemissed 16 f000 - bne servicesongover 17 f000 - lda songtempo 18 f000 - clc 19 f000 - adc songtick ; add songtempo to songtick until it rolls over 20 f000 - sta songtick ; this is how we break away from 50/60Hz timing. 21 f000 - bcc servicesongover 22 f000 - ; ** if we're here a new 16th note has passed 23 f000 - ; ** check if a new note is due on any of the 4 channels 24 f000 -servicesongredo 25 f000 - ldx #3 26 f000 -checkchannelloop 27 f000 - dec songchannel1busywait,x 28 f000 - bpl carryoncheckingchannel 29 f000 - txa 30 f000 - pha ; save X for the loop 31 f000 - jsr processsongdata 32 f000 - pla ; restore X for the loop 33 f000 - tax 34 f000 -carryoncheckingchannel 35 f000 - dex 36 f000 - bpl checkchannelloop 37 f000 - lda inactivechannelcount 38 f000 - cmp #15 39 f000 - bne skipstopsong 40 f000 - lda songloops 41 f000 - bne doasongloop 42 f000 - ;lda #0 43 f000 - sta songtempo ; all channels are done. stop the song 44 f000 - rts 45 f000 -doasongloop 46 f000 - bmi skipsongloopadjust 47 f000 - dec songloops 48 f000 -skipsongloopadjust 49 f000 - jsr setsongchannels 50 f000 - jmp servicesongredo 51 f000 -skipstopsong 52 f000 - rts 53 f000 - 54 f000 -processsongdata 55 f000 - ; channel needs processing 56 f000 - ; X=channel # 57 f000 - 58 f000 - txa 59 f000 - clc 60 f000 - adc songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 61 f000 - tay 62 f000 - 63 f000 - 64 f000 - ; ** indirect x is cumbersome with mult-byte commands. 65 f000 - ; ** setup a pointer to the song data for indirect y addressing. 66 f000 - lda songchannel1layer1lo,y 67 f000 - sta songdatalo 68 f000 - lda songchannel1layer1hi,y 69 f000 - sta songdatahi 70 f000 - ora songdatalo 71 f000 - bne channelhasdata 72 f000 - ;channel data is pointing at $0000 73 f000 - lda #$7F 74 f000 - sta songchannel1busywait,x ; skip a bunch of notes 75 f000 -setchannelcountbits 76 f000 - lda channel2bits,x 77 f000 - ora inactivechannelcount 78 f000 - sta inactivechannelcount 79 f000 - rts 80 f000 -channelhasdata 81 f000 - 82 f000 - sty songstackindex 83 f000 - ldy #0 84 f000 - lda (songdatalo),y ; ** load in the next byte of song data, so we can decode it 85 f000 - cmp #$ff 86 f000 - bne carryoncheckingdatatype ; ** $ff=pattern end marker 87 f000 - jmp handlechannelEOD 88 f000 - 89 f000 -carryoncheckingdatatype 90 f000 - and #$F0 91 f000 - cmp #$C0 92 f000 - beq handlechannelrest ; 0000XXXX=rest 93 f000 - cmp #$F0 94 f000 - beq handlemultibytecommand 95 f000 - cmp #$D0 96 f000 - beq handlesemiup 97 f000 - cmp #$E0 98 f000 - beq handlesemidown 99 f000 -handlenotedata 100 f000 - ; ** TODO: note playing is a terrible choice for fall-through 101 f000 - 102 f000 - ; ** its simple note data, prepare arguments for schedulesfx 103 f000 - 104 f000 - ; ** set the note length 105 f000 - lda (songdatalo),y 106 f000 - and #$0F 107 f000 - sta songchannel1busywait,x 108 f000 - 109 f000 - ; ** load the instrument 110 f000 - lda songchannel1instrumentlo,x 111 f000 - sta sfxinstrumentlo 112 f000 - lda songchannel1instrumenthi,x 113 f000 - sta sfxinstrumenthi 114 f000 - 115 f000 - ; ** get the note, and transpose 116 f000 - lda (songdatalo),y 117 f000 - lsr 118 f000 - lsr 119 f000 - lsr 120 f000 - lsr 121 f000 - clc 122 f000 - adc songchannel1transpose,x ; ** add it to the transpose index 123 f000 - ; ** its up the respective SFX scheduler to handle and save the note data 124 f000 - sta sfxnoteindex 125 f000 - 126 f000 - lda #0 127 f000 - sta sfxpitchoffset 128 f000 - 129 f000 - jsr schedulesfx 130 f000 - 131 f000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 132 f000 - 133 f000 -handlechannelrest 134 f000 - ; ** set the note length 135 f000 - lda (songdatalo),y 136 f000 - and #$0F 137 f000 - sta songchannel1busywait,x 138 f000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 139 f000 - 140 f000 -handlesemiup 141 f000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 142 f000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 143 f000 - clc 144 f000 -handlesemidownentry 145 f000 - adc songchannel1transpose,x ; ** add it to the transpose index 146 f000 - sta songchannel1transpose,x 147 f000 - jsr advancethesongpointer1byte 148 f000 - jmp processsongdata ; semi doesn't have note length, so process the next data byte... 149 f000 - 150 f000 -handlesemidown 151 f000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 152 f000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 153 f000 - eor #$ff ; ** its easier if we negate it, and then add it instead. 154 f000 - sec 155 f000 - jmp handlesemidownentry 156 f000 - 157 f000 -handlemultibytecommand 158 f000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 159 f000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 160 f000 - cmp #$08 ; ** load new instrument? 161 f000 - bne nothandleinstrumentchange 162 f000 -handleinstrumentchange 163 f000 - iny 164 f000 - lda (songdatalo),y 165 f000 - sta songchannel1instrumentlo,x 166 f000 - iny 167 f000 - lda (songdatalo),y 168 f000 - sta songchannel1instrumenthi,x 169 f000 - lda #3 170 f000 - jsr advancethesongpointerNbytes ; advance 3 bytes 171 f000 - jmp processsongdata 172 f000 - 173 f000 -nothandleinstrumentchange 174 f000 - cmp #$09 ; ** absolute tempo change? 175 f000 - bne nothandletempochange 176 f000 - lda #0 177 f000 - sta songtempo 178 f000 -handlerelativetempochange 179 f000 - iny 180 f000 - lda (songdatalo),y 181 f000 - clc 182 f000 - adc songtempo 183 f000 - sta songtempo 184 f000 - lda #2 185 f000 - jsr advancethesongpointerNbytes ; advance 2 bytes 186 f000 - jmp processsongdata 187 f000 - 188 f000 -nothandletempochange 189 f000 - cmp #$0A ; ** relative tempo change?: 190 f000 - beq handlerelativetempochange 191 f000 - cmp #$0B ; ** octave/semi change? 192 f000 - beq handleoctavesemichange 193 f000 -handlepatterndata 194 f000 - ; ** if we're here its a pattern/loop "subroutine" 195 f000 - ; ** move the channel's "stack" pointer and populate the new stack level 196 f000 - 197 f000 - lda #4 198 f000 - clc 199 f000 - adc songchannel1stackdepth,x 200 f000 - sta songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 201 f000 - 202 f000 - stx inttemp6 ; about to invalidate x. save it. 203 f000 - lda songstackindex 204 f000 - adc #4 205 f000 - tax 206 f000 - 207 f000 - lda (songdatalo),y 208 f000 - and #$7 209 f000 - sta songchannel1layer1loops,x 210 f000 - iny 211 f000 - lda (songdatalo),y 212 f000 - sta songchannel1layer1lo,x 213 f000 - iny 214 f000 - lda (songdatalo),y 215 f000 - sta songchannel1layer1hi,x 216 f000 - 217 f000 - ldx inttemp6 ; restore x with the channel # 218 f000 - 219 f000 - ; ** advance will operate on the old stack level, since we didn't store the updated songstackindex... 220 f000 - lda #3 221 f000 - jsr advancethesongpointerNbytes ; advance 3 bytes 222 f000 - 223 f000 - ; ** ...but the new stack level will be correctly picked up when we process the next byte. 224 f000 - jmp processsongdata 225 f000 - 226 f000 -handlechannelEOD 227 f000 - ; ** check if there are loops remaining on the pattern 228 f000 - stx inttemp6 229 f000 - ldx songstackindex 230 f000 - dec songchannel1layer1loops,x 231 f000 - bmi handlechannelEODnoloop 232 f000 - ; ** loops are remaining. set the pattern pointer to the pattern start, which is contained after the EOD 233 f000 - iny 234 f000 - lda (songdatalo),y 235 f000 - sta songchannel1layer1lo,x 236 f000 - iny 237 f000 - lda (songdatalo),y 238 f000 - sta songchannel1layer1hi,x 239 f000 - ldx inttemp6 240 f000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 241 f000 - 242 f000 -handlechannelEODnoloop 243 f000 - ; this pattern/loop is done playing. "pop" the stack 244 f000 - ldx inttemp6 245 f000 - lda songchannel1stackdepth,x 246 f000 - beq handlerootchannelEOD 247 f000 - sec 248 f000 - sbc #4 249 f000 - sta songchannel1stackdepth,x 250 f000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 251 f000 - 252 f000 -handlerootchannelEOD 253 f000 - ; this channel is done. point it to $ff data so we no longer process this channel. 254 f000 - lda #0 255 f000 - sta songchannel1layer1lo,x 256 f000 - sta songchannel1layer1hi,x 257 f000 - sta songchannel1busywait,x 258 f000 - jmp setchannelcountbits 259 f000 - rts 260 f000 - 261 f000 -nothandlepatternchange 262 f000 -handleoctavesemichange 263 f000 - iny 264 f000 - lda (songdatalo),y 265 f000 - sta songchannel1transpose,x 266 f000 - lda #2 267 f000 - jsr advancethesongpointerNbytes ; advance 2 bytes 268 f000 - jmp processsongdata 269 f000 - 270 f000 -advancethesongpointer1byte 271 f000 - txa 272 f000 - ldx songstackindex 273 f000 - inc songchannel1layer1lo,x 274 f000 - bne skiphiadvancethesongpointer1byte 275 f000 - inc songchannel1layer1hi,x 276 f000 -skiphiadvancethesongpointer1byte 277 f000 - tax 278 f000 - rts 279 f000 - 280 f000 -advancethesongpointerNbytes 281 f000 - ; entered with A=# of byte to advance 282 f000 - stx inttemp6 283 f000 - ldx songstackindex 284 f000 - clc 285 f000 - adc songchannel1layer1lo,x 286 f000 - sta songchannel1layer1lo,x 287 f000 - lda #0 288 f000 - adc songchannel1layer1hi,x 289 f000 - sta songchannel1layer1hi,x 290 f000 - ldx inttemp6 291 f000 - rts 292 f000 - 293 f000 -clearsongmemory 294 f000 - lda #0 295 f000 - ldx #(songchannel4instrumenthi-songchannel1layer1lo) 296 f000 -clearsongmemoryloop1 297 f000 - sta songchannel1layer1lo,x 298 f000 - dex 299 f000 - bpl clearsongmemoryloop1 300 f000 - 301 f000 - ldx #(songchannel4stackdepth-songchannel1layer1loops) 302 f000 -clearsongmemoryloop2 303 f000 - sta songchannel1layer1loops,x 304 f000 - dex 305 f000 - bpl clearsongmemoryloop2 306 f000 - 307 f000 - lda #$ff 308 f000 - ldx #3 309 f000 -clearsongmemoryloop3 310 f000 - sta songchannel1busywait,x 311 f000 - dex 312 f000 - bpl clearsongmemoryloop3 313 f000 - rts 314 f000 - 315 f000 -setsongchannels 316 f000 - jsr clearsongmemory 317 f000 - ldy #7 318 f000 - ldx #3 319 f000 -setsongchannelsloop 320 f000 - lda (songpointerlo),y 321 f000 - sta songchannel1layer1hi,x 322 f000 - dey 323 f000 - lda (songpointerlo),y 324 f000 - sta songchannel1layer1lo,x 325 f000 - dex 326 f000 - dey 327 f000 - bpl setsongchannelsloop 328 f000 - rts 329 f000 - 330 f000 -channel2bits 331 f000 - .byte 1,2,4,8 332 f000 - 333 f000 -tiatrackeroctavenotes 334 f000 - ifconst BUZZBASS 335 f000 -LOWC = 15 336 f000 - else 337 f000 -LOWC = 14 338 f000 - endif 339 f000 - ; ****** ELECTRONIC (0 to 11) 340 f000 - .byte LOWC,20 ; c0 16.1Hz 341 f000 - .byte LOWC,18 ; c#0 342 f000 - .byte LOWC,17 ; d0 343 f000 - .byte LOWC,16 ; d#0 344 f000 - .byte LOWC,15 ; e0 345 f000 - .byte LOWC,14 ; f0 (very off) 346 f000 - .byte LOWC,14 ; f#0 347 f000 - .byte LOWC,13 ; g0 348 f000 - .byte LOWC,12 ; g#0 349 f000 - .byte LOWC,11 ; a0 350 f000 - .byte LOWC,11 ; a#0 (very off) 351 f000 - .byte LOWC,10 ; b0 30.7Hz 352 f000 - 353 f000 - ; ****** SLIGHTLY BUZZY (12 to 23) 354 f000 - .byte 6,30 ; c1 32.7Hz 355 f000 - .byte 6,28 ; c#1 356 f000 - .byte 6,27 ; d1 357 f000 - .byte 6,25 ; d#1 358 f000 - .byte 6,24 ; e1 359 f000 - .byte 6,22 ; f1 360 f000 - .byte 6,21 ; f#1 361 f000 - .byte 6,20 ; g1 362 f000 - .byte 6,18 ; g#1 363 f000 - .byte 6,17 ; a1 364 f000 - .byte 6,16 ; a#1 365 f000 - .byte 6,15 ; b1 63.4Hz 366 f000 - 367 f000 - ; ****** BUZZY (24 to 39) 368 f000 - .byte 1,31 ; c2 65.5 369 f000 - .byte 1,30 ; c#2 67.6 370 f000 - .byte 1,27 ; d2 72.3 371 f000 - .byte 1,26 ; d#2 77.6 372 f000 - .byte 1,24 ; e2 373 f000 - .byte 1,23 ; f2 374 f000 - .byte 1,22 ; f#2 375 f000 - .byte 1,20 ; g2 376 f000 - .byte 1,19 ; g#2 377 f000 - .byte 1,18 ; a2 378 f000 - .byte 1,17 ; a#2 379 f000 - .byte 1,16 ; b2 380 f000 - .byte 1,15 ; c3 126.8Hz 381 f000 - .byte 1,14 ; c#3 382 f000 - .byte 1,13 ; d3 149.7Hz 383 f000 - .byte 1,12 ; d#3 161.2Hz (very off) 384 f000 - ; ****** PURE (40 to 71) - best key is A3 Major 385 f000 - .byte 12,31 ; e3 163.8Hz 386 f000 - .byte 12,29 ; f3 387 f000 - .byte 12,28 ; f#3 388 f000 - .byte 12,26 ; g3 389 f000 - .byte 12,24 ; g#3 390 f000 - .byte 12,23 ; a3 songs in key of A benefit from Perceptual Tuning 391 f000 - .byte 12,22 ; a#3 392 f000 - .byte 12,20 ; b3 393 f000 - .byte 12,19 ; c4 (middle C) 394 f000 - .byte 12,18 ; c#4 395 f000 - .byte 12,17 ; d4 396 f000 - .byte 12,16 ; d#4 397 f000 - .byte 12,15 ; e4 398 f000 - .byte 12,14 ; f4 399 f000 - .byte 12,13 ; f#4 400 f000 - .byte 12,12 ; g4 (very off) 401 f000 - .byte 12,12 ; g#4 402 f000 - .byte 12,11 ; a4 403 f000 - .byte 12,10 ; a#4 404 f000 - .byte 4,31 ; b4 405 f000 - .byte 4,29 ; c5 406 f000 - .byte 4,28 ; c#5 407 f000 - .byte 4,26 ; d5 408 f000 - .byte 4,24 ; d#5 409 f000 - .byte 4,23 ; e5 410 f000 - .byte 4,22 ; f5 411 f000 - .byte 4,20 ; f#5 412 f000 - .byte 4,19 ; g5 413 f000 - .byte 4,18 ; g#5 414 f000 - .byte 4,17 ; a5 415 f000 - .byte 4,16 ; a#5 416 f000 - .byte 4,15 ; b5 417 f000 - 418 f000 - ; ****** TUNED WIND (72 to 83) 419 f000 - .byte 8,30 ; c 420 f000 - .byte 8,28 ; c# 421 f000 - .byte 8,27 ; d 422 f000 - .byte 8,25 ; d# 423 f000 - .byte 8,24 ; e 424 f000 - .byte 8,22 ; f 425 f000 - .byte 8,21 ; f# 426 f000 - .byte 8,20 ; g 427 f000 - .byte 8,18 ; g# 428 f000 - .byte 8,17 ; a 429 f000 - .byte 8,16 ; a# 430 f000 - .byte 8,15 ; b 431 f000 - 432 f000 - include "tiadrumkit.asm" 433 f000 - 434 f000 endif ;MUSICTRACKER ------- FILE c:\Users\Shane\Documents\my7800projects\platformer_demos\template\platformer_demo_v01.78b.asm 3955 f000 endif 3956 f000 ifnconst included.hiscore.asm ------- FILE hiscore.asm LEVEL 2 PASS 3 0 f000 include hiscore.asm 1 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 f000 3 f000 - ifconst HSSUPPORT 4 f000 -detectatarivoxeeprom 5 f000 -hiscoremodulestart 6 f000 - ; do a test to see if atarivox eeprom can be accessed, and save results 7 f000 - jsr AVoxDetect 8 f000 - eor #$ff ; invert for easy 7800basic if...then logic 9 f000 - sta avoxdetected 10 f000 - lda #$0 11 f000 - sta SWACNT 12 f000 - lda avoxdetected 13 f000 - rts 14 f000 - 15 f000 -detecthsc 16 f000 - ; check for the HSC ROM signature... 17 f000 - lda XCTRL1s 18 f000 - ora #%00001100 19 f000 - sta XCTRL1s 20 f000 - sta XCTRL1 21 f000 - lda $3900 22 f000 - eor #$C6 23 f000 - bne detecthscfail 24 f000 - lda $3904 25 f000 - eor #$FE 26 f000 - bne detecthscfail 27 f000 - ; check if it's initialized... 28 f000 - ldy #0 29 f000 - lda #$ff 30 f000 -checkhscinit 31 f000 - and $1000,y 32 f000 - dey 33 f000 - bpl checkhscinit 34 f000 - cmp #$ff 35 f000 - bne hscisalreadyinit 36 f000 - ; if we're here, we need to do a minimal HSC init... 37 f000 - ldy #$28 38 f000 -hscinitloop1 39 f000 - lda hscheader,y 40 f000 - sta $1000,y 41 f000 - dey 42 f000 - bpl hscinitloop1 43 f000 - ldy #$89 44 f000 - lda #$7F 45 f000 -hscinitloop2 46 f000 - sta $10B3,y 47 f000 - dey 48 f000 - cpy #$ff 49 f000 - bne hscinitloop2 50 f000 -hscisalreadyinit 51 f000 - lda #$ff 52 f000 - rts 53 f000 -hscheader 54 f000 - .byte $00,$00,$68,$83,$AA,$55,$9C,$FF,$07,$12,$02,$1F,$00,$00,$00,$00 55 f000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 56 f000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$03 57 f000 -detecthscfail 58 f000 - lda XCTRL1s 59 f000 - and #%11110111 60 f000 - sta XCTRL1s 61 f000 - lda #0 62 f000 - rts 63 f000 endif ; HSSUPPORT 64 f000 65 f000 - ifconst HSSUPPORT 66 f000 - ifnconst hiscorefont 67 f000 - echo "" 68 f000 - echo "WARNING: High score support is enabled, but the hiscorefont.png was" 69 f000 - echo " NOT imported with incgraphic. The high score display code" 70 f000 - echo " has been omitted from this build." 71 f000 - echo "" 72 f000 - else 73 f000 -hscdrawscreen 74 f000 - 75 f000 - ; we use 20 lines on a 24 line display 76 f000 - ; HSSCOREY to dynamically centers based on 77 f000 - ;HSSCOREY = 0 78 f000 -HSSCOREY = ((WZONECOUNT*WZONEHEIGHT/8)-22)/2 79 f000 -HSCURSORY = ((HSSCOREY/(WZONEHEIGHT/8))*WZONEHEIGHT) 80 f000 - 81 f000 - ifconst HSSCORESIZE 82 f000 -SCORESIZE = HSSCORESIZE 83 f000 - else 84 f000 -SCORESIZE = 6 85 f000 - endif 86 f000 - 87 f000 - ;save shadow registers for later return... 88 f000 - lda sCTRL 89 f000 - sta ssCTRL 90 f000 - lda sCHARBASE 91 f000 - sta ssCHARBASE 92 f000 - lda #$60 93 f000 - sta charactermode 94 f000 - jsr drawwait 95 f000 - jsr blacken320colors 96 f000 - jsr clearscreen 97 f000 - 98 f000 - ;set the character base to the HSC font 99 f000 - lda #>hiscorefont 100 f000 - sta CHARBASE 101 f000 - sta sCHARBASE 102 f000 - lda #%01000011 ;Enable DMA, mode=320A 103 f000 - sta CTRL 104 f000 - sta sCTRL 105 f000 - 106 f000 - lda #60 107 f000 - sta hsjoydebounce 108 f000 - 109 f000 - lda #0 110 f000 - sta hscursorx 111 f000 - sta framecounter 112 f000 - ifnconst HSCOLORCHASESTART 113 f000 - lda #$8D ; default is blue. why not? 114 f000 - else 115 f000 - lda #HSCOLORCHASESTART 116 f000 - endif 117 f000 - sta hscolorchaseindex 118 f000 - 119 f000 - lda #$0F 120 f000 - sta P0C2 ; base text is white 121 f000 - 122 f000 - jsr hschasecolors 123 f000 - ; ** plot all of the initials 124 f000 - lda #HSRAMInitials 127 f000 - sta temp2 ; charmaphi 128 f000 - lda #32+29 ; palette=0-29 | 32-(width=3) 129 f000 - sta temp3 ; palette/width 130 f000 - lda #104 131 f000 - sta temp4 ; X 132 f000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 133 f000 - sta temp5 ; Y 134 f000 -plothsinitialsloop 135 f000 - jsr plotcharacters 136 f000 - clc 137 f000 - lda temp3 138 f000 - adc #32 139 f000 - sta temp3 140 f000 - inc temp5 141 f000 - if WZONEHEIGHT = 8 142 f000 - inc temp5 143 f000 - endif 144 f000 - clc 145 f000 - lda #3 146 f000 - adc temp1 147 f000 - sta temp1 148 f000 - cmp #(<(HSRAMInitials+15)) 149 f000 - bcc plothsinitialsloop 150 f000 - 151 f000 - ifconst HSGAMENAMELEN 152 f000 - ;plot the game name... 153 f000 - lda #HSGAMENAMEtable 156 f000 - sta temp2 ; charmaphi 157 f000 - lda #(32-HSGAMENAMELEN) ; palette=0*29 | 32-(width=3) 158 f000 - sta temp3 ; palette/width 159 f000 - lda #(80-(HSGAMENAMELEN*2)) 160 f000 - sta temp4 ; X 161 f000 - lda #((HSSCOREY+0)/(WZONEHEIGHT/8)) 162 f000 - sta temp5 ; Y 163 f000 - jsr plotcharacters 164 f000 - endif ; HSGAMENAMELEN 165 f000 - 166 f000 - ;plot "difficulty"... 167 f000 - ldy gamedifficulty 168 f000 - ifnconst HSNOLEVELNAMES 169 f000 - lda highscoredifficultytextlo,y 170 f000 - sta temp1 171 f000 - lda highscoredifficultytexthi,y 172 f000 - sta temp2 173 f000 - sec 174 f000 - lda #32 175 f000 - sbc highscoredifficultytextlen,y 176 f000 - sta temp3 ; palette/width 177 f000 - sec 178 f000 - lda #40 179 f000 - sbc highscoredifficultytextlen,y 180 f000 - asl 181 f000 - sta temp4 ; X 182 f000 - else 183 f000 - lda #HSHIGHSCOREStext 186 f000 - sta temp2 ; charmaphi 187 f000 - lda #(32-11) ; palette=0*29 | 32-(width=3) 188 f000 - sta temp3 ; palette/width 189 f000 - lda #(80-(11*2)) 190 f000 - sta temp4 ; X 191 f000 - endif ; HSNOLEVELNAMES 192 f000 - 193 f000 - lda #((HSSCOREY+2)/(WZONEHEIGHT/8)) 194 f000 - sta temp5 ; Y 195 f000 - jsr plotcharacters 196 f000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 197 f000 - bne carronwithscoreevaluation 198 f000 - jmp donoscoreevaluation 199 f000 -carronwithscoreevaluation 200 f000 - dey 201 f000 - lda highscorelabeltextlo,y 202 f000 - sta temp1 203 f000 - lda highscorelabeltexthi,y 204 f000 - sta temp2 205 f000 - sec 206 f000 - lda #(32-15) ; palette=0*29 | 32-(width=3) 207 f000 - sta temp3 ; palette/width 208 f000 - lda highscorelabeladjust1,y 209 f000 - sta temp4 ; X 210 f000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 211 f000 - sta temp5 ; Y 212 f000 - jsr plotcharacters 213 f000 - 214 f000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 215 f000 - dey 216 f000 - ;plot the current player score... 217 f000 - lda #(32-SCORESIZE) ; palette=0*32 218 f000 - sta temp3 ; palette/width 219 f000 - lda highscorelabeladjust2,y 220 f000 - sta temp4 ; X 221 f000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 222 f000 - sta temp5 ; Y 223 f000 - 224 f000 - lda scorevarlo,y 225 f000 - sta temp7 ; score variable lo 226 f000 - lda scorevarhi,y 227 f000 - sta temp8 ; score variable hi 228 f000 - 229 f000 - lda #(hiscorefont_mode | %01100000) ; charactermode 230 f000 - sta temp9 231 f000 - 232 f000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 233 f000 - sta temp1 ; charmaplo 234 f000 - lda #>(hiscorefont+33) 235 f000 - sta temp2 ; charmaphi 236 f000 - lda #SCORESIZE 237 f000 - sta temp6 238 f000 - ifnconst DOUBLEWIDE 239 f000 - jsr plotvalue 240 f000 - else 241 f000 - jsr plotvaluedw 242 f000 - endif 243 f000 - 244 f000 -USED_PLOTVALUE = 1 ; ensure that plotvalue gets compiled in 245 f000 - 246 f000 - ifconst HSGAMERANKS 247 f000 - 248 f000 - ldx #$ff ; start at 0 after the inx... 249 f000 -comparescore2rankloop 250 f000 - inx 251 f000 - ldy #0 252 f000 - lda rankvalue_0,x 253 f000 - cmp (temp7),y 254 f000 - bcc score2rankloopdone 255 f000 - bne comparescore2rankloop 256 f000 - iny 257 f000 - lda rankvalue_1,x 258 f000 - cmp (temp7),y 259 f000 - bcc score2rankloopdone 260 f000 - bne comparescore2rankloop 261 f000 - iny 262 f000 - lda (temp7),y 263 f000 - cmp rankvalue_2,x 264 f000 - bcs score2rankloopdone 265 f000 - jmp comparescore2rankloop 266 f000 -score2rankloopdone 267 f000 - stx hsnewscorerank 268 f000 - 269 f000 - lda ranklabello,x 270 f000 - sta temp1 271 f000 - lda ranklabelhi,x 272 f000 - sta temp2 273 f000 - sec 274 f000 - lda #32 ; palette=0*29 | 32-(width=3) 275 f000 - sbc ranklabellengths,x 276 f000 - sta temp3 ; palette/width 277 f000 - sec 278 f000 - lda #(40+6) 279 f000 - sbc ranklabellengths,x 280 f000 - asl 281 f000 - sta temp4 ; X 282 f000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 283 f000 - sta temp5 ; Y 284 f000 - jsr plotcharacters 285 f000 - 286 f000 - ldx hsnewscorerank 287 f000 - 288 f000 - lda #highscoreranklabel 291 f000 - sta temp2 292 f000 - 293 f000 - lda #(32-5) ; palette=0*29 | 32-(width=3) 294 f000 - sta temp3 ; palette/width 295 f000 - lda #(40-6) 296 f000 - sec 297 f000 - sbc ranklabellengths,x 298 f000 - asl 299 f000 - sta temp4 ; X 300 f000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 301 f000 - sta temp5 ; Y 302 f000 - jsr plotcharacters 303 f000 - endif 304 f000 - 305 f000 - 306 f000 - ; ** which line did this player beat? 307 f000 - lda #$ff 308 f000 - sta hsnewscoreline 309 f000 - ldx #$fd 310 f000 -comparescoreadd2x 311 f000 - inx 312 f000 -comparescoreadd1x 313 f000 - inx 314 f000 -comparescore2lineloop 315 f000 - inc hsnewscoreline 316 f000 - inx ; initialrun, x=0 317 f000 - cpx #15 318 f000 - beq nohighscoreforyou 319 f000 - ldy #0 320 f000 - lda HSRAMScores,x 321 f000 - cmp (temp7),y ; first score digit 322 f000 - bcc score2lineloopdonedel1x 323 f000 - bne comparescoreadd2x 324 f000 - iny 325 f000 - inx 326 f000 - lda HSRAMScores,x 327 f000 - cmp (temp7),y 328 f000 - bcc score2lineloopdonedel2x 329 f000 - bne comparescoreadd1x 330 f000 - iny 331 f000 - inx 332 f000 - lda (temp7),y 333 f000 - cmp HSRAMScores,x 334 f000 - bcs score2lineloopdonedel3x 335 f000 - jmp comparescore2lineloop 336 f000 -nohighscoreforyou 337 f000 - lda #$ff 338 f000 - sta hsnewscoreline 339 f000 - sta countdownseconds 340 f000 - jmp donoscoreevaluation 341 f000 -score2lineloopdonedel3x 342 f000 - dex 343 f000 -score2lineloopdonedel2x 344 f000 - dex 345 f000 -score2lineloopdonedel1x 346 f000 - dex 347 f000 - 348 f000 - ; 0 1 2 349 f000 - ; 3 4 5 350 f000 - ; 6 7 8 351 f000 - ; 9 0 1 352 f000 - ; 2 3 4 353 f000 - 354 f000 - stx temp9 355 f000 - cpx #11 356 f000 - beq postsortscoresuploop 357 f000 - ldx #11 358 f000 -sortscoresuploop 359 f000 - lda HSRAMScores,x 360 f000 - sta HSRAMScores+3,x 361 f000 - lda HSRAMInitials,x 362 f000 - sta HSRAMInitials+3,x 363 f000 - dex 364 f000 - cpx temp9 365 f000 - bne sortscoresuploop 366 f000 -postsortscoresuploop 367 f000 - 368 f000 - ;stick the score and cleared initials in the slot... 369 f000 - inx 370 f000 - ldy #0 371 f000 - sty hsinitialhold 372 f000 - lda (temp7),y 373 f000 - sta HSRAMScores,x 374 f000 - iny 375 f000 - lda (temp7),y 376 f000 - sta HSRAMScores+1,x 377 f000 - iny 378 f000 - lda (temp7),y 379 f000 - sta HSRAMScores+2,x 380 f000 - lda #0 381 f000 - sta HSRAMInitials,x 382 f000 - lda #29 383 f000 - sta HSRAMInitials+1,x 384 f000 - sta HSRAMInitials+2,x 385 f000 - 386 f000 - stx hsinitialpos 387 f000 - 388 f000 - ifconst vox_highscore 389 f000 - lda <#vox_highscore 390 f000 - sta speech_addr 391 f000 - lda >#vox_highscore 392 f000 - sta speech_addr+1 393 f000 - endif 394 f000 - ifconst sfx_highscore 395 f000 - lda <#sfx_highscore 396 f000 - sta temp1 397 f000 - lda >#sfx_highscore 398 f000 - sta temp2 399 f000 - lda #0 400 f000 - sta temp3 401 f000 - jsr schedulesfx 402 f000 - endif 403 f000 - ifconst songdatastart_song_highscore 404 f000 - lda #songchanneltable_song_highscore 407 f000 - sta songpointerhi 408 f000 - lda #73 409 f000 - sta songtempo 410 f000 - jsr setsongchannels 411 f000 - endif 412 f000 - 413 f000 - 414 f000 -donoscoreevaluation 415 f000 - 416 f000 - lda #(32+(32-SCORESIZE)) ; palette=0*32 | 32-(width=6) 417 f000 - sta temp3 ; palette/width 418 f000 - lda #(72+(4*(6-SCORESIZE))) 419 f000 - sta temp4 ; X 420 f000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 421 f000 - sta temp5 ; Y 422 f000 - lda #HSRAMScores 425 f000 - sta temp8 ; score variable hi 426 f000 - lda #(hiscorefont_mode | %01100000) ; charactermode 427 f000 - sta temp9 428 f000 -plothsscoresloop 429 f000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 430 f000 - sta temp1 ; charmaplo 431 f000 - lda #>(hiscorefont+33) 432 f000 - sta temp2 ; charmaphi 433 f000 - lda #6 434 f000 - sta temp6 435 f000 - ifnconst DOUBLEWIDE 436 f000 - jsr plotvalue 437 f000 - else 438 f000 - jsr plotvaluedw 439 f000 - endif 440 f000 - clc 441 f000 - lda temp3 442 f000 - adc #32 443 f000 - sta temp3 444 f000 - inc temp5 445 f000 - if WZONEHEIGHT = 8 446 f000 - inc temp5 447 f000 - endif 448 f000 - clc 449 f000 - lda #3 450 f000 - adc temp7 451 f000 - sta temp7 452 f000 - cmp #(<(HSRAMScores+15)) 453 f000 - bcc plothsscoresloop 454 f000 -plothsindex 455 f000 - lda #32+31 ; palette=0*32 | 32-(width=1) 456 f000 - sta temp3 ; palette/width 457 f000 - lda #44 458 f000 - sta temp4 ; X 459 f000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 460 f000 - sta temp5 ; Y 461 f000 - lda #hsgameslotnumbers 464 f000 - sta temp8 ; score variable hi 465 f000 - lda #(hiscorefont_mode | %01100000) ; charactermode 466 f000 - sta temp9 467 f000 -plothsindexloop 468 f000 - lda #<(hiscorefont+33) 469 f000 - sta temp1 ; charmaplo 470 f000 - lda #>(hiscorefont+33) 471 f000 - sta temp2 ; charmaphi 472 f000 - lda #1 473 f000 - sta temp6 ; number of characters 474 f000 - ifnconst DOUBLEWIDE 475 f000 - jsr plotvalue 476 f000 - else 477 f000 - jsr plotvaluedw 478 f000 - endif 479 f000 - clc 480 f000 - lda temp3 481 f000 - adc #32 482 f000 - sta temp3 483 f000 - inc temp5 484 f000 - if WZONEHEIGHT = 8 485 f000 - inc temp5 486 f000 - endif 487 f000 - inc temp7 488 f000 - lda temp7 489 f000 - cmp #(<(hsgameslotnumbers+5)) 490 f000 - bcc plothsindexloop 491 f000 - 492 f000 - jsr savescreen 493 f000 - ifnconst HSSECONDS 494 f000 - lda #6 495 f000 - else 496 f000 - lda #HSSECONDS 497 f000 - endif 498 f000 - 499 f000 - sta countdownseconds 500 f000 - 501 f000 -keepdisplayinghs 502 f000 - jsr restorescreen 503 f000 - 504 f000 - jsr setuphsinpt1 505 f000 - 506 f000 - lda hsnewscoreline 507 f000 - bpl carryonkeepdisplayinghs 508 f000 - jmp skipenterscorecontrol 509 f000 -carryonkeepdisplayinghs 510 f000 - 511 f000 - 512 f000 - ifnconst HSSECONDS 513 f000 - lda #6 514 f000 - else 515 f000 - lda #HSSECONDS 516 f000 - endif 517 f000 - 518 f000 - sta countdownseconds 519 f000 - 520 f000 - ;plot the "cursor" initial sprite... 521 f000 - lda hsinitialhold 522 f000 - 523 f000 - sta temp1 524 f000 - lda #>(hiscorefont+32) 525 f000 - sta temp2 526 f000 - lda #31 ; palette=0*32 | 32-(width=1) 527 f000 - sta temp3 ; palette/width 528 f000 - lda hscursorx 529 f000 - asl 530 f000 - asl 531 f000 - clc 532 f000 - adc #104 533 f000 - sta temp4 ; X 534 f000 - lda hsnewscoreline 535 f000 - asl 536 f000 - asl 537 f000 - asl 538 f000 - asl 539 f000 - adc #((3*16)+HSCURSORY) 540 f000 - sta temp5 ; Y 541 f000 - lda #%01000000 542 f000 - sta temp6 543 f000 - jsr plotsprite 544 f000 - 545 f000 - ldx hscursorx 546 f000 - ldy hsdisplaymode 547 f000 - lda SWCHA 548 f000 - cpy #3 549 f000 - bne hsskipadjustjoystick1 550 f000 - asl 551 f000 - asl 552 f000 - asl 553 f000 - asl 554 f000 -hsskipadjustjoystick1 555 f000 - sta hsswcha 556 f000 - lda SWCHB 557 f000 - and #%00000010 558 f000 - bne hsskipselectswitch 559 f000 - lda #%00010000 560 f000 - sta hsswcha 561 f000 - bne hsdodebouncecheck 562 f000 -hsskipselectswitch 563 f000 - lda hsswcha 564 f000 - and #%00110000 565 f000 - cmp #%00110000 566 f000 - beq hsjoystickskipped 567 f000 -hsdodebouncecheck 568 f000 - lda hsjoydebounce 569 f000 - beq hsdontdebounce 570 f000 - jmp hspostjoystick 571 f000 -hsdontdebounce 572 f000 - ldx #1 ; small tick sound 573 f000 - jsr playhssfx 574 f000 - lda hsswcha 575 f000 - and #%00110000 576 f000 - ldx hscursorx 577 f000 - cmp #%00100000 ; check down 578 f000 - bne hsjoycheckup 579 f000 - ldy hsinitialhold 580 f000 - cpx #0 581 f000 - bne skipavoid31_1 582 f000 - cpy #0 ; if we're about to change to the <- char (#31) then double-decrement to skip over it 583 f000 - bne skipavoid31_1 584 f000 - dey 585 f000 -skipavoid31_1 586 f000 - dey 587 f000 - jmp hssetdebounce 588 f000 -hsjoycheckup 589 f000 - cmp #%00010000 ; check up 590 f000 - bne hsjoystickskipped 591 f000 - ldy hsinitialhold 592 f000 - cpx #0 593 f000 - bne skipavoid31_2 594 f000 - cpy #30 ; if we're about to change to the <- char (#31) then double-increment to skip over it 595 f000 - bne skipavoid31_2 596 f000 - iny 597 f000 -skipavoid31_2 598 f000 - iny 599 f000 -hssetdebounce 600 f000 - tya 601 f000 - and #31 602 f000 - sta hsinitialhold 603 f000 - lda #15 604 f000 - sta hsjoydebounce 605 f000 - bne hspostjoystick 606 f000 -hsjoystickskipped 607 f000 - ; check the fire button only when the stick isn't engaged 608 f000 - lda hsinpt1 609 f000 - bpl hsbuttonskipped 610 f000 - lda hsjoydebounce 611 f000 - beq hsfiredontdebounce 612 f000 - bne hspostjoystick 613 f000 -hsfiredontdebounce 614 f000 - lda hsinitialhold 615 f000 - cmp #31 616 f000 - beq hsmovecursorback 617 f000 - inc hscursorx 618 f000 - inc hsinitialpos 619 f000 - lda hscursorx 620 f000 - cmp #3 621 f000 - bne skiphsentryisdone 622 f000 - lda #0 623 f000 - sta framecounter 624 f000 - lda #$ff 625 f000 - sta hsnewscoreline 626 f000 - dec hsinitialpos 627 f000 - bne skiphsentryisdone 628 f000 -hsmovecursorback 629 f000 - lda hscursorx 630 f000 - beq skiphsmovecursorback 631 f000 - lda #29 632 f000 - ldx hsinitialpos 633 f000 - sta HSRAMInitials,x 634 f000 - dec hsinitialpos 635 f000 - dec hscursorx 636 f000 - dex 637 f000 - lda HSRAMInitials,x 638 f000 - sta hsinitialhold 639 f000 -skiphsmovecursorback 640 f000 -skiphsentryisdone 641 f000 - ldx #0 642 f000 - jsr playhssfx 643 f000 - lda #20 644 f000 - sta hsjoydebounce 645 f000 - bne hspostjoystick 646 f000 - 647 f000 -hsbuttonskipped 648 f000 - lda #0 649 f000 - sta hsjoydebounce 650 f000 -hspostjoystick 651 f000 - 652 f000 - ldx hsinitialpos 653 f000 - lda hsinitialhold 654 f000 - sta HSRAMInitials,x 655 f000 - 656 f000 - jmp skiphschasecolors 657 f000 - 658 f000 -skipenterscorecontrol 659 f000 - jsr hschasecolors 660 f000 - jsr setuphsinpt1 661 f000 - lda hsjoydebounce 662 f000 - bne skiphschasecolors 663 f000 - lda hsinpt1 664 f000 - bmi returnfromhs 665 f000 -skiphschasecolors 666 f000 - 667 f000 - jsr drawscreen 668 f000 - 669 f000 - lda countdownseconds 670 f000 - beq returnfromhs 671 f000 - jmp keepdisplayinghs 672 f000 -returnfromhs 673 f000 - 674 f000 - ifconst songdatastart_song_highscore 675 f000 - lda hsdisplaymode 676 f000 - beq skipclearHSCsong 677 f000 - lda #0 678 f000 - sta songtempo 679 f000 -skipclearHSCsong 680 f000 - endif 681 f000 - jsr drawwait 682 f000 - jsr clearscreen 683 f000 - lda #0 684 f000 - ldy #7 685 f000 - jsr blacken320colors 686 f000 - lda ssCTRL 687 f000 - sta sCTRL 688 f000 - lda ssCHARBASE 689 f000 - sta sCHARBASE 690 f000 - rts 691 f000 - 692 f000 -setuphsinpt1 693 f000 - lda #$ff 694 f000 - sta hsinpt1 695 f000 - lda hsjoydebounce 696 f000 - beq skipdebounceadjust 697 f000 - dec hsjoydebounce 698 f000 - bne skipstorefirebuttonstatus 699 f000 -skipdebounceadjust 700 f000 - lda SWCHB 701 f000 - and #%00000001 702 f000 - bne hscheckresetover 703 f000 - lda #$ff 704 f000 - sta hsinpt1 705 f000 - rts 706 f000 -hscheckresetover 707 f000 - ldx hsdisplaymode 708 f000 - cpx #3 709 f000 - bne hsskipadjustjoyfire1 710 f000 - lda sINPT3 711 f000 - jmp hsskipadjustjoyfire1done 712 f000 -hsskipadjustjoyfire1 713 f000 - lda sINPT1 714 f000 -hsskipadjustjoyfire1done 715 f000 - sta hsinpt1 716 f000 -skipstorefirebuttonstatus 717 f000 - rts 718 f000 - 719 f000 -blacken320colors 720 f000 - ldy #7 721 f000 -blacken320colorsloop 722 f000 - sta P0C2,y 723 f000 - dey 724 f000 - bpl blacken320colorsloop 725 f000 - rts 726 f000 - 727 f000 -hschasecolors 728 f000 - lda framecounter 729 f000 - and #3 730 f000 - bne hschasecolorsreturn 731 f000 - inc hscolorchaseindex 732 f000 - lda hscolorchaseindex 733 f000 - 734 f000 - sta P5C2 735 f000 - sbc #$02 736 f000 - sta P4C2 737 f000 - sbc #$02 738 f000 - sta P3C2 739 f000 - sbc #$02 740 f000 - sta P2C2 741 f000 - sbc #$02 742 f000 - sta P1C2 743 f000 -hschasecolorsreturn 744 f000 - rts 745 f000 - 746 f000 -playhssfx 747 f000 - lda hssfx_lo,x 748 f000 - sta temp1 749 f000 - lda hssfx_hi,x 750 f000 - sta temp2 751 f000 - lda #0 752 f000 - sta temp3 753 f000 - jmp schedulesfx 754 f000 - 755 f000 -hssfx_lo 756 f000 - .byte sfx_hsletterpositionchange, >sfx_hslettertick 759 f000 - 760 f000 -sfx_hsletterpositionchange 761 f000 - .byte $10,$18,$00 762 f000 - .byte $02,$06,$08 763 f000 - .byte $02,$06,$04 764 f000 - .byte $00,$00,$00 765 f000 -sfx_hslettertick 766 f000 - .byte $10,$18,$00 767 f000 - .byte $00,$00,$0a 768 f000 - .byte $00,$00,$00 769 f000 - 770 f000 -highscorelabeladjust1 771 f000 - .byte (80-(14*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)) 772 f000 -highscorelabeladjust2 773 f000 - .byte (80+(14*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)) 774 f000 - 775 f000 -scorevarlo 776 f000 - .byte <(score0+((6-SCORESIZE)/2)),<(score0+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)) 777 f000 -scorevarhi 778 f000 - .byte >(score0+((6-SCORESIZE)/2)),>(score0+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)) 779 f000 - 780 f000 - ifnconst HSNOLEVELNAMES 781 f000 -highscoredifficultytextlo 782 f000 - .byte easylevelname, >mediumlevelname, >hardlevelname, >expertlevelname 785 f000 - ifnconst HSCUSTOMLEVELNAMES 786 f000 -highscoredifficultytextlen 787 f000 - .byte 22, 30, 26, 24 788 f000 - 789 f000 -easylevelname 790 f000 - .byte $04,$00,$12,$18,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 791 f000 -mediumlevelname 792 f000 - .byte $08,$0d,$13,$04,$11,$0c,$04,$03,$08,$00,$13,$04,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 793 f000 -hardlevelname 794 f000 - .byte $00,$03,$15,$00,$0d,$02,$04,$03,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 795 f000 -expertlevelname 796 f000 - .byte $04,$17,$0f,$04,$11,$13,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 797 f000 - else 798 f000 - include "7800hsgamediffnames.asm" 799 f000 - endif ; HSCUSTOMLEVELNAMES 800 f000 - else 801 f000 -HSHIGHSCOREStext 802 f000 - .byte $07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 803 f000 - endif ; HSNOLEVELNAMES 804 f000 - 805 f000 -highscorelabeltextlo 806 f000 - .byte player0label, >player1label, >player2label, >player2label 809 f000 - 810 f000 -player0label 811 f000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$12,$02,$0e,$11,$04,$1a,$1d,$1d 812 f000 - 813 f000 -player1label 814 f000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$22,$1d,$12,$02,$0e,$11,$04,$1a 815 f000 - 816 f000 -player2label 817 f000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$23,$1d,$12,$02,$0e,$11,$04,$1a 818 f000 - 819 f000 - 820 f000 - ifconst HSGAMENAMELEN 821 f000 -HSGAMENAMEtable 822 f000 - include "7800hsgamename.asm" 823 f000 - endif 824 f000 - ifconst HSGAMERANKS 825 f000 - include "7800hsgameranks.asm" 826 f000 -highscoreranklabel 827 f000 - .byte $11,$00,$0d,$0a,$1a 828 f000 - endif 829 f000 - 830 f000 - ;ensure our table doesn't wrap a page... 831 f000 - if ((<*)>251) 832 f000 - align 256 833 f000 - endif 834 f000 -hsgameslotnumbers 835 f000 - .byte 33,34,35,36,37 836 f000 - endif 837 f000 - 838 f000 -loaddifficultytable 839 f000 - lda gamedifficulty 840 f000 - and #$03 ; ensure the user hasn't selected an invalid difficulty 841 f000 - sta gamedifficulty 842 f000 - cmp hsdifficulty ; check game difficulty is the same as RAM table 843 f000 - bne loaddifficultytablecontinue1 844 f000 - rts ; this high score difficulty table is already loaded 845 f000 -loaddifficultytablecontinue1 846 f000 - lda gamedifficulty 847 f000 - sta hsdifficulty 848 f000 - ;we need to check the device for the table 849 f000 - lda hsdevice 850 f000 - bne loaddifficultytablecontinue2 851 f000 - ; there's no save device. clear out this table. 852 f000 - jmp cleardifficultytablemem 853 f000 -loaddifficultytablecontinue2 854 f000 - lda hsdevice 855 f000 - and #1 856 f000 - beq memdeviceisntHSC 857 f000 - jmp loaddifficultytableHSC 858 f000 -memdeviceisntHSC 859 f000 - jmp loaddifficultytableAVOX 860 f000 - 861 f000 -savedifficultytable 862 f000 - ;*** we need to check wich device we should use... 863 f000 - lda hsdevice 864 f000 - bne savedifficultytablerealdevice 865 f000 - rts ; its a ram device 866 f000 -savedifficultytablerealdevice 867 f000 - and #1 868 f000 - beq savememdeviceisntHSC 869 f000 - jmp savedifficultytableHSC 870 f000 -savememdeviceisntHSC 871 f000 - jmp savedifficultytableAVOX 872 f000 - 873 f000 -savedifficultytableAVOX 874 f000 - ; the load call already setup the memory structure and atarivox memory location 875 f000 - jsr savealoadedHSCtablecontinue 876 f000 -savedifficultytableAVOXskipconvert 877 f000 - lda #HSIDHI 878 f000 - sta eeprombuffer 879 f000 - lda #HSIDLO 880 f000 - sta eeprombuffer+1 881 f000 - lda hsdifficulty 882 f000 - sta eeprombuffer+2 883 f000 - lda #32 884 f000 - jsr AVoxWriteBytes 885 f000 - rts 886 f000 - 887 f000 -savedifficultytableHSC 888 f000 - ;we always load a table before reaching here, so the 889 f000 - ;memory structures from the load should be intact... 890 f000 - ldy hsgameslot 891 f000 - bpl savealoadedHSCtable 892 f000 - rts 893 f000 -savealoadedHSCtable 894 f000 - lda HSCGameDifficulty,y 895 f000 - cmp #$7F 896 f000 - bne savealoadedHSCtablecontinue 897 f000 - jsr initializeHSCtableentry 898 f000 -savealoadedHSCtablecontinue 899 f000 - ;convert our RAM table to HSC format and write it out... 900 f000 - ldy #0 901 f000 - ldx #0 902 f000 -savedifficultytableScores 903 f000 - 904 f000 - lda HSRAMInitials,x 905 f000 - sta temp3 906 f000 - lda HSRAMInitials+1,x 907 f000 - sta temp4 908 f000 - lda HSRAMInitials+2,x 909 f000 - sta temp5 910 f000 - jsr encodeHSCInitials ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 911 f000 - 912 f000 - lda temp1 913 f000 - sta (HSGameTableLo),y 914 f000 - iny 915 f000 - lda temp2 916 f000 - sta (HSGameTableLo),y 917 f000 - iny 918 f000 - 919 f000 - lda HSRAMScores,x 920 f000 - sta (HSGameTableLo),y 921 f000 - iny 922 f000 - lda HSRAMScores+1,x 923 f000 - sta (HSGameTableLo),y 924 f000 - iny 925 f000 - lda HSRAMScores+2,x 926 f000 - sta (HSGameTableLo),y 927 f000 - iny 928 f000 - inx 929 f000 - inx 930 f000 - inx ; +3 931 f000 - cpx #15 932 f000 - bne savedifficultytableScores 933 f000 - rts 934 f000 - 935 f000 -loaddifficultytableHSC 936 f000 - ; routine responsible for loading the difficulty table from HSC 937 f000 - jsr findindexHSC 938 f000 - ldy hsgameslot 939 f000 - lda HSCGameDifficulty,y 940 f000 - cmp #$7F 941 f000 - bne loaddifficultytableHSCcontinue 942 f000 - ;there was an error. use a new RAM table instead... 943 f000 - jsr initializeHSCtableentry 944 f000 - jmp cleardifficultytablemem 945 f000 -loaddifficultytableHSCcontinue 946 f000 - ; parse the data into the HS memory... 947 f000 - ldy #0 948 f000 - ldx #0 949 f000 -loaddifficultytableScores 950 f000 - lda (HSGameTableLo),y 951 f000 - sta temp1 952 f000 - iny 953 f000 - lda (HSGameTableLo),y 954 f000 - sta temp2 955 f000 - jsr decodeHSCInitials ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 956 f000 - iny 957 f000 - lda (HSGameTableLo),y 958 f000 - sta HSRAMScores,x 959 f000 - lda temp3 960 f000 - sta HSRAMInitials,x 961 f000 - inx 962 f000 - iny 963 f000 - lda (HSGameTableLo),y 964 f000 - sta HSRAMScores,x 965 f000 - lda temp4 966 f000 - sta HSRAMInitials,x 967 f000 - inx 968 f000 - iny 969 f000 - lda (HSGameTableLo),y 970 f000 - sta HSRAMScores,x 971 f000 - lda temp5 972 f000 - sta HSRAMInitials,x 973 f000 - inx 974 f000 - iny 975 f000 - cpx #15 976 f000 - bne loaddifficultytableScores 977 f000 - rts 978 f000 - 979 f000 -decodeHSCInitials 980 f000 - ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 981 f000 - ; 2 bytes are packed in the form: 22211111 22_33333 982 f000 - lda #0 983 f000 - sta temp4 984 f000 - lda temp1 985 f000 - and #%00011111 986 f000 - sta temp3 987 f000 - 988 f000 - lda temp2 989 f000 - and #%00011111 990 f000 - sta temp5 991 f000 - 992 f000 - lda temp1 993 f000 - asl 994 f000 - rol temp4 995 f000 - asl 996 f000 - rol temp4 997 f000 - asl 998 f000 - rol temp4 999 f000 - lda temp2 1000 f000 - asl 1001 f000 - rol temp4 1002 f000 - asl 1003 f000 - rol temp4 1004 f000 - rts 1005 f000 -encodeHSCInitials 1006 f000 - ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 1007 f000 - ; 2 bytes are packed in the form: 22211111 22_33333 1008 f000 - ; start with packing temp1... 1009 f000 - lda temp4 1010 f000 - and #%00011100 1011 f000 - sta temp1 1012 f000 - asl temp1 1013 f000 - asl temp1 1014 f000 - asl temp1 1015 f000 - lda temp3 1016 f000 - and #%00011111 1017 f000 - ora temp1 1018 f000 - sta temp1 1019 f000 - ; ...temp1 is now packed, on to temp2... 1020 f000 - lda temp5 1021 f000 - asl 1022 f000 - asl 1023 f000 - ror temp4 1024 f000 - ror 1025 f000 - ror temp4 1026 f000 - ror 1027 f000 - sta temp2 1028 f000 - rts 1029 f000 - 1030 f000 -findindexHSCerror 1031 f000 - ;the HSC is stuffed. return the bad slot flag 1032 f000 - ldy #$ff 1033 f000 - sty hsgameslot 1034 f000 - rts 1035 f000 - 1036 f000 -findindexHSC 1037 f000 -HSCGameID1 = $1029 1038 f000 -HSCGameID2 = $106E 1039 f000 -HSCGameDifficulty = $10B3 1040 f000 -HSCGameIndex = $10F8 1041 f000 - ; routine responsible for finding the game index from HSC 1042 f000 - ; call with x=0 to create a new table if none exist, call with x=$ff to avoid creating new tables 1043 f000 - ; the HS loading routine will use x=$ff, the HS saving routine will use x=0 1044 f000 - ldy #69 ; start +1 to account for the dey 1045 f000 -findindexHSCloop 1046 f000 - dey 1047 f000 - bmi findindexHSCerror 1048 f000 - lda HSCGameDifficulty,y 1049 f000 - cmp #$7F 1050 f000 - beq findourindexHSC 1051 f000 - cmp gamedifficulty 1052 f000 - bne findindexHSCloop 1053 f000 - lda HSCGameID1,y 1054 f000 - cmp #HSIDHI 1055 f000 - bne findindexHSCloop 1056 f000 - lda HSCGameID2,y 1057 f000 - cmp #HSIDLO 1058 f000 - bne findindexHSCloop 1059 f000 -findourindexHSC 1060 f000 - ; if we're here we found our index in the table 1061 f000 - ; or we found the first empty one 1062 f000 - sty hsgameslot 1063 f000 - jsr setupHSCGamepointer ; setup the pointer to the HS Table for this game... 1064 f000 - rts 1065 f000 - 1066 f000 - 1067 f000 -initializeHSCtableentry 1068 f000 - ldy hsgameslot 1069 f000 - ; we need to make a new entry... 1070 f000 - lda #HSIDHI 1071 f000 - sta HSCGameID1,y 1072 f000 - lda #HSIDLO 1073 f000 - sta HSCGameID2,y 1074 f000 - lda gamedifficulty 1075 f000 - sta HSCGameDifficulty,y 1076 f000 - ldx #0 1077 f000 -fixHSDGameDifficultylistLoop 1078 f000 - inx 1079 f000 - txa 1080 f000 - sta HSCGameIndex,y 1081 f000 - iny 1082 f000 - cpy #69 1083 f000 - bne fixHSDGameDifficultylistLoop 1084 f000 - rts 1085 f000 - 1086 f000 -setupHSCGamepointer 1087 f000 - ; this routines sets (HSGameTableLo) pointing to the game's HS table 1088 f000 - lda #$17 1089 f000 - sta HSGameTableHi 1090 f000 - lda #$FA 1091 f000 - sta HSGameTableLo 1092 f000 -setupHSCGamepointerLoop 1093 f000 - lda HSGameTableLo 1094 f000 - sec 1095 f000 - sbc #25 1096 f000 - sta HSGameTableLo 1097 f000 - lda HSGameTableHi 1098 f000 - sbc #0 1099 f000 - sta HSGameTableHi 1100 f000 - iny 1101 f000 - cpy #69 1102 f000 - bne setupHSCGamepointerLoop 1103 f000 - rts 1104 f000 - 1105 f000 -loaddifficultytableAVOX 1106 f000 - ; routine responsible for loading the difficulty table from Avox 1107 f000 - ; we reuse HSC routines to format data to/from our Avox RAM buffer... 1108 f000 - lda #>(eeprombuffer+3) 1109 f000 - sta HSGameTableHi 1110 f000 - lda #<(eeprombuffer+3) 1111 f000 - sta HSGameTableLo 1112 f000 - 1113 f000 - ; the start location in EEPROM, subtract 32... 1114 f000 - lda #$5F 1115 f000 - sta HSVoxHi 1116 f000 - lda #$E0 1117 f000 - sta HSVoxLo 1118 f000 - lda #0 1119 f000 - sta temp1 1120 f000 -loaddifficultytableAVOXloop 1121 f000 - inc temp1 1122 f000 - beq loaddifficultytableAVOXfull 1123 f000 - clc 1124 f000 - lda HSVoxLo 1125 f000 - adc #32 1126 f000 - sta HSVoxLo 1127 f000 - lda HSVoxHi 1128 f000 - adc #0 1129 f000 - sta HSVoxHi 1130 f000 - lda #3 1131 f000 - jsr AVoxReadBytes ; read in 3 bytes, ID1,ID2,Difficulty 1132 f000 - lda eeprombuffer 1133 f000 - cmp #$FF 1134 f000 - beq loaddifficultytableAVOXempty 1135 f000 - cmp #HSIDHI 1136 f000 - bne loaddifficultytableAVOXloop 1137 f000 - lda eeprombuffer+1 1138 f000 - cmp #HSIDLO 1139 f000 - bne loaddifficultytableAVOXloop 1140 f000 - lda eeprombuffer+2 1141 f000 - cmp gamedifficulty 1142 f000 - bne loaddifficultytableAVOXloop 1143 f000 -loaddifficultytableAVOXdone 1144 f000 - lda #32 1145 f000 - jsr AVoxReadBytes 1146 f000 - jsr loaddifficultytableHSCcontinue 1147 f000 - rts 1148 f000 -loaddifficultytableAVOXfull 1149 f000 - lda #0 1150 f000 - sta hsdevice ; looks like all 255 entries are taken... disable it. 1151 f000 -loaddifficultytableAVOXempty 1152 f000 - jmp cleardifficultytablemem 1153 f000 - rts 1154 f000 - 1155 f000 -cleardifficultytablemem 1156 f000 - ldy #29 1157 f000 - lda #0 1158 f000 -cleardifficultytablememloop 1159 f000 - sta HSRAMTable,y 1160 f000 - dey 1161 f000 - bpl cleardifficultytablememloop 1162 f000 - rts 1163 f000 -hiscoremoduleend 1164 f000 - 1165 f000 - echo " hiscore assembly: ",[(hiscoremoduleend-hiscoremodulestart)]d," bytes" 1166 f000 - 1167 f000 - ifconst DOUBLEWIDE 1168 f000 -plotvaluedw 1169 f000 -plotdigitcount = temp6 1170 f000 - lda #0 1171 f000 - tay 1172 f000 - ldx valbufend 1173 f000 - 1174 f000 - lda plotdigitcount 1175 f000 - and #1 1176 f000 - beq pvnibble2chardw 1177 f000 - lda #0 1178 f000 - sta VALBUFFER,x ; just in case we skip this digit 1179 f000 - beq pvnibble2char_skipnibbledw 1180 f000 - 1181 f000 -pvnibble2chardw 1182 f000 - ; high nibble... 1183 f000 - lda (temp7),y 1184 f000 - and #$f0 1185 f000 - lsr 1186 f000 - lsr 1187 f000 - lsr 1188 f000 - lsr 1189 f000 - 1190 f000 - clc 1191 f000 - adc temp1 ; add the offset to character graphics to our value 1192 f000 - sta VALBUFFER,x 1193 f000 - inx 1194 f000 - dec plotdigitcount 1195 f000 -pvnibble2char_skipnibbledw 1196 f000 - ; low nibble... 1197 f000 - lda (temp7),y 1198 f000 - and #$0f 1199 f000 - clc 1200 f000 - adc temp1 ; add the offset to character graphics to our value 1201 f000 - sta VALBUFFER,x 1202 f000 - inx 1203 f000 - iny 1204 f000 - 1205 f000 - dec plotdigitcount 1206 f000 - bne pvnibble2chardw 1207 f000 - ;point to the start of our valuebuffer 1208 f000 - clc 1209 f000 - lda #VALBUFFER 1213 f000 - adc #0 1214 f000 - sta temp2 1215 f000 - 1216 f000 - ;advance valbufend to the end of our value buffer 1217 f000 - stx valbufend 1218 f000 - 1219 f000 - ifnconst plotvalueonscreen 1220 f000 - jmp plotcharacters 1221 f000 - else 1222 f000 - jmp plotcharacterslive 1223 f000 - endif 1224 f000 - endif ; DOUBLEWIDE 1225 f000 - 1226 f000 endif ; HSSUPPORT 1227 f000 ------- FILE c:\Users\Shane\Documents\my7800projects\platformer_demos\template\platformer_demo_v01.78b.asm 3958 f000 endif 3959 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 3960 f000 3961 f000 ;standard routimes needed for pretty much all games 3962 f000 3963 f000 ; some definitions used with "set debug color" 3964 f000 00 91 DEBUGCALC = $91 3965 f000 00 41 DEBUGWASTE = $41 3966 f000 00 c1 DEBUGDRAW = $C1 3967 f000 3968 f000 ;NMI and IRQ handlers 3969 f000 NMI 3970 f000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 3971 f000 48 pha ; save A 3972 f001 d8 cld 3973 f002 a5 4d lda visibleover 3974 f004 49 ff eor #255 3975 f006 85 4d sta visibleover 3976 f008 - ifconst DEBUGINTERRUPT 3977 f008 - and #$93 3978 f008 - sta BACKGRND 3979 f008 endif 3980 f008 8a txa ; save X 3981 f009 48 pha 3982 f00a 98 tya ; save Y 3983 f00b 48 pha 3984 f00c ce b2 01 dec interruptindex 3985 f00f d0 03 bne skipreallyoffvisible 3986 f011 4c 6b f0 jmp reallyoffvisible 3987 f014 skipreallyoffvisible 3988 f014 a5 4d lda visibleover 3989 f016 d0 03 bne carryontopscreenroutine 3990 f018 - ifconst .bottomscreenroutine 3991 f018 - lda interrupthold 3992 f018 - beq skipbottomroutine 3993 f018 - jsr .bottomscreenroutine 3994 f018 -skipbottomroutine 3995 f018 endif 3996 f018 4c 79 f0 jmp NMIexit 3997 f01b carryontopscreenroutine 3998 f01b - ifconst .topscreenroutine 3999 f01b - lda interrupthold 4000 f01b - beq skiptoproutine 4001 f01b - jsr .topscreenroutine 4002 f01b -skiptoproutine 4003 f01b endif 4004 f01b ifnconst CANARYOFF 4005 f01b ad c1 01 lda canary 4006 f01e f0 07 beq skipcanarytriggered 4007 f020 a9 45 lda #$45 4008 f022 85 20 sta BACKGRND 4009 f024 4c 63 f0 jmp skipbrkolorset ; common crash dump routine, if available 4010 f027 skipcanarytriggered 4011 f027 endif 4012 f027 4013 f027 ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 4014 f02a 4015 f02a ; ** Other important routines that need to regularly run, and can run onscreen. 4016 f02a ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 4017 f02a 4018 f02a - ifconst LONGCONTROLLERREAD 4019 f02a -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 4020 f02a - ldy port1control 4021 f02a - lda longreadtype,y 4022 f02a - beq LLRET1 4023 f02a - tay 4024 f02a - lda longreadroutinehiP1,y 4025 f02a - sta inttemp4 4026 f02a - lda longreadroutineloP1,y 4027 f02a - sta inttemp3 4028 f02a - jmp (inttemp3) 4029 f02a -LLRET1 4030 f02a - ldy port0control 4031 f02a - lda longreadtype,y 4032 f02a - beq LLRET0 4033 f02a - tay 4034 f02a - lda longreadroutinehiP0,y 4035 f02a - sta inttemp4 4036 f02a - lda longreadroutineloP0,y 4037 f02a - sta inttemp3 4038 f02a - jmp (inttemp3) 4039 f02a -LLRET0 4040 f02a - 4041 f02a - 4042 f02a - ifconst PADDLERANGE 4043 f02a -TIMEVAL = PADDLERANGE 4044 f02a - else 4045 f02a -TIMEVAL = 160 4046 f02a - endif 4047 f02a -TIMEOFFSET = 10 4048 f02a - 4049 f02a endif ; LONGCONTROLLERREAD 4050 f02a 4051 f02a 4052 f02a 20 d8 f1 jsr servicesfxchannels 4053 f02d - ifconst MUSICTRACKER 4054 f02d - jsr servicesong 4055 f02d endif ; MUSICTRACKER 4056 f02d 4057 f02d ee a4 01 inc framecounter 4058 f030 ad a4 01 lda framecounter 4059 f033 29 3f and #63 4060 f035 d0 08 bne skipcountdownseconds 4061 f037 ad a5 01 lda countdownseconds 4062 f03a f0 03 beq skipcountdownseconds 4063 f03c ce a5 01 dec countdownseconds 4064 f03f skipcountdownseconds 4065 f03f 4066 f03f a2 01 ldx #1 4067 f041 buttonreadloop 4068 f041 8a txa 4069 f042 48 pha 4070 f043 bc b7 01 ldy port0control,x 4071 f046 b9 bb f1 lda buttonhandlerlo,y 4072 f049 85 da sta inttemp3 4073 f04b b9 b0 f1 lda buttonhandlerhi,y 4074 f04e 85 db sta inttemp4 4075 f050 05 da ora inttemp3 4076 f052 f0 03 beq buttonreadloopreturn 4077 f054 6c da 00 jmp (inttemp3) 4078 f057 buttonreadloopreturn 4079 f057 68 pla 4080 f058 aa tax 4081 f059 ca dex 4082 f05a 10 e5 bpl buttonreadloop 4083 f05c 4084 f05c - ifconst KEYPADSUPPORT 4085 f05c - jsr keypadrowselect 4086 f05c endif ; KEYPADSUPPORT 4087 f05c 4088 f05c 4089 f05c - ifconst DOUBLEBUFFER 4090 f05c - lda doublebufferminimumframeindex 4091 f05c - beq skipdoublebufferminimumframeindexadjust 4092 f05c - dec doublebufferminimumframeindex 4093 f05c -skipdoublebufferminimumframeindexadjust 4094 f05c endif 4095 f05c 4096 f05c 4c 79 f0 jmp NMIexit 4097 f05f 4098 f05f IRQ ; the only source of non-nmi interrupt should be the BRK opcode. 4099 f05f ifnconst BREAKPROTECTOFF 4100 f05f a9 1a lda #$1A 4101 f061 85 20 sta BACKGRND 4102 f063 skipbrkolorset 4103 f063 skipbrkdetected 4104 f063 a9 60 lda #$60 4105 f065 8d 07 21 sta sCTRL 4106 f068 85 3c sta CTRL 4107 f06a ifnconst hiscorefont 4108 f06a 02 .byte.b $02 ; KIL/JAM 4109 f06b - else ; hiscorefont is present 4110 f06b - ifconst CRASHDUMP 4111 f06b - bit MSTAT 4112 f06b - bpl skipbrkdetected ; wait for vblank to ensure we're clear of NMI 4113 f06b - 4114 f06b - ifconst dumpbankswitch 4115 f06b - lda dumpbankswitch 4116 f06b - pha 4117 f06b - endif 4118 f06b - 4119 f06b - ; bankswitch if needed, to get to the hiscore font 4120 f06b - ifconst bankswitchmode 4121 f06b - ifconst included.hiscore.asm.bank 4122 f06b - ifconst MCPDEVCART 4123 f06b - lda #($18 | included.hiscore.asm.bank) 4124 f06b - sta $3000 4125 f06b - else 4126 f06b - lda #(included.hiscore.asm.bank) 4127 f06b - sta $8000 4128 f06b - endif 4129 f06b - endif ; included.hiscore.asm.bank 4130 f06b - endif ; bankswitchmode 4131 f06b - 4132 f06b - ifconst DOUBLEBUFFER 4133 f06b - ;turn off double-buffering, if on... 4134 f06b - lda #>DLLMEM 4135 f06b - sta DPPH 4136 f06b - lda #hiscorefont 4180 f06b - sta CHARBASE 4181 f06b - sta sCHARBASE 4182 f06b - lda #%01000011 ;Enable DMA, mode=320A 4183 f06b - sta CTRL 4184 f06b - sta sCTRL 4185 f06b - .byte $02 ; KIL/JAM 4186 f06b -hiscorehexlut 4187 f06b - ; 0 1 2 3 4 5 6 7 8 9 A B C D E F 4188 f06b - .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 4189 f06b -show2700 4190 f06b - ; lo mode hi width=29 x EODL 4191 f06b - .byte $00, %01100000, $27, 3, 20, 0,0,0 4192 f06b - else ; CRASHDUMP 4193 f06b - .byte $02 ; KIL/JAM 4194 f06b - endif ; crashdump 4195 f06b endif ; hiscorefont 4196 f06b - else 4197 f06b - RTI 4198 f06b endif 4199 f06b 4200 f06b - ifconst LONGCONTROLLERREAD 4201 f06b - 4202 f06b -longreadtype 4203 f06b - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 4204 f06b - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 4205 f06b - .byte 3, 3, 0 ; STMOUSE AMOUSE ATARIVOX 4206 f06b - 4207 f06b -longreadroutineloP0 4208 f06b - .byte LLRET0 ; 0 = no routine 4215 f06b - .byte >paddleport0update ; 1 = paddle 4216 f06b - .byte >trakball0update ; 2 = trackball 4217 f06b - .byte >mouse0update ; 3 = mouse 4218 f06b - 4219 f06b -longreadroutineloP1 4220 f06b - .byte LLRET1 ; 0 = no routine 4227 f06b - .byte >paddleport1update ; 1 = paddle 4228 f06b - .byte >trakball1update ; 2 = trackball 4229 f06b - .byte >mouse1update ; 3 = mouse 4230 f06b - 4231 f06b - 4232 f06b -SETTIM64T 4233 f06b - bne skipdefaulttime 4234 f06b - ifnconst PADDLESMOOTHINGOFF 4235 f06b - lda #(TIMEVAL+TIMEOFFSET+1) 4236 f06b - else 4237 f06b - lda #(TIMEVAL+TIMEOFFSET) 4238 f06b - endif 4239 f06b -skipdefaulttime 4240 f06b - tay 4241 f06b - dey 4242 f06b -.setTIM64Tloop 4243 f06b - sta TIM64T 4244 f06b - cpy INTIM 4245 f06b - bne .setTIM64Tloop 4246 f06b - rts 4247 f06b endif ; LONGCONTROLLERREAD 4248 f06b 4249 f06b reallyoffvisible 4250 f06b 85 24 sta WSYNC 4251 f06d 4252 f06d a9 00 lda #0 4253 f06f 85 4d sta visibleover 4254 f071 - ifconst DEBUGINTERRUPT 4255 f071 - sta BACKGRND 4256 f071 endif 4257 f071 4258 f071 a9 03 lda #3 4259 f073 8d b2 01 sta interruptindex 4260 f076 4261 f076 20 52 f1 jsr uninterruptableroutines 4262 f079 4263 f079 - ifconst .userinterrupt 4264 f079 - lda interrupthold 4265 f079 - beq skipuserintroutine 4266 f079 - jsr .userinterrupt 4267 f079 -skipuserintroutine 4268 f079 endif 4269 f079 4270 f079 - ifconst KEYPADSUPPORT 4271 f079 - jsr keypadcolumnread 4272 f079 endif 4273 f079 4274 f079 NMIexit 4275 f079 68 pla 4276 f07a a8 tay 4277 f07b 68 pla 4278 f07c aa tax 4279 f07d 68 pla 4280 f07e 40 RTI 4281 f07f 4282 f07f clearscreen 4283 f07f a2 17 ldx #(WZONECOUNT-1) 4284 f081 a9 00 lda #0 4285 f083 clearscreenloop 4286 f083 95 65 sta dlend,x 4287 f085 ca dex 4288 f086 10 fb bpl clearscreenloop 4289 f088 a9 00 lda #0 4290 f08a 8d ad 01 sta valbufend ; clear the bcd value buffer 4291 f08d 8d ae 01 sta valbufendsave 4292 f090 60 rts 4293 f091 4294 f091 restorescreen 4295 f091 a2 17 ldx #(WZONECOUNT-1) 4296 f093 a9 00 lda #0 4297 f095 restorescreenloop 4298 f095 b5 82 lda dlendsave,x 4299 f097 95 65 sta dlend,x 4300 f099 ca dex 4301 f09a 10 f9 bpl restorescreenloop 4302 f09c ad ae 01 lda valbufendsave 4303 f09f 8d ad 01 sta valbufend 4304 f0a2 60 rts 4305 f0a3 4306 f0a3 savescreen 4307 f0a3 a2 17 ldx #(WZONECOUNT-1) 4308 f0a5 savescreenloop 4309 f0a5 b5 65 lda dlend,x 4310 f0a7 95 82 sta dlendsave,x 4311 f0a9 ca dex 4312 f0aa 10 f9 bpl savescreenloop 4313 f0ac ad ad 01 lda valbufend 4314 f0af 8d ae 01 sta valbufendsave 4315 f0b2 - ifconst DOUBLEBUFFER 4316 f0b2 - lda doublebufferstate 4317 f0b2 - beq savescreenrts 4318 f0b2 - lda #1 4319 f0b2 - sta doublebufferbufferdirty 4320 f0b2 -savescreenrts 4321 f0b2 endif ; DOUBLEBUFFER 4322 f0b2 60 rts 4323 f0b3 4324 f0b3 drawscreen 4325 f0b3 4326 f0b3 - ifconst interrupthold 4327 f0b3 - lda #$FF 4328 f0b3 - sta interrupthold ; if the user called drawscreen, we're ready for interrupts 4329 f0b3 endif 4330 f0b3 4331 f0b3 a9 00 lda #0 4332 f0b5 85 42 sta temp1 ; not B&W if we're here... 4333 f0b7 4334 f0b7 drawscreenwait 4335 f0b7 a5 4d lda visibleover 4336 f0b9 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 4337 f0bb 4338 f0bb ;restore some registers in case the game changed them mid-screen... 4339 f0bb ad 07 21 lda sCTRL 4340 f0be 05 42 ora temp1 4341 f0c0 85 3c sta CTRL 4342 f0c2 ad 0b 21 lda sCHARBASE 4343 f0c5 85 34 sta CHARBASE 4344 f0c7 4345 f0c7 ;ensure all of the display list is terminated... 4346 f0c7 20 38 f1 jsr terminatedisplaylist 4347 f0ca 4348 f0ca ifnconst pauseroutineoff 4349 f0ca 20 d5 f0 jsr pauseroutine 4350 f0cd endif ; pauseroutineoff 4351 f0cd 4352 f0cd ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 4353 f0cd ; delaying a full frame, but still allowing time for basic calculations. 4354 f0cd visiblescreenstartedwait 4355 f0cd a5 4d lda visibleover 4356 f0cf f0 fc beq visiblescreenstartedwait 4357 f0d1 visiblescreenstartedwaitdone 4358 f0d1 ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 4359 f0d4 60 rts 4360 f0d5 4361 f0d5 ifnconst pauseroutineoff 4362 f0d5 ; check to see if pause was pressed and released 4363 f0d5 pauseroutine 4364 f0d5 ad b3 01 lda pausedisable 4365 f0d8 d0 4e bne leavepauseroutine 4366 f0da a9 08 lda #8 4367 f0dc 2c 82 02 bit SWCHB 4368 f0df f0 29 beq pausepressed 4369 f0e1 4370 f0e1 ifnconst SOFTRESETASPAUSEOFF 4371 f0e1 ifnconst MOUSESUPPORT 4372 f0e1 ifnconst TRAKBALLSUPPORT 4373 f0e1 ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 4374 f0e4 29 70 and #%01110000 ; _LDU 4375 f0e6 f0 22 beq pausepressed 4376 f0e8 endif 4377 f0e8 endif 4378 f0e8 endif 4379 f0e8 4380 f0e8 ;pause isn't pressed 4381 f0e8 a9 00 lda #0 4382 f0ea 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 4383 f0ed 4384 f0ed ;check if we're in an already paused state 4385 f0ed ad 00 21 lda pausestate 4386 f0f0 f0 36 beq leavepauseroutine ; nope, leave 4387 f0f2 4388 f0f2 c9 01 cmp #1 ; last frame was the start of pausing 4389 f0f4 f0 2b beq enterpausestate2 ; move from state 1 to 2 4390 f0f6 4391 f0f6 c9 02 cmp #2 4392 f0f8 f0 34 beq carryonpausing 4393 f0fa 4394 f0fa ;pausestate must be >2, which means we're ending an unpause 4395 f0fa a9 00 lda #0 4396 f0fc 8d ac 01 sta pausebuttonflag 4397 f0ff 8d 00 21 sta pausestate 4398 f102 ad 07 21 lda sCTRL 4399 f105 85 3c sta CTRL 4400 f107 4c 28 f1 jmp leavepauseroutine 4401 f10a 4402 f10a pausepressed 4403 f10a ;pause is pressed 4404 f10a ad ac 01 lda pausebuttonflag 4405 f10d c9 ff cmp #$ff 4406 f10f f0 1d beq carryonpausing 4407 f111 4408 f111 ;its a new press, increment the state 4409 f111 ee 00 21 inc pausestate 4410 f114 4411 f114 ;silence volume at the start and end of pausing 4412 f114 a9 00 lda #0 4413 f116 85 19 sta AUDV0 4414 f118 85 1a sta AUDV1 4415 f11a 4416 f11a - ifconst pokeysupport 4417 f11a - ldy #7 4418 f11a -pausesilencepokeyaudioloop 4419 f11a - sta (pokeybase),y 4420 f11a - dey 4421 f11a - bpl pausesilencepokeyaudioloop 4422 f11a endif ; pokeysupport 4423 f11a 4424 f11a a9 ff lda #$ff 4425 f11c 8d ac 01 sta pausebuttonflag 4426 f11f d0 0d bne carryonpausing 4427 f121 4428 f121 enterpausestate2 4429 f121 a9 02 lda #2 4430 f123 8d 00 21 sta pausestate 4431 f126 d0 06 bne carryonpausing 4432 f128 leavepauseroutine 4433 f128 ad 07 21 lda sCTRL 4434 f12b 85 3c sta CTRL 4435 f12d 60 rts 4436 f12e carryonpausing 4437 f12e - ifconst .pause 4438 f12e - jsr .pause 4439 f12e endif ; .pause 4440 f12e ad 07 21 lda sCTRL 4441 f131 09 80 ora #%10000000 ; turn off colorburst during pause... 4442 f133 85 3c sta CTRL 4443 f135 4c d5 f0 jmp pauseroutine 4444 f138 endif ; pauseroutineoff 4445 f138 4446 f138 4447 f138 - ifconst DOUBLEBUFFER 4448 f138 -skipterminatedisplaylistreturn 4449 f138 - rts 4450 f138 endif ; DOUBLEBUFFER 4451 f138 terminatedisplaylist 4452 f138 - ifconst DOUBLEBUFFER 4453 f138 - lda doublebufferstate 4454 f138 - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 4455 f138 endif ; DOUBLEBUFFER 4456 f138 terminatedisplaybuffer 4457 f138 ;add DL end entry on each DL 4458 f138 a2 17 ldx #(WZONECOUNT-1) 4459 f13a dlendloop 4460 f13a bd d1 f5 lda DLPOINTL,x 4461 f13d - ifconst DOUBLEBUFFER 4462 f13d - clc 4463 f13d - adc doublebufferdloffset 4464 f13d endif ; DOUBLEBUFFER 4465 f13d 85 63 sta dlpnt 4466 f13f bd b9 f5 lda DLPOINTH,x 4467 f142 - ifconst DOUBLEBUFFER 4468 f142 - adc #0 4469 f142 endif ; DOUBLEBUFFER 4470 f142 85 64 sta dlpnt+1 4471 f144 b4 65 ldy dlend,x 4472 f146 a9 00 lda #$00 4473 f148 dlendmoreloops 4474 f148 c8 iny 4475 f149 91 63 sta (dlpnt),y 4476 f14b - ifconst FRAMESKIPGLITCHFIXWEAK 4477 f14b - cpy #DLLASTOBJ+1 4478 f14b - beq dlendthiszonedone 4479 f14b - iny 4480 f14b - iny 4481 f14b - iny 4482 f14b - iny 4483 f14b - iny 4484 f14b - sta (dlpnt),y 4485 f14b -dlendthiszonedone 4486 f14b endif FRAMESKIPGLITCHFIXWEAK 4487 f14b - ifconst FRAMESKIPGLITCHFIX 4488 f14b - iny 4489 f14b - iny 4490 f14b - iny 4491 f14b - iny 4492 f14b - cpy #DLLASTOBJ-1 4493 f14b - bcc dlendmoreloops 4494 f14b endif ; FRAMESKIPGLITCHFIX 4495 f14b ca dex 4496 f14c 10 ec bpl dlendloop 4497 f14e 4498 f14e ifnconst pauseroutineoff 4499 f14e 20 d5 f0 jsr pauseroutine 4500 f151 endif ; pauseroutineoff 4501 f151 60 rts 4502 f152 4503 f152 uninterruptableroutines 4504 f152 ; this is for routines that must happen off the visible screen, each frame. 4505 f152 4506 f152 - ifconst AVOXVOICE 4507 f152 - jsr serviceatarivoxqueue 4508 f152 endif 4509 f152 4510 f152 a9 00 lda #0 4511 f154 8d b6 01 sta palfastframe 4512 f157 ad 09 21 lda paldetected 4513 f15a f0 10 beq skippalframeadjusting 4514 f15c ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 4515 f15c ae b5 01 ldx palframes 4516 f15f e8 inx 4517 f160 e0 05 cpx #5 4518 f162 d0 05 bne palframeskipdone 4519 f164 ee b6 01 inc palfastframe 4520 f167 a2 00 ldx #0 4521 f169 palframeskipdone 4522 f169 8e b5 01 stx palframes 4523 f16c skippalframeadjusting 4524 f16c 4525 f16c - ifconst MUSICTRACKER 4526 f16c - ; We normally run the servicesong routine from the top-screen interrupt, but if it 4527 f16c - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 4528 f16c - ; If that happens, we try again here. Chances are very small we'll run into the same 4529 f16c - ; problem twice, and if we do, we just drop a musical note or two. 4530 f16c - lda sfxschedulemissed 4531 f16c - beq servicesongwasnotmissed 4532 f16c - jsr servicesong 4533 f16c -servicesongwasnotmissed 4534 f16c endif ; MUSICTRACKER 4535 f16c 4536 f16c 60 rts 4537 f16d 4538 f16d serviceatarivoxqueue 4539 f16d - ifconst AVOXVOICE 4540 f16d - lda voxlock 4541 f16d - bne skipvoxprocessing ; the vox is in the middle of speech address update 4542 f16d -skipvoxqueuesizedec 4543 f16d - jmp processavoxvoice 4544 f16d -skipvoxprocessing 4545 f16d - rts 4546 f16d - 4547 f16d -processavoxvoice 4548 f16d - lda avoxenable 4549 f16d - bne avoxfixport 4550 f16d - SPKOUT tempavox 4551 f16d - rts 4552 f16d -avoxfixport 4553 f16d - lda #0 ; restore the port to all bits as inputs... 4554 f16d - sta CTLSWA 4555 f16d - rts 4556 f16d -silenceavoxvoice 4557 f16d - SPEAK avoxsilentdata 4558 f16d - rts 4559 f16d -avoxsilentdata 4560 f16d - .byte 31,255 4561 f16d else 4562 f16d 60 rts 4563 f16e endif ; AVOXVOICE 4564 f16e 4565 f16e joybuttonhandler 4566 f16e 8a txa 4567 f16f 0a asl 4568 f170 a8 tay 4569 f171 b9 08 00 lda INPT0,y 4570 f174 4a lsr 4571 f175 9d 02 21 sta sINPT1,x 4572 f178 b9 09 00 lda INPT1,y 4573 f17b 29 80 and #%10000000 4574 f17d 1d 02 21 ora sINPT1,x 4575 f180 9d 02 21 sta sINPT1,x 4576 f183 4577 f183 b5 0c lda INPT4,x 4578 f185 30 19 bmi .skip1bjoyfirecheck 4579 f187 ;one button joystick is down 4580 f187 49 80 eor #%10000000 4581 f189 9d 02 21 sta sINPT1,x 4582 f18c 4583 f18c ad b1 01 lda joybuttonmode 4584 f18f 3d a3 f1 and twobuttonmask,x 4585 f192 f0 0c beq .skip1bjoyfirecheck 4586 f194 ad b1 01 lda joybuttonmode 4587 f197 1d a3 f1 ora twobuttonmask,x 4588 f19a 8d b1 01 sta joybuttonmode 4589 f19d 8d 82 02 sta SWCHB 4590 f1a0 .skip1bjoyfirecheck 4591 f1a0 4c 57 f0 jmp buttonreadloopreturn 4592 f1a3 4593 f1a3 twobuttonmask 4594 f1a3 04 10 .byte.b %00000100,%00010000 4595 f1a5 4596 f1a5 gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 4597 f1a5 - ifconst LIGHTGUNSUPPORT 4598 f1a5 - cpx #0 4599 f1a5 - bne secondportgunhandler 4600 f1a5 -firstportgunhandler 4601 f1a5 - lda SWCHA 4602 f1a5 - asl 4603 f1a5 - asl 4604 f1a5 - asl ; shift D4 to D7 4605 f1a5 - and #%10000000 4606 f1a5 - eor #%10000000 4607 f1a5 - sta sINPT1 4608 f1a5 - jmp buttonreadloopreturn 4609 f1a5 -secondportgunhandler 4610 f1a5 - lda SWCHA 4611 f1a5 - lsr ; shift D0 into carry 4612 f1a5 - lsr ; shift carry into D7 4613 f1a5 - and #%10000000 4614 f1a5 - eor #%10000000 4615 f1a5 - sta sINPT3 4616 f1a5 - jmp buttonreadloopreturn 4617 f1a5 endif ; LIGHTGUNSUPPORT 4618 f1a5 4619 f1a5 controlsusing2buttoncode 4620 f1a5 00 .byte.b 0 ; 00=no controller plugged in 4621 f1a6 01 .byte.b 1 ; 01=proline joystick 4622 f1a7 00 .byte.b 0 ; 02=lightgun 4623 f1a8 00 .byte.b 0 ; 03=paddle 4624 f1a9 01 .byte.b 1 ; 04=trakball 4625 f1aa 01 .byte.b 1 ; 05=vcs joystick 4626 f1ab 01 .byte.b 1 ; 06=driving control 4627 f1ac 00 .byte.b 0 ; 07=keypad control 4628 f1ad 00 .byte.b 0 ; 08=st mouse/cx80 4629 f1ae 00 .byte.b 0 ; 09=amiga mouse 4630 f1af 01 .byte.b 1 ; 10=atarivox 4631 f1b0 4632 f1b0 buttonhandlerhi 4633 f1b0 00 .byte.b 0 ; 00=no controller plugged in 4634 f1b1 f1 .byte.b >joybuttonhandler ; 01=proline joystick 4635 f1b2 f1 .byte.b >gunbuttonhandler ; 02=lightgun 4636 f1b3 f4 .byte.b >paddlebuttonhandler ; 03=paddle 4637 f1b4 f1 .byte.b >joybuttonhandler ; 04=trakball 4638 f1b5 f1 .byte.b >joybuttonhandler ; 05=vcs joystick 4639 f1b6 f1 .byte.b >joybuttonhandler ; 06=driving control 4640 f1b7 00 .byte.b 0 ; 07=keypad 4641 f1b8 f4 .byte.b >mousebuttonhandler ; 08=st mouse 4642 f1b9 f4 .byte.b >mousebuttonhandler ; 09=amiga mouse 4643 f1ba f1 .byte.b >joybuttonhandler ; 10=atarivox 4644 f1bb buttonhandlerlo 4645 f1bb 00 .byte.b 0 ; 00=no controller plugged in 4646 f1bc 6e .byte.b $0F means the sound is looped while priority is active 4747 f219 4748 f219 05 d9 ora inttemp2 4749 f21b 05 d8 ora inttemp1 ; check if F|C|V=0 4750 f21d f0 23 beq zerosfx ; if so, we're at the end of the sound. 4751 f21f 4752 f21f advancesfxpointer 4753 f21f ; advance the pointer to the next sound chunk 4754 f21f c8 iny 4755 f220 84 da sty inttemp3 4756 f222 18 clc 4757 f223 b5 4e lda sfx1pointlo,x 4758 f225 65 da adc inttemp3 4759 f227 95 4e sta sfx1pointlo,x 4760 f229 b5 50 lda sfx1pointhi,x 4761 f22b 69 00 adc #0 4762 f22d 95 50 sta sfx1pointhi,x 4763 f22f 4c da f1 jmp servicesfxchannelsloop 4764 f232 4765 f232 sfxsoundloop 4766 f232 48 pha 4767 f233 b5 52 lda sfx1priority,x 4768 f235 d0 04 bne sfxsoundloop_carryon 4769 f237 68 pla ; fix the stack before we go 4770 f238 4c 1f f2 jmp advancesfxpointer 4771 f23b sfxsoundloop_carryon 4772 f23b 68 pla 4773 f23c 29 f0 and #$F0 4774 f23e 4a lsr 4775 f23f 4a lsr 4776 f240 4a lsr 4777 f241 4a lsr 4778 f242 4779 f242 zerosfx 4780 f242 95 4e sta sfx1pointlo,x 4781 f244 95 50 sta sfx1pointhi,x 4782 f246 95 52 sta sfx1priority,x 4783 f248 4c da f1 jmp servicesfxchannelsloop 4784 f24b 4785 f24b 4786 f24b schedulesfx 4787 f24b ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 4788 f24b a0 00 ldy #0 4789 f24d b1 e0 lda (sfxinstrumentlo),y 4790 f24f - ifconst pokeysupport 4791 f24f - cmp #$20 ; POKEY? 4792 f24f - bne scheduletiasfx 4793 f24f - jmp schedulepokeysfx 4794 f24f endif 4795 f24f scheduletiasfx 4796 f24f ;cmp #$10 ; TIA? 4797 f24f ;beq continuescheduletiasfx 4798 f24f ; rts ; unhandled!!! 4799 f24f continuescheduletiasfx 4800 f24f ifnconst TIASFXMONO 4801 f24f a5 4e lda sfx1pointlo 4802 f251 05 50 ora sfx1pointhi 4803 f253 f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 4804 f255 a5 4f lda sfx2pointlo 4805 f257 05 51 ora sfx2pointhi 4806 f259 f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 4807 f25b ; Both channels are scheduled. 4808 f25b a0 01 ldy #1 4809 f25d b1 e0 lda (sfxinstrumentlo),y 4810 f25f d0 01 bne interruptsfx 4811 f261 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 4812 f262 interruptsfx 4813 f262 ;Compare which active sound has a lower priority. We'll interrupt the lower one. 4814 f262 a5 52 lda sfx1priority 4815 f264 c5 53 cmp sfx2priority 4816 f266 b0 04 bcs schedulesfx2 4817 f268 endif ; !TIASFXMONO 4818 f268 4819 f268 schedulesfx1 4820 f268 a2 00 ldx #0 ; channel 1 4821 f26a ifnconst TIASFXMONO 4822 f26a f0 02 beq skipschedulesfx2 4823 f26c schedulesfx2 4824 f26c a2 01 ldx #1 ; channel 2 4825 f26e skipschedulesfx2 4826 f26e endif ; !TIASFXMONO 4827 f26e 4828 f26e - ifconst MUSICTRACKER 4829 f26e - lda sfxnoteindex 4830 f26e - bpl skipdrumkitoverride 4831 f26e - and #$7F ; subtract 128 4832 f26e - sec 4833 f26e - sbc #4 ; drums start at 132, i.e. octave 10 4834 f26e - asl 4835 f26e - tay 4836 f26e - lda tiadrumkitdefinition,y 4837 f26e - sta sfxinstrumentlo 4838 f26e - iny 4839 f26e - lda tiadrumkitdefinition,y 4840 f26e - sta sfxinstrumenthi 4841 f26e - lda #0 4842 f26e - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 4843 f26e -skipdrumkitoverride 4844 f26e endif ; MUSICTRACKER 4845 f26e a0 01 ldy #1 ; get priority and sound-resolution (in frames) 4846 f270 b1 e0 lda (sfxinstrumentlo),y 4847 f272 95 52 sta sfx1priority,x 4848 f274 c8 iny 4849 f275 b1 e0 lda (sfxinstrumentlo),y 4850 f277 95 56 sta sfx1frames,x 4851 f279 a5 e0 lda sfxinstrumentlo 4852 f27b 18 clc 4853 f27c 69 03 adc #3 4854 f27e 95 4e sta sfx1pointlo,x 4855 f280 a5 e1 lda sfxinstrumenthi 4856 f282 69 00 adc #0 4857 f284 95 50 sta sfx1pointhi,x 4858 f286 a5 e2 lda sfxpitchoffset 4859 f288 95 54 sta sfx1poffset,x 4860 f28a a9 00 lda #0 4861 f28c 95 58 sta sfx1tick,x 4862 f28e a5 e3 lda sfxnoteindex 4863 f290 95 cd sta sfx1notedata,x 4864 f292 60 rts 4865 f293 4866 f293 plotsprite 4867 f293 ifnconst NODRAWWAIT 4868 f293 - ifconst DOUBLEBUFFER 4869 f293 - lda doublebufferstate 4870 f293 - bne skipplotspritewait 4871 f293 endif ; DOUBLEBUFFER 4872 f293 - ifconst DEBUGWAITCOLOR 4873 f293 - lda #$41 4874 f293 - sta BACKGRND 4875 f293 endif 4876 f293 plotspritewait 4877 f293 a5 4d lda visibleover 4878 f295 d0 fc bne plotspritewait 4879 f297 skipplotspritewait 4880 f297 - ifconst DEBUGWAITCOLOR 4881 f297 - lda #$0 4882 f297 - sta BACKGRND 4883 f297 endif 4884 f297 endif 4885 f297 4886 f297 ;arguments: 4887 f297 ; temp1=lo graphicdata 4888 f297 ; temp2=hi graphicdata 4889 f297 ; temp3=palette | width byte 4890 f297 ; temp4=x 4891 f297 ; temp5=y 4892 f297 ; temp6=mode 4893 f297 a5 46 lda temp5 ;Y position 4894 f299 4a lsr ; 2 - Divide by 8 or 16 4895 f29a 4a lsr ; 2 4896 f29b 4a lsr ; 2 4897 f29c - if WZONEHEIGHT = 16 4898 f29c - lsr ; 2 4899 f29c endif 4900 f29c 4901 f29c aa tax 4902 f29d 4903 f29d ifnconst NOLIMITCHECKING 4904 f29d 4905 f29d ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 4906 f29d 4907 f29d c9 18 cmp #WZONECOUNT 4908 f29f 4909 f29f 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 4910 f2a1 ; otherwise, check to see if the bottom half is in zone 0... 4911 f2a1 4912 f2a1 - if WZONEHEIGHT = 16 4913 f2a1 - cmp #15 4914 f2a1 else 4915 f2a1 c9 1f cmp #31 4916 f2a3 endif 4917 f2a3 4918 f2a3 d0 05 bne exitplotsprite1 4919 f2a5 a2 00 ldx #0 4920 f2a7 4c e4 f2 jmp continueplotsprite2 4921 f2aa exitplotsprite1 4922 f2aa 60 rts 4923 f2ab 4924 f2ab continueplotsprite1 4925 f2ab endif 4926 f2ab 4927 f2ab bd d1 f5 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 4928 f2ae - ifconst DOUBLEBUFFER 4929 f2ae - clc 4930 f2ae - adc doublebufferdloffset 4931 f2ae endif ; DOUBLEBUFFER 4932 f2ae 85 63 sta dlpnt 4933 f2b0 bd b9 f5 lda DLPOINTH,x 4934 f2b3 - ifconst DOUBLEBUFFER 4935 f2b3 - adc #0 4936 f2b3 endif ; DOUBLEBUFFER 4937 f2b3 85 64 sta dlpnt+1 4938 f2b5 4939 f2b5 ;Create DL entry for upper part of sprite 4940 f2b5 4941 f2b5 b4 65 ldy dlend,x ;Get the index to the end of this DL 4942 f2b7 4943 f2b7 ifconst CHECKOVERWRITE 4944 f2b7 c0 4b cpy #DLLASTOBJ 4945 f2b9 f0 21 beq checkcontinueplotsprite2 4946 f2bb continueplotsprite1a 4947 f2bb endif 4948 f2bb 4949 f2bb a5 42 lda temp1 ; graphic data, lo byte 4950 f2bd 91 63 sta (dlpnt),y ;Low byte of data address 4951 f2bf 4952 f2bf ifnconst ATOMICSPRITEUPDATE 4953 f2bf c8 iny 4954 f2c0 a5 47 lda temp6 4955 f2c2 91 63 sta (dlpnt),y 4956 f2c4 - else 4957 f2c4 - iny 4958 f2c4 - sty temp8 4959 f2c4 endif 4960 f2c4 4961 f2c4 c8 iny 4962 f2c5 4963 f2c5 a5 46 lda temp5 ;Y position 4964 f2c7 29 07 and #(WZONEHEIGHT - 1) 4965 f2c9 c9 01 cmp #1 ; clear carry if our sprite is just in this zone 4966 f2cb 05 43 ora temp2 ; graphic data, hi byte 4967 f2cd 91 63 sta (dlpnt),y 4968 f2cf 4969 f2cf 4970 f2cf c8 iny 4971 f2d0 a5 44 lda temp3 ;palette|width 4972 f2d2 91 63 sta (dlpnt),y 4973 f2d4 4974 f2d4 c8 iny 4975 f2d5 a5 45 lda temp4 ;Horizontal position 4976 f2d7 91 63 sta (dlpnt),y 4977 f2d9 4978 f2d9 c8 iny 4979 f2da 94 65 sty dlend,x 4980 f2dc 4981 f2dc - ifconst ALWAYSTERMINATE 4982 f2dc - iny 4983 f2dc - lda #0 4984 f2dc - sta (dlpnt),y 4985 f2dc endif 4986 f2dc 4987 f2dc - ifconst ATOMICSPRITEUPDATE 4988 f2dc - ldy temp8 4989 f2dc - lda temp6 4990 f2dc - sta (dlpnt),y 4991 f2dc endif 4992 f2dc 4993 f2dc checkcontinueplotsprite2 4994 f2dc 4995 f2dc 90 38 bcc doneSPDL ;branch if the sprite was fully in the last zone 4996 f2de 4997 f2de ;Create DL entry for lower part of sprite 4998 f2de 4999 f2de e8 inx ;Next region 5000 f2df 5001 f2df ifnconst NOLIMITCHECKING 5002 f2df e0 18 cpx #WZONECOUNT 5003 f2e1 5004 f2e1 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 5005 f2e3 60 rts 5006 f2e4 continueplotsprite2 5007 f2e4 endif 5008 f2e4 5009 f2e4 bd d1 f5 lda DLPOINTL,x ;Get pointer to next DL 5010 f2e7 - ifconst DOUBLEBUFFER 5011 f2e7 - clc 5012 f2e7 - adc doublebufferdloffset 5013 f2e7 endif ; DOUBLEBUFFER 5014 f2e7 85 63 sta dlpnt 5015 f2e9 bd b9 f5 lda DLPOINTH,x 5016 f2ec - ifconst DOUBLEBUFFER 5017 f2ec - adc #0 5018 f2ec endif ; DOUBLEBUFFER 5019 f2ec 85 64 sta dlpnt+1 5020 f2ee b4 65 ldy dlend,x ;Get the index to the end of this DL 5021 f2f0 5022 f2f0 ifconst CHECKOVERWRITE 5023 f2f0 c0 4b cpy #DLLASTOBJ 5024 f2f2 d0 01 bne continueplotsprite2a 5025 f2f4 60 rts 5026 f2f5 continueplotsprite2a 5027 f2f5 endif 5028 f2f5 5029 f2f5 a5 42 lda temp1 ; graphic data, lo byte 5030 f2f7 91 63 sta (dlpnt),y 5031 f2f9 5032 f2f9 ifnconst ATOMICSPRITEUPDATE 5033 f2f9 c8 iny 5034 f2fa a5 47 lda temp6 5035 f2fc 91 63 sta (dlpnt),y 5036 f2fe - else 5037 f2fe - iny 5038 f2fe - sty temp8 5039 f2fe endif 5040 f2fe 5041 f2fe c8 iny 5042 f2ff 5043 f2ff a5 46 lda temp5 ;Y position 5044 f301 0b 07 anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 5045 f303 05 43 ora temp2 ; graphic data, hi byte 5046 f305 e9 07 sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 5047 f307 91 63 sta (dlpnt),y 5048 f309 5049 f309 c8 iny 5050 f30a 5051 f30a a5 44 lda temp3 ;palette|width 5052 f30c 91 63 sta (dlpnt),y 5053 f30e 5054 f30e c8 iny 5055 f30f 5056 f30f a5 45 lda temp4 ;Horizontal position 5057 f311 91 63 sta (dlpnt),y 5058 f313 5059 f313 c8 iny 5060 f314 94 65 sty dlend,x 5061 f316 5062 f316 - ifconst ALWAYSTERMINATE 5063 f316 - iny 5064 f316 - lda #0 5065 f316 - sta (dlpnt),y 5066 f316 endif 5067 f316 5068 f316 - ifconst ATOMICSPRITEUPDATE 5069 f316 - ldy temp8 5070 f316 - lda temp6 5071 f316 - sta (dlpnt),y 5072 f316 endif 5073 f316 5074 f316 doneSPDL 5075 f316 60 rts 5076 f317 5077 f317 5078 f317 lockzonex 5079 f317 - ifconst ZONELOCKS 5080 f317 - ldy dlend,x 5081 f317 - cpy #DLLASTOBJ 5082 f317 - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 5083 f317 - lda DLPOINTL,x 5084 f317 - ifconst DOUBLEBUFFER 5085 f317 - clc 5086 f317 - adc doublebufferdloffset 5087 f317 - endif ; DOUBLEBUFFER 5088 f317 - sta dlpnt 5089 f317 - lda DLPOINTH,x 5090 f317 - ifconst DOUBLEBUFFER 5091 f317 - adc #0 5092 f317 - endif ; DOUBLEBUFFER 5093 f317 - sta dlpnt+1 5094 f317 - iny 5095 f317 - lda #0 5096 f317 - sta (dlpnt),y 5097 f317 - dey 5098 f317 - tya 5099 f317 - ldy #(DLLASTOBJ-1) 5100 f317 - sta (dlpnt),y 5101 f317 - iny 5102 f317 - sty dlend,x 5103 f317 -lockzonexreturn 5104 f317 - rts 5105 f317 endif ; ZONELOCKS 5106 f317 unlockzonex 5107 f317 - ifconst ZONELOCKS 5108 f317 - ldy dlend,x 5109 f317 - cpy #DLLASTOBJ 5110 f317 - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 5111 f317 - lda DLPOINTL,x 5112 f317 - ifconst DOUBLEBUFFER 5113 f317 - clc 5114 f317 - adc doublebufferdloffset 5115 f317 - endif ; DOUBLEBUFFER 5116 f317 - sta dlpnt 5117 f317 - lda DLPOINTH,x 5118 f317 - ifconst DOUBLEBUFFER 5119 f317 - adc #0 5120 f317 - endif ; DOUBLEBUFFER 5121 f317 - sta dlpnt+1 5122 f317 - dey 5123 f317 - ;ldy #(DLLASTOBJ-1) 5124 f317 - lda (dlpnt),y 5125 f317 - tay 5126 f317 - sty dlend,x 5127 f317 -unlockzonexreturn 5128 f317 endif ; ZONELOCKS 5129 f317 60 rts 5130 f318 5131 f318 plotcharloop 5132 f318 ; ** read from a data indirectly pointed to from temp8,temp9 5133 f318 ; ** format is: lo_data, hi_data, palette|width, x, y 5134 f318 ; ** format ends with lo_data | hi_data = 0 5135 f318 5136 f318 - ifconst DOUBLEBUFFER 5137 f318 - lda doublebufferstate 5138 f318 - bne skipplotcharloopwait 5139 f318 endif ; DOUBLEBUFFER 5140 f318 - ifconst DEBUGWAITCOLOR 5141 f318 - lda #$61 5142 f318 - sta BACKGRND 5143 f318 endif 5144 f318 plotcharloopwait 5145 f318 a5 4d lda visibleover 5146 f31a d0 fc bne plotcharloopwait 5147 f31c - ifconst DEBUGWAITCOLOR 5148 f31c - lda #0 5149 f31c - sta BACKGRND 5150 f31c endif 5151 f31c skipplotcharloopwait 5152 f31c plotcharlooploop 5153 f31c a0 00 ldy #0 5154 f31e b1 49 lda (temp8),y 5155 f320 85 42 sta temp1 5156 f322 c8 iny 5157 f323 b1 49 lda (temp8),y 5158 f325 85 43 sta temp2 5159 f327 05 42 ora temp1 5160 f329 d0 01 bne plotcharloopcontinue 5161 f32b ;the pointer=0, so return 5162 f32b 60 rts 5163 f32c plotcharloopcontinue 5164 f32c c8 iny 5165 f32d b1 49 lda (temp8),y 5166 f32f 85 44 sta temp3 5167 f331 c8 iny 5168 f332 b1 49 lda (temp8),y 5169 f334 85 45 sta temp4 5170 f336 c8 iny 5171 f337 b1 49 lda (temp8),y 5172 f339 ;sta temp5 ; not needed with our late entry. 5173 f339 20 52 f3 jsr plotcharactersskipentry 5174 f33c a5 49 lda temp8 5175 f33e 18 clc 5176 f33f 69 05 adc #5 5177 f341 85 49 sta temp8 5178 f343 a5 4a lda temp9 5179 f345 69 00 adc #0 5180 f347 85 4a sta temp9 5181 f349 4c 1c f3 jmp plotcharlooploop 5182 f34c 5183 f34c plotcharacters 5184 f34c - ifconst DOUBLEBUFFER 5185 f34c - lda doublebufferstate 5186 f34c - bne skipplotcharacterswait 5187 f34c endif ; DOUBLEBUFFER 5188 f34c - ifconst DEBUGWAITCOLOR 5189 f34c - lda #$41 5190 f34c - sta BACKGRND 5191 f34c endif 5192 f34c plotcharacterswait 5193 f34c a5 4d lda visibleover 5194 f34e d0 fc bne plotcharacterswait 5195 f350 - ifconst DEBUGWAITCOLOR 5196 f350 - sta BACKGRND 5197 f350 endif 5198 f350 skipplotcharacterswait 5199 f350 ;arguments: 5200 f350 ; temp1=lo charactermap 5201 f350 ; temp2=hi charactermap 5202 f350 ; temp3=palette | width byte 5203 f350 ; temp4=x 5204 f350 ; temp5=y 5205 f350 5206 f350 a5 46 lda temp5 ;Y position 5207 f352 5208 f352 plotcharactersskipentry 5209 f352 5210 f352 ;ifconst ZONEHEIGHT 5211 f352 ; if ZONEHEIGHT = 16 5212 f352 ; and #$0F 5213 f352 ; endif 5214 f352 ; if ZONEHEIGHT = 8 5215 f352 ; and #$1F 5216 f352 ; endif 5217 f352 ;else 5218 f352 ; and #$0F 5219 f352 ;endif 5220 f352 5221 f352 aa tax 5222 f353 bd d1 f5 lda DLPOINTL,x ;Get pointer to DL that the characters are in 5223 f356 - ifconst DOUBLEBUFFER 5224 f356 - clc 5225 f356 - adc doublebufferdloffset 5226 f356 endif ; DOUBLEBUFFER 5227 f356 85 63 sta dlpnt 5228 f358 bd b9 f5 lda DLPOINTH,x 5229 f35b - ifconst DOUBLEBUFFER 5230 f35b - adc #0 5231 f35b endif ; DOUBLEBUFFER 5232 f35b 85 64 sta dlpnt+1 5233 f35d 5234 f35d ;Create DL entry for the characters 5235 f35d 5236 f35d b4 65 ldy dlend,x ;Get the index to the end of this DL 5237 f35f 5238 f35f ifconst CHECKOVERWRITE 5239 f35f c0 4b cpy #DLLASTOBJ 5240 f361 d0 01 bne continueplotcharacters 5241 f363 60 rts 5242 f364 continueplotcharacters 5243 f364 endif 5244 f364 5245 f364 a5 42 lda temp1 ; character map data, lo byte 5246 f366 91 63 sta (dlpnt),y ;(1) store low address 5247 f368 5248 f368 c8 iny 5249 f369 ad 06 21 lda charactermode 5250 f36c 91 63 sta (dlpnt),y ;(2) store mode 5251 f36e 5252 f36e c8 iny 5253 f36f a5 43 lda temp2 ; character map, hi byte 5254 f371 91 63 sta (dlpnt),y ;(3) store high address 5255 f373 5256 f373 c8 iny 5257 f374 a5 44 lda temp3 ;palette|width 5258 f376 91 63 sta (dlpnt),y ;(4) store palette|width 5259 f378 5260 f378 c8 iny 5261 f379 a5 45 lda temp4 ;Horizontal position 5262 f37b 91 63 sta (dlpnt),y ;(5) store horizontal position 5263 f37d 5264 f37d c8 iny 5265 f37e 94 65 sty dlend,x ; save display list end byte 5266 f380 60 rts 5267 f381 5268 f381 5269 f381 - ifconst plotvalueonscreen 5270 f381 -plotcharacterslive 5271 f381 - ; a version of plotcharacters that draws live and minimally disrupts the screen... 5272 f381 - 5273 f381 - ;arguments: 5274 f381 - ; temp1=lo charactermap 5275 f381 - ; temp2=hi charactermap 5276 f381 - ; temp3=palette | width byte 5277 f381 - ; temp4=x 5278 f381 - ; temp5=y 5279 f381 - 5280 f381 - lda temp5 ;Y position 5281 f381 - 5282 f381 - tax 5283 f381 - lda DLPOINTL,x ;Get pointer to DL that the characters are in 5284 f381 - ifconst DOUBLEBUFFER 5285 f381 - clc 5286 f381 - adc doublebufferdloffset 5287 f381 - endif ; DOUBLEBUFFER 5288 f381 - sta dlpnt 5289 f381 - lda DLPOINTH,x 5290 f381 - ifconst DOUBLEBUFFER 5291 f381 - adc #0 5292 f381 - endif ; DOUBLEBUFFER 5293 f381 - sta dlpnt+1 5294 f381 - 5295 f381 - ;Create DL entry for the characters 5296 f381 - 5297 f381 - ldy dlend,x ;Get the index to the end of this DL 5298 f381 - 5299 f381 - ifconst CHECKOVERWRITE 5300 f381 - cpy #DLLASTOBJ 5301 f381 - bne continueplotcharacterslive 5302 f381 - rts 5303 f381 -continueplotcharacterslive 5304 f381 - endif 5305 f381 - 5306 f381 - lda temp1 ; character map data, lo byte 5307 f381 - sta (dlpnt),y ;(1) store low address 5308 f381 - 5309 f381 - iny 5310 f381 - ; we don't add the second byte yet, since the charmap could briefly 5311 f381 - ; render without a proper character map address, width, or position. 5312 f381 - lda charactermode 5313 f381 - sta (dlpnt),y ;(2) store mode 5314 f381 - 5315 f381 - iny 5316 f381 - lda temp2 ; character map, hi byte 5317 f381 - sta (dlpnt),y ;(3) store high address 5318 f381 - 5319 f381 - iny 5320 f381 - lda temp3 ;palette|width 5321 f381 - sta (dlpnt),y ;(4) store palette|width 5322 f381 - 5323 f381 - iny 5324 f381 - lda temp4 ;Horizontal position 5325 f381 - sta (dlpnt),y ;(5) store horizontal position 5326 f381 - 5327 f381 - iny 5328 f381 - sty dlend,x ; save display list end byte 5329 f381 - 5330 f381 - rts 5331 f381 endif ;plotcharacterslive 5332 f381 5333 f381 - ifconst USED_PLOTVALUE 5334 f381 -plotvalue 5335 f381 - ; calling 7800basic command: 5336 f381 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 5337 f381 - ; ...displays the variable as BCD digits 5338 f381 - ; 5339 f381 - ; asm sub arguments: 5340 f381 - ; temp1=lo charactermap 5341 f381 - ; temp2=hi charactermap 5342 f381 - ; temp3=palette | width byte 5343 f381 - ; temp4=x 5344 f381 - ; temp5=y 5345 f381 - ; temp6=number of digits 5346 f381 - ; temp7=lo variable 5347 f381 - ; temp8=hi variable 5348 f381 - ; temp9=character mode 5349 f381 - 5350 f381 -plotdigitcount = temp6 5351 f381 - 5352 f381 - ifconst ZONELOCKS 5353 f381 - ldx temp5 5354 f381 - ldy dlend,x 5355 f381 - cpy #DLLASTOBJ 5356 f381 - bne carryonplotvalue 5357 f381 - rts 5358 f381 -carryonplotvalue 5359 f381 - endif 5360 f381 - 5361 f381 - lda #0 5362 f381 - tay 5363 f381 - ldx valbufend 5364 f381 - 5365 f381 - lda plotdigitcount 5366 f381 - and #1 5367 f381 - beq pvnibble2char 5368 f381 - lda #0 5369 f381 - sta VALBUFFER,x ; just in case we skip this digit 5370 f381 - beq pvnibble2char_skipnibble 5371 f381 - 5372 f381 -pvnibble2char 5373 f381 - ; high nibble... 5374 f381 - lda (temp7),y 5375 f381 - and #$f0 5376 f381 - lsr 5377 f381 - lsr 5378 f381 - lsr 5379 f381 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 5380 f381 - lsr 5381 f381 - endif 5382 f381 - 5383 f381 - clc 5384 f381 - adc temp1 ; add the offset to character graphics to our value 5385 f381 - sta VALBUFFER,x 5386 f381 - inx 5387 f381 - dec plotdigitcount 5388 f381 - 5389 f381 -pvnibble2char_skipnibble 5390 f381 - ; low nibble... 5391 f381 - lda (temp7),y 5392 f381 - and #$0f 5393 f381 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 5394 f381 - asl 5395 f381 - endif 5396 f381 - clc 5397 f381 - adc temp1 ; add the offset to character graphics to our value 5398 f381 - sta VALBUFFER,x 5399 f381 - inx 5400 f381 - iny 5401 f381 - 5402 f381 - dec plotdigitcount 5403 f381 - bne pvnibble2char 5404 f381 - 5405 f381 - ;point to the start of our valuebuffer 5406 f381 - clc 5407 f381 - lda #VALBUFFER 5411 f381 - adc #0 5412 f381 - sta temp2 5413 f381 - 5414 f381 - ;advance valbufend to the end of our value buffer 5415 f381 - stx valbufend 5416 f381 - 5417 f381 - ifnconst plotvalueonscreen 5418 f381 - jmp plotcharacters 5419 f381 - else 5420 f381 - jmp plotcharacterslive 5421 f381 - endif 5422 f381 - 5423 f381 endif ; USED_PLOTVALUE 5424 f381 5425 f381 5426 f381 - ifconst USED_PLOTVALUEEXTRA 5427 f381 -plotdigitcount = temp6 5428 f381 -plotvalueextra 5429 f381 - ; calling 7800basic command: 5430 f381 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 5431 f381 - ; ...displays the variable as BCD digits 5432 f381 - ; 5433 f381 - ; asm sub arguments: 5434 f381 - ; temp1=lo charactermap 5435 f381 - ; temp2=hi charactermap 5436 f381 - ; temp3=palette | width byte 5437 f381 - ; temp4=x 5438 f381 - ; temp5=y 5439 f381 - ; temp6=number of digits 5440 f381 - ; temp7=lo variable 5441 f381 - ; temp8=hi variable 5442 f381 - 5443 f381 - lda #0 5444 f381 - tay 5445 f381 - ldx valbufend 5446 f381 - ifnconst plotvalueonscreen 5447 f381 - sta VALBUFFER,x 5448 f381 - endif 5449 f381 - 5450 f381 - lda plotdigitcount 5451 f381 - and #1 5452 f381 - 5453 f381 - bne pvnibble2char_skipnibbleextra 5454 f381 - 5455 f381 -pvnibble2charextra 5456 f381 - ; high nibble... 5457 f381 - lda (temp7),y 5458 f381 - and #$f0 5459 f381 - lsr 5460 f381 - lsr 5461 f381 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 5462 f381 - lsr 5463 f381 - endif 5464 f381 - clc 5465 f381 - adc temp1 ; add the offset to character graphics to our value 5466 f381 - sta VALBUFFER,x 5467 f381 - inx 5468 f381 - 5469 f381 - ; second half of the digit 5470 f381 - clc 5471 f381 - adc #1 5472 f381 - sta VALBUFFER,x 5473 f381 - inx 5474 f381 - 5475 f381 -pvnibble2char_skipnibbleextra 5476 f381 - ; low nibble... 5477 f381 - lda (temp7),y 5478 f381 - and #$0f 5479 f381 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 5480 f381 - asl 5481 f381 - endif 5482 f381 - asl 5483 f381 - 5484 f381 - clc 5485 f381 - adc temp1 ; add the offset to character graphics to our value 5486 f381 - sta VALBUFFER,x 5487 f381 - inx 5488 f381 - 5489 f381 - clc 5490 f381 - adc #1 5491 f381 - sta VALBUFFER,x 5492 f381 - inx 5493 f381 - iny 5494 f381 - 5495 f381 - dec plotdigitcount 5496 f381 - bne pvnibble2charextra 5497 f381 - 5498 f381 - ;point to the start of our valuebuffer 5499 f381 - clc 5500 f381 - lda #VALBUFFER 5504 f381 - adc #0 5505 f381 - sta temp2 5506 f381 - 5507 f381 - ;advance valbufend to the end of our value buffer 5508 f381 - stx valbufend 5509 f381 - 5510 f381 - ifnconst plotvalueonscreen 5511 f381 - jmp plotcharacters 5512 f381 - else 5513 f381 - jmp plotcharacterslive 5514 f381 - endif 5515 f381 endif ; USED_PLOTVALUEEXTRA 5516 f381 5517 f381 boxcollision 5518 f381 - ifconst BOXCOLLISION 5519 f381 - ; the worst case cycle-time for the code below is 43 cycles. 5520 f381 - ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 5521 f381 - 5522 f381 - ;__boxx1 = accumulator 5523 f381 - ;__boxy1 = y 5524 f381 -__boxw1 = temp3 5525 f381 -__boxh1 = temp4 5526 f381 - 5527 f381 -__boxx2 = temp5 5528 f381 -__boxy2 = temp6 5529 f381 -__boxw2 = temp7 5530 f381 -__boxh2 = temp8 5531 f381 - 5532 f381 -DoXCollisionCheck 5533 f381 - ;lda __boxx1 ; skipped. already in the accumulator 5534 f381 - cmp __boxx2 ;3 5535 f381 - bcs X1isbiggerthanX2 ;2/3 5536 f381 -X2isbiggerthanX1 5537 f381 - ; carry is clear 5538 f381 - adc __boxw1 ;3 5539 f381 - cmp __boxx2 ;3 5540 f381 - bcs DoYCollisionCheck ;3/2 5541 f381 - rts ;6 - carry clear, no collision 5542 f381 -X1isbiggerthanX2 5543 f381 - clc ;2 5544 f381 - sbc __boxw2 ;3 5545 f381 - cmp __boxx2 ;3 5546 f381 - bcs noboxcollision ;3/2 5547 f381 -DoYCollisionCheck 5548 f381 - tya ; 2 ; use to be "lda __boxy1" 5549 f381 - cmp __boxy2 ;3 5550 f381 - bcs Y1isbiggerthanY2 ;3/2 5551 f381 -Y2isbiggerthanY1 5552 f381 - ; carry is clear 5553 f381 - adc __boxh1 ;3 5554 f381 - cmp __boxy2 ;3 5555 f381 - rts ;6 5556 f381 -Y1isbiggerthanY2 5557 f381 - clc ;2 5558 f381 - sbc __boxh2 ;3 5559 f381 - cmp __boxy2 ;3 5560 f381 - bcs noboxcollision ;3/2 5561 f381 -yesboxcollision 5562 f381 - sec ;2 5563 f381 - rts ;6 5564 f381 -noboxcollision 5565 f381 - clc ;2 5566 f381 - rts ;6 5567 f381 endif ; BOXCOLLISION 5568 f381 5569 f381 randomize 5570 f381 a5 40 lda rand 5571 f383 4a lsr 5572 f384 26 41 rol rand16 5573 f386 90 02 bcc noeor 5574 f388 49 b4 eor #$B4 5575 f38a noeor 5576 f38a 85 40 sta rand 5577 f38c 45 41 eor rand16 5578 f38e 60 rts 5579 f38f 5580 f38f ; *** bcd conversion routine courtesy Omegamatrix 5581 f38f ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 5582 f38f converttobcd 5583 f38f ;value to convert is in the accumulator 5584 f38f 85 42 sta temp1 5585 f391 4a lsr 5586 f392 65 42 adc temp1 5587 f394 6a ror 5588 f395 4a lsr 5589 f396 4a lsr 5590 f397 65 42 adc temp1 5591 f399 6a ror 5592 f39a 65 42 adc temp1 5593 f39c 6a ror 5594 f39d 4a lsr 5595 f39e 29 3c and #$3C 5596 f3a0 85 43 sta temp2 5597 f3a2 4a lsr 5598 f3a3 65 43 adc temp2 5599 f3a5 65 42 adc temp1 5600 f3a7 60 rts ; return the result in the accumulator 5601 f3a8 5602 f3a8 ; Y and A contain multiplicands, result in A 5603 f3a8 mul8 5604 f3a8 84 42 sty temp1 5605 f3aa 85 43 sta temp2 5606 f3ac a9 00 lda #0 5607 f3ae reptmul8 5608 f3ae 46 43 lsr temp2 5609 f3b0 90 03 bcc skipmul8 5610 f3b2 18 clc 5611 f3b3 65 42 adc temp1 5612 f3b5 ;bcs donemul8 might save cycles? 5613 f3b5 skipmul8 5614 f3b5 ;beq donemul8 might save cycles? 5615 f3b5 06 42 asl temp1 5616 f3b7 d0 f5 bne reptmul8 5617 f3b9 donemul8 5618 f3b9 60 rts 5619 f3ba 5620 f3ba div8 5621 f3ba ; A=numerator Y=denominator, result in A 5622 f3ba c0 02 cpy #2 5623 f3bc 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 5624 f3be 84 42 sty temp1 5625 f3c0 a0 ff ldy #$ff 5626 f3c2 div8loop 5627 f3c2 e5 42 sbc temp1 5628 f3c4 c8 iny 5629 f3c5 b0 fb bcs div8loop 5630 f3c7 div8end 5631 f3c7 98 tya 5632 f3c8 ; result in A 5633 f3c8 60 rts 5634 f3c9 5635 f3c9 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 5636 f3c9 mul16 5637 f3c9 84 42 sty temp1 5638 f3cb 85 43 sta temp2 5639 f3cd 5640 f3cd a9 00 lda #0 5641 f3cf a2 08 ldx #8 5642 f3d1 46 42 lsr temp1 5643 f3d3 mul16_1 5644 f3d3 90 03 bcc mul16_2 5645 f3d5 18 clc 5646 f3d6 65 43 adc temp2 5647 f3d8 mul16_2 5648 f3d8 6a ror 5649 f3d9 66 42 ror temp1 5650 f3db ca dex 5651 f3dc d0 f5 bne mul16_1 5652 f3de 85 43 sta temp2 5653 f3e0 60 rts 5654 f3e1 5655 f3e1 ; div int/int 5656 f3e1 ; numerator in A, denom in temp1 5657 f3e1 ; returns with quotient in A, remainder in temp1 5658 f3e1 div16 5659 f3e1 85 43 sta temp2 5660 f3e3 84 42 sty temp1 5661 f3e5 a9 00 lda #0 5662 f3e7 a2 08 ldx #8 5663 f3e9 06 43 asl temp2 5664 f3eb div16_1 5665 f3eb 2a rol 5666 f3ec c5 42 cmp temp1 5667 f3ee 90 02 bcc div16_2 5668 f3f0 e5 42 sbc temp1 5669 f3f2 div16_2 5670 f3f2 26 43 rol temp2 5671 f3f4 ca dex 5672 f3f5 d0 f4 bne div16_1 5673 f3f7 85 42 sta temp1 5674 f3f9 a5 43 lda temp2 5675 f3fb 60 rts 5676 f3fc 5677 f3fc - ifconst bankswitchmode 5678 f3fc -BS_jsr 5679 f3fc - ifconst dumpbankswitch 5680 f3fc - sta dumpbankswitch 5681 f3fc - endif 5682 f3fc - ifconst MCPDEVCART 5683 f3fc - ora #$18 5684 f3fc - sta $3000 5685 f3fc - else 5686 f3fc - sta $8000 5687 f3fc - endif 5688 f3fc - pla 5689 f3fc - tax 5690 f3fc - pla 5691 f3fc - rts 5692 f3fc - 5693 f3fc -BS_return 5694 f3fc - pla ; bankswitch bank 5695 f3fc - ifconst dumpbankswitch 5696 f3fc - sta dumpbankswitch 5697 f3fc - endif 5698 f3fc - ifconst BANKRAM 5699 f3fc - sta currentbank 5700 f3fc - ora currentrambank 5701 f3fc - endif 5702 f3fc - ifconst MCPDEVCART 5703 f3fc - ora #$18 5704 f3fc - sta $3000 5705 f3fc - else 5706 f3fc - sta $8000 5707 f3fc - endif 5708 f3fc - pla ; bankswitch $0 flag 5709 f3fc - rts 5710 f3fc endif 5711 f3fc 5712 f3fc checkselectswitch 5713 f3fc ad 82 02 lda SWCHB ; first check the real select switch... 5714 f3ff 29 02 and #%00000010 5715 f401 ifnconst MOUSESUPPORT 5716 f401 f0 05 beq checkselectswitchreturn ; switch is pressed 5717 f403 ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 5718 f406 29 b0 and #%10110000 ; R_DU 5719 f408 endif ; MOUSESUPPORT 5720 f408 checkselectswitchreturn 5721 f408 60 rts 5722 f409 5723 f409 checkresetswitch 5724 f409 ad 82 02 lda SWCHB ; first check the real reset switch... 5725 f40c 29 01 and #%00000001 5726 f40e ifnconst MOUSESUPPORT 5727 f40e f0 05 beq checkresetswitchreturn ; switch is pressed 5728 f410 ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 5729 f413 29 70 and #%01110000 ; _LDU 5730 f415 endif ; MOUSESUPPORT 5731 f415 checkresetswitchreturn 5732 f415 60 rts 5733 f416 5734 f416 - ifconst FINESCROLLENABLED 5735 f416 -finescrolldlls 5736 f416 - ldx temp1 ; first DLL index x3 5737 f416 - lda DLLMEM,x 5738 f416 - and #%11110000 5739 f416 - ora finescrolly 5740 f416 - sta DLLMEM,x 5741 f416 - 5742 f416 - ldx temp2 ; last DLL index x3 5743 f416 - lda DLLMEM,x 5744 f416 - and #%11110000 5745 f416 - ora finescrolly 5746 f416 - eor #(WZONEHEIGHT-1) 5747 f416 - sta DLLMEM,x 5748 f416 - rts 5749 f416 endif ; FINESCROLLENABLED 5750 f416 5751 f416 - ifconst USED_ADJUSTVISIBLE 5752 f416 -adjustvisible 5753 f416 - ; called with temp1=first visible zone *3, temp2=last visible zone *3 5754 f416 - jsr waitforvblankstart ; ensure vblank just started 5755 f416 - ldx visibleDLLstart 5756 f416 -findfirstinterrupt 5757 f416 - lda DLLMEM,x 5758 f416 - bmi foundfirstinterrupt 5759 f416 - inx 5760 f416 - inx 5761 f416 - inx 5762 f416 - bne findfirstinterrupt 5763 f416 -foundfirstinterrupt 5764 f416 - and #%01111111 ; clear the interrupt bit 5765 f416 - sta DLLMEM,x 5766 f416 - ifconst DOUBLEBUFFER 5767 f416 - sta DLLMEM+DBOFFSET,x 5768 f416 - endif ; DOUBLEBUFFER 5769 f416 - ldx overscanDLLstart 5770 f416 -findlastinterrupt 5771 f416 - lda DLLMEM,x 5772 f416 - bmi foundlastinterrupt 5773 f416 - dex 5774 f416 - dex 5775 f416 - dex 5776 f416 - bne findlastinterrupt 5777 f416 -foundlastinterrupt 5778 f416 - and #%01111111 ; clear the interrupt bit 5779 f416 - sta DLLMEM,x 5780 f416 - ifconst DOUBLEBUFFER 5781 f416 - sta DLLMEM+DBOFFSET,x 5782 f416 - endif ; DOUBLEBUFFER 5783 f416 - ;now we need to set the new interrupts 5784 f416 - clc 5785 f416 - lda temp1 5786 f416 - adc visibleDLLstart 5787 f416 - tax 5788 f416 - lda DLLMEM,x 5789 f416 - ora #%10000000 5790 f416 - sta DLLMEM,x 5791 f416 - ifconst DOUBLEBUFFER 5792 f416 - sta DLLMEM+DBOFFSET,x 5793 f416 - endif ; DOUBLEBUFFER 5794 f416 - clc 5795 f416 - lda temp2 5796 f416 - adc visibleDLLstart 5797 f416 - tax 5798 f416 - lda DLLMEM,x 5799 f416 - ora #%10000000 5800 f416 - sta DLLMEM,x 5801 f416 - ifconst DOUBLEBUFFER 5802 f416 - sta DLLMEM+DBOFFSET,x 5803 f416 - endif ; DOUBLEBUFFER 5804 f416 - jsr vblankresync 5805 f416 - rts 5806 f416 endif ; USED_ADJUSTVISIBLE 5807 f416 5808 f416 vblankresync 5809 f416 20 b4 f4 jsr waitforvblankstart ; ensure vblank just started 5810 f419 a9 00 lda #0 5811 f41b 85 4d sta visibleover 5812 f41d a9 03 lda #3 5813 f41f 8d b2 01 sta interruptindex 5814 f422 60 rts 5815 f423 5816 f423 createallgamedlls 5817 f423 a2 00 ldx #0 5818 f425 a9 19 lda #NVLINES 5819 f427 ac 09 21 ldy paldetected 5820 f42a f0 03 beq skipcreatePALpadding 5821 f42c 18 clc 5822 f42d 69 15 adc #21 5823 f42f skipcreatePALpadding 5824 f42f 20 64 f4 jsr createnonvisibledlls 5825 f432 8e 3c 21 stx visibleDLLstart 5826 f435 20 95 f4 jsr createvisiblezones 5827 f438 8e 3d 21 stx overscanDLLstart 5828 f43b createallgamedllscontinue 5829 f43b a9 50 lda #(NVLINES+55) ; extras for PAL 5830 f43d 20 64 f4 jsr createnonvisibledlls 5831 f440 5832 f440 ae 3c 21 ldx visibleDLLstart 5833 f443 bd 00 18 lda DLLMEM,x 5834 f446 09 80 ora #%10000000 ; NMI 1 - start of visible screen 5835 f448 9d 00 18 sta DLLMEM,x 5836 f44b - ifconst DOUBLEBUFFER 5837 f44b - sta DLLMEM+DBOFFSET,x 5838 f44b endif ; DOUBLEBUFFER 5839 f44b 5840 f44b ae 3d 21 ldx overscanDLLstart 5841 f44e bd 00 18 lda DLLMEM,x 5842 f451 09 83 ora #%10000011 ; NMI 2 - end of visible screen 5843 f453 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 5844 f455 9d 00 18 sta DLLMEM,x 5845 f458 - ifconst DOUBLEBUFFER 5846 f458 - sta DLLMEM+DBOFFSET,x 5847 f458 endif ; DOUBLEBUFFER 5848 f458 5849 f458 e8 inx 5850 f459 e8 inx 5851 f45a e8 inx 5852 f45b 5853 f45b bd 00 18 lda DLLMEM,x 5854 f45e 09 80 ora #%10000000 ; NMI 3 - deeper overscan 5855 f460 9d 00 18 sta DLLMEM,x 5856 f463 - ifconst DOUBLEBUFFER 5857 f463 - sta DLLMEM+DBOFFSET,x 5858 f463 endif ; DOUBLEBUFFER 5859 f463 5860 f463 60 rts 5861 f464 5862 f464 createnonvisibledlls 5863 f464 85 42 sta temp1 5864 f466 4a lsr 5865 f467 4a lsr 5866 f468 4a lsr 5867 f469 4a lsr ; /16 5868 f46a f0 09 beq skipcreatenonvisibledlls1loop 5869 f46c a8 tay 5870 f46d createnonvisibledlls1loop 5871 f46d a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 5872 f46f 20 84 f4 jsr createblankdllentry 5873 f472 88 dey 5874 f473 d0 f8 bne createnonvisibledlls1loop 5875 f475 skipcreatenonvisibledlls1loop 5876 f475 a5 42 lda temp1 5877 f477 29 0f and #%00001111 5878 f479 f0 08 beq createnonvisibledllsreturn 5879 f47b 38 sec 5880 f47c e9 01 sbc #1 5881 f47e 09 40 ora #%01000000 5882 f480 20 84 f4 jsr createblankdllentry 5883 f483 createnonvisibledllsreturn 5884 f483 60 rts 5885 f484 5886 f484 createblankdllentry 5887 f484 9d 00 18 sta DLLMEM,x 5888 f487 - ifconst DOUBLEBUFFER 5889 f487 - sta DLLMEM+DBOFFSET,x 5890 f487 endif ; DOUBLEBUFFER 5891 f487 e8 inx 5892 f488 a9 21 lda #$21 ; blank 5893 f48a 9d 00 18 sta DLLMEM,x 5894 f48d - ifconst DOUBLEBUFFER 5895 f48d - sta DLLMEM+DBOFFSET,x 5896 f48d endif ; DOUBLEBUFFER 5897 f48d e8 inx 5898 f48e a9 00 lda #$00 5899 f490 9d 00 18 sta DLLMEM,x 5900 f493 - ifconst DOUBLEBUFFER 5901 f493 - sta DLLMEM+DBOFFSET,x 5902 f493 endif ; DOUBLEBUFFER 5903 f493 e8 inx 5904 f494 60 rts 5905 f495 5906 f495 createvisiblezones 5907 f495 a0 00 ldy #0 5908 f497 createvisiblezonesloop 5909 f497 b9 e9 f5 lda.w DLHEIGHT,y 5910 f49a 09 20 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 5911 f49c 9d 00 18 sta DLLMEM,x 5912 f49f - ifconst DOUBLEBUFFER 5913 f49f - sta DLLMEM+DBOFFSET,x 5914 f49f endif ; DOUBLEBUFFER 5915 f49f e8 inx 5916 f4a0 b9 b9 f5 lda DLPOINTH,y 5917 f4a3 9d 00 18 sta DLLMEM,x 5918 f4a6 - ifconst DOUBLEBUFFER 5919 f4a6 - sta DLLMEM+DBOFFSET,x 5920 f4a6 endif ; DOUBLEBUFFER 5921 f4a6 e8 inx 5922 f4a7 b9 d1 f5 lda DLPOINTL,y 5923 f4aa 9d 00 18 sta DLLMEM,x 5924 f4ad - ifconst DOUBLEBUFFER 5925 f4ad - clc 5926 f4ad - adc #DOUBLEBUFFEROFFSET 5927 f4ad - sta DLLMEM+DBOFFSET,x 5928 f4ad - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 5929 f4ad - inc DLLMEM+DBOFFSET-1,x 5930 f4ad -skiphidoublebufferadjust 5931 f4ad endif ; DOUBLEBUFFER 5932 f4ad e8 inx 5933 f4ae c8 iny 5934 f4af c0 18 cpy #WZONECOUNT 5935 f4b1 d0 e4 bne createvisiblezonesloop 5936 f4b3 60 rts 5937 f4b4 5938 f4b4 waitforvblankstart 5939 f4b4 vblankendwait 5940 f4b4 24 28 BIT MSTAT 5941 f4b6 30 fc bmi vblankendwait 5942 f4b8 vblankstartwait 5943 f4b8 24 28 BIT MSTAT 5944 f4ba 10 fc bpl vblankstartwait 5945 f4bc 60 rts 5946 f4bd 5947 f4bd - ifconst DOUBLEBUFFER 5948 f4bd -flipdisplaybufferreturn 5949 f4bd - rts 5950 f4bd -flipdisplaybuffer 5951 f4bd - ifconst interrupthold 5952 f4bd - lda #$FF 5953 f4bd - sta interrupthold 5954 f4bd - endif 5955 f4bd - lda doublebufferstate 5956 f4bd - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 5957 f4bd - 5958 f4bd - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 5959 f4bd - 5960 f4bd - lda doublebufferstate 5961 f4bd - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 5962 f4bd - tax 5963 f4bd - 5964 f4bd - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 5965 f4bd - 5966 f4bd -flipdisplaybufferwait1 5967 f4bd - lda visibleover 5968 f4bd - beq flipdisplaybufferwait1 5969 f4bd - 5970 f4bd -flipdisplaybufferwait 5971 f4bd - lda visibleover 5972 f4bd - bne flipdisplaybufferwait 5973 f4bd - 5974 f4bd - lda doublebufferminimumframetarget 5975 f4bd - beq skipminimumframecode 5976 f4bd - lda doublebufferminimumframeindex 5977 f4bd - bne flipdisplaybufferwait1 5978 f4bd - lda doublebufferminimumframetarget 5979 f4bd - sta doublebufferminimumframeindex 5980 f4bd -skipminimumframecode 5981 f4bd - 5982 f4bd - lda DLLMEMLutHi,x 5983 f4bd - sta DPPH 5984 f4bd - lda DLLMEMLutLo,x 5985 f4bd - sta DPPL 5986 f4bd - 5987 f4bd - lda NewPageflipstate,x 5988 f4bd - sta doublebufferstate 5989 f4bd - lda NewPageflipoffset,x 5990 f4bd - sta doublebufferdloffset 5991 f4bd - 5992 f4bd - lda doublebufferbufferdirty 5993 f4bd - beq flipdisplaybufferreturn 5994 f4bd - 5995 f4bd - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 5996 f4bd - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 5997 f4bd - ; from the displayed buffer to the working buffer... 5998 f4bd - 5999 f4bd - lda doublebufferdloffset 6000 f4bd - eor #DOUBLEBUFFEROFFSET 6001 f4bd - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 6002 f4bd - 6003 f4bd - ldx #(WZONECOUNT-1) 6004 f4bd -copybufferzoneloop 6005 f4bd - 6006 f4bd - lda DLPOINTL,x 6007 f4bd - clc 6008 f4bd - adc doublebufferdloffset 6009 f4bd - sta temp1 6010 f4bd - lda DLPOINTH,x 6011 f4bd - adc #0 6012 f4bd - sta temp2 6013 f4bd - 6014 f4bd - lda DLPOINTL,x 6015 f4bd - clc 6016 f4bd - adc temp6 6017 f4bd - sta temp3 6018 f4bd - lda DLPOINTH,x 6019 f4bd - adc #0 6020 f4bd - sta temp4 6021 f4bd - 6022 f4bd - lda dlendsave,x 6023 f4bd - tay 6024 f4bd -copybuffercharsloop 6025 f4bd - lda (temp3),y 6026 f4bd - sta (temp1),y 6027 f4bd - dey 6028 f4bd - bpl copybuffercharsloop 6029 f4bd - dex 6030 f4bd - bpl copybufferzoneloop 6031 f4bd - lda #0 6032 f4bd - sta doublebufferbufferdirty 6033 f4bd - rts 6034 f4bd - 6035 f4bd -doublebufferoff 6036 f4bd - lda #1 6037 f4bd - sta doublebufferstate 6038 f4bd - jsr flipdisplaybuffer 6039 f4bd - lda #0 6040 f4bd - sta doublebufferstate 6041 f4bd - sta doublebufferdloffset 6042 f4bd - rts 6043 f4bd - 6044 f4bd -DLLMEMLutLo 6045 f4bd - .byte DLLMEM,>(DLLMEM+DBOFFSET) 6048 f4bd -NewPageflipstate 6049 f4bd - .byte 3,1 6050 f4bd -NewPageflipoffset 6051 f4bd - .byte DOUBLEBUFFEROFFSET,0 6052 f4bd - 6053 f4bd endif ; DOUBLEBUFFER 6054 f4bd 6055 f4bd - ifconst MOUSESUPPORT 6056 f4bd - 6057 f4bd -rotationalcompare 6058 f4bd - ; old = 00 01 10 11 6059 f4bd - .byte $00, $01, $ff, $00 ; new=00 6060 f4bd - .byte $ff, $00, $00, $01 ; new=01 6061 f4bd - .byte $01, $00, $00, $ff ; new=10 6062 f4bd - .byte $00, $ff, $01, $00 ; new=11 6063 f4bd - 6064 f4bd - ; 0000YyXx st mouse 6065 f4bd - 6066 f4bd - ; 0000xyXY amiga mouse 6067 f4bd - 6068 f4bd - ifconst MOUSEXONLY 6069 f4bd -amigatoataribits ; swap bits 1 and 4... 6070 f4bd - .byte %0000, %0000, %0010, %0010 6071 f4bd - .byte %0000, %0000, %0010, %0010 6072 f4bd - .byte %0001, %0001, %0011, %0011 6073 f4bd - .byte %0001, %0001, %0011, %0011 6074 f4bd - 6075 f4bd - ; null change bits 6076 f4bd - .byte %0000, %0001, %0010, %0011 6077 f4bd - .byte %0000, %0001, %0010, %0011 6078 f4bd - .byte %0000, %0001, %0010, %0011 6079 f4bd - .byte %0000, %0001, %0010, %0011 6080 f4bd - 6081 f4bd - else ; !MOUSEXONLY 6082 f4bd - 6083 f4bd -amigatoataribits ; swap bits 1 and 4... 6084 f4bd - .byte %0000, %1000, %0010, %1010 6085 f4bd - .byte %0100, %1100, %0110, %1110 6086 f4bd - .byte %0001, %1001, %0011, %1011 6087 f4bd - .byte %0101, %1101, %0111, %1111 6088 f4bd - ; null change bits 6089 f4bd - .byte %0000, %0001, %0010, %0011 6090 f4bd - .byte %0100, %0101, %0110, %0111 6091 f4bd - .byte %1000, %1001, %1010, %1011 6092 f4bd - .byte %1100, %1101, %1110, %1111 6093 f4bd - endif ; !MOUSEXONLY 6094 f4bd - 6095 f4bd endif ; MOUSESUPPORT 6096 f4bd 6097 f4bd mouse0update 6098 f4bd - ifconst MOUSE0SUPPORT 6099 f4bd - 6100 f4bd -mousetableselect = inttemp2 6101 f4bd -mousexdelta = inttemp3 6102 f4bd -mouseydelta = inttemp4 6103 f4bd -lastSWCHA = inttemp6 6104 f4bd - 6105 f4bd - ; 0000YyXx st mouse 6106 f4bd - ; 0000xyXY amiga mouse 6107 f4bd - 6108 f4bd - lda #$ff 6109 f4bd - sta lastSWCHA 6110 f4bd - 6111 f4bd - ldy port0control 6112 f4bd - 6113 f4bd - lda #%00010000 6114 f4bd - cpy #9 ; AMIGA? 6115 f4bd - bne skipamigabitsfix0 6116 f4bd - lda #0 6117 f4bd -skipamigabitsfix0 6118 f4bd - sta mousetableselect 6119 f4bd - ifconst DRIVINGBOOST 6120 f4bd - cpy #6 ; DRIVING? 6121 f4bd - bne skipdriving0setup 6122 f4bd - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 6123 f4bd - ; trails the actual mousex0, so we can smoothly interpolate toward 6124 f4bd - ; the actual position. This actual position is stored in mousey0 6125 f4bd - ; after the driver has run. 6126 f4bd - ldx mousex0 6127 f4bd - lda mousey0 6128 f4bd - stx mousey0 6129 f4bd - sta mousex0 6130 f4bd -skipdriving0setup 6131 f4bd - endif ; DRIVINGBOOST 6132 f4bd - 6133 f4bd - lda #0 6134 f4bd - sta mousexdelta 6135 f4bd - sta mouseydelta 6136 f4bd - 6137 f4bd - ifnconst MOUSETIME 6138 f4bd - ifnconst MOUSEXONLY 6139 f4bd - lda #180 ; minimum for x+y 6140 f4bd - else 6141 f4bd - lda #100 ; minimum for just x 6142 f4bd - endif 6143 f4bd - else 6144 f4bd - lda #MOUSETIME 6145 f4bd - endif 6146 f4bd - jsr SETTIM64T ; INTIM is in Y 6147 f4bd - 6148 f4bd -mouse0updateloop 6149 f4bd - lda SWCHA 6150 f4bd - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 6151 f4bd - cmp lastSWCHA 6152 f4bd - beq mouse0loopcondition 6153 f4bd - sta lastSWCHA 6154 f4bd - lsr 6155 f4bd - lsr 6156 f4bd - lsr 6157 f4bd - 6158 f4bd - ora mousetableselect ; atari/amiga decoding table selection 6159 f4bd - 6160 f4bd - ; st mice encode on different bits/joystick-lines than amiga mice... 6161 f4bd - ; 0000YyXx st mouse 6162 f4bd - ; 0000xyXY amiga mouse 6163 f4bd - ; ...so can shuffle the amiga bits to reuse the st driver. 6164 f4bd - tay 6165 f4bd - lax amigatoataribits,y 6166 f4bd - 6167 f4bd - ifnconst MOUSEXONLY 6168 f4bd - ; first the Y... 6169 f4bd - and #%00001100 6170 f4bd - ora mousecodey0 6171 f4bd - tay 6172 f4bd - lda rotationalcompare,y 6173 f4bd - clc 6174 f4bd - adc mouseydelta 6175 f4bd - sta mouseydelta 6176 f4bd - tya 6177 f4bd - lsr 6178 f4bd - lsr 6179 f4bd - sta mousecodey0 6180 f4bd - txa 6181 f4bd - ; ...then the X... 6182 f4bd - and #%00000011 6183 f4bd - tax 6184 f4bd - endif ; !MOUSEXONLY 6185 f4bd - 6186 f4bd - asl 6187 f4bd - asl 6188 f4bd - ora mousecodex0 6189 f4bd - tay 6190 f4bd - lda rotationalcompare,y 6191 f4bd - adc mousexdelta ; carry was clear by previous ASL 6192 f4bd - sta mousexdelta 6193 f4bd - stx mousecodex0 6194 f4bd -mouse0loopcondition 6195 f4bd - lda TIMINT 6196 f4bd - bpl mouse0updateloop 6197 f4bd - 6198 f4bd - ; *** adapt to selected device resolution. 6199 f4bd - ldx port0control 6200 f4bd - 6201 f4bd - ifconst PRECISIONMOUSING 6202 f4bd - ldy port0resolution 6203 f4bd - bne mouse0halveddone 6204 f4bd - cpx #6 ; half-resolution is no good for driving wheels 6205 f4bd - beq mouse0halveddone 6206 f4bd - ; resolution=0 is half mouse resolution, necessary for precision 6207 f4bd - ; mousing on a 160x240 screen with a 1000 dpi mouse. 6208 f4bd - 6209 f4bd - lda mousexdelta 6210 f4bd - cmp #$80 6211 f4bd - ror ; do a signed divide by 2. 6212 f4bd - clc 6213 f4bd - adc mousex0 6214 f4bd - sta mousex0 6215 f4bd - ifnconst MOUSEXONLY 6216 f4bd - lda mouseydelta 6217 f4bd - clc 6218 f4bd - adc mousey0 6219 f4bd - sta mousey0 6220 f4bd - endif 6221 f4bd - ; at half resolution we just exit after updating x and y 6222 f4bd - jmp LLRET0 6223 f4bd -mouse0halveddone 6224 f4bd - endif ; PRECISIONMOUSING 6225 f4bd - 6226 f4bd - ifnconst MOUSEXONLY 6227 f4bd - asl mouseydelta ; *2 because Y resolution is finer 6228 f4bd - ldy port0resolution 6229 f4bd - dey 6230 f4bd - lda #0 6231 f4bd -mousey0resolutionfix 6232 f4bd - clc 6233 f4bd - adc mouseydelta 6234 f4bd - dey 6235 f4bd - bpl mousey0resolutionfix 6236 f4bd - clc 6237 f4bd - adc mousey0 6238 f4bd - sta mousey0 6239 f4bd - endif ; MOUSEXONLY 6240 f4bd - 6241 f4bd - ldy port0resolution 6242 f4bd - dey 6243 f4bd - lda #0 6244 f4bd -mousex0resolutionfix 6245 f4bd - clc 6246 f4bd - adc mousexdelta 6247 f4bd - dey 6248 f4bd - bpl mousex0resolutionfix 6249 f4bd - ifnconst DRIVINGBOOST 6250 f4bd - clc 6251 f4bd - adc mousex0 6252 f4bd - sta mousex0 6253 f4bd - else 6254 f4bd - cpx #6 6255 f4bd - beq carryonmouse0boost 6256 f4bd - clc 6257 f4bd - adc mousex0 6258 f4bd - sta mousex0 6259 f4bd - jmp LLRET0 6260 f4bd -carryonmouse0boost 6261 f4bd - sta mousexdelta 6262 f4bd - clc 6263 f4bd - adc mousecodey0 6264 f4bd - sta mousecodey0 6265 f4bd - clc 6266 f4bd - adc mousex0 6267 f4bd - tay ; save the target X 6268 f4bd - adc mousey0 ; average in the smoothly-trailing X 6269 f4bd - ror 6270 f4bd - sta mousex0 ; mousex0 now has the smoothly trailing X 6271 f4bd - sty mousey0 ; and mousey0 has the the target X 6272 f4bd - 6273 f4bd - ; check to see if the coordinate wrapped. If so, undo the averaging code. 6274 f4bd - ; A has mousex0, the smoothly trailing X 6275 f4bd - sbc mousey0 ; less the target X 6276 f4bd - bpl skipabsolutedrive0 6277 f4bd - eor #$ff 6278 f4bd -skipabsolutedrive0 6279 f4bd - cmp #64 ; just an unreasonably large change 6280 f4bd - bcc skipdrivewrapfix0 6281 f4bd - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 6282 f4bd -skipdrivewrapfix0 6283 f4bd - 6284 f4bd - ; get rid of the tweening if the distance travelled was very small 6285 f4bd - lda mousexdelta 6286 f4bd - cmp port0resolution 6287 f4bd - bcs skipbetweenfix0 6288 f4bd - lda mousex0 6289 f4bd - sta mousey0 6290 f4bd -skipbetweenfix0 6291 f4bd - 6292 f4bd -drivingboostreductioncheck0 6293 f4bd - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 6294 f4bd - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 6295 f4bd - ; negated again because truncation during BCD math results in 6296 f4bd - ; differing magnitudes, depending if the value is +ve or -ve. 6297 f4bd -driving0fix 6298 f4bd - lax mousecodey0 6299 f4bd - cmp #$80 6300 f4bd - bcs driving0skipnegate1 6301 f4bd - eor #$FF 6302 f4bd - adc #1 6303 f4bd - sta mousecodey0 6304 f4bd -driving0skipnegate1 6305 f4bd - cmp #$80 6306 f4bd - ror 6307 f4bd - cmp #$80 6308 f4bd - ror 6309 f4bd - cmp #$80 6310 f4bd - ror 6311 f4bd - sta inttemp1 6312 f4bd - lda mousecodey0 6313 f4bd - sec 6314 f4bd - sbc inttemp1 6315 f4bd - cpx #$80 6316 f4bd - bcs driving0skipnegate2 6317 f4bd - eor #$FF 6318 f4bd - adc #1 6319 f4bd -driving0skipnegate2 6320 f4bd - sta mousecodey0 6321 f4bd -drivingboostdone0 6322 f4bd - endif ; DRIVINGBOOST 6323 f4bd - 6324 f4bd - jmp LLRET0 6325 f4bd - 6326 f4bd endif ; MOUSE0SUPPORT 6327 f4bd 6328 f4bd mouse1update 6329 f4bd - ifconst MOUSE1SUPPORT 6330 f4bd - 6331 f4bd -mousetableselect = inttemp2 6332 f4bd -mousexdelta = inttemp3 6333 f4bd -mouseydelta = inttemp4 6334 f4bd -lastSWCHA = inttemp6 6335 f4bd - 6336 f4bd - ; 0000YyXx st mouse 6337 f4bd - ; 0000xyXY amiga mouse 6338 f4bd - 6339 f4bd - lda #$ff 6340 f4bd - sta lastSWCHA 6341 f4bd - 6342 f4bd - ldy port1control 6343 f4bd - 6344 f4bd - lda #%00010000 6345 f4bd - cpy #9 ; AMIGA? 6346 f4bd - bne skipamigabitsfix1 6347 f4bd - lda #0 6348 f4bd -skipamigabitsfix1 6349 f4bd - sta mousetableselect 6350 f4bd - ifconst DRIVINGBOOST 6351 f4bd - cpy #6 ; DRIVING? 6352 f4bd - bne skipdriving1setup 6353 f4bd - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 6354 f4bd - ; trails the actual mousex1, so we can smoothly interpolate toward 6355 f4bd - ; the actual position. This actual position is stored in mousey1 6356 f4bd - ; after the driver has run. 6357 f4bd - ldx mousex1 6358 f4bd - lda mousey1 6359 f4bd - stx mousey1 6360 f4bd - sta mousex1 6361 f4bd -skipdriving1setup 6362 f4bd - endif ; DRIVINGBOOST 6363 f4bd - 6364 f4bd - lda #0 6365 f4bd - sta mousexdelta 6366 f4bd - sta mouseydelta 6367 f4bd - 6368 f4bd - ifnconst MOUSETIME 6369 f4bd - ifnconst MOUSEXONLY 6370 f4bd - lda #180 ; minimum for x+y 6371 f4bd - else 6372 f4bd - lda #100 ; minimum for just x 6373 f4bd - endif 6374 f4bd - else 6375 f4bd - lda #MOUSETIME 6376 f4bd - endif 6377 f4bd - jsr SETTIM64T ; INTIM is in Y 6378 f4bd - 6379 f4bd -mouse1updateloop 6380 f4bd - lda SWCHA 6381 f4bd - and #%00001111 6382 f4bd - cmp lastSWCHA 6383 f4bd - beq mouse1loopcondition 6384 f4bd - sta lastSWCHA 6385 f4bd - 6386 f4bd - ora mousetableselect ; atari/amiga decoding table selection 6387 f4bd - 6388 f4bd - ; st mice encode on different bits/joystick-lines than amiga mice... 6389 f4bd - ; 0000YyXx st mouse 6390 f4bd - ; 0000xyXY amiga mouse 6391 f4bd - ; ...so can shuffle the amiga bits to reuse the st driver. 6392 f4bd - tay 6393 f4bd - lax amigatoataribits,y 6394 f4bd - 6395 f4bd - ifnconst MOUSEXONLY 6396 f4bd - ; first the Y... 6397 f4bd - and #%00001100 6398 f4bd - ora mousecodey1 6399 f4bd - tay 6400 f4bd - lda rotationalcompare,y 6401 f4bd - clc 6402 f4bd - adc mouseydelta 6403 f4bd - sta mouseydelta 6404 f4bd - tya 6405 f4bd - lsr 6406 f4bd - lsr 6407 f4bd - sta mousecodey1 6408 f4bd - txa 6409 f4bd - ; ...then the X... 6410 f4bd - and #%00000011 6411 f4bd - tax 6412 f4bd - endif ; !MOUSEXONLY 6413 f4bd - 6414 f4bd - asl 6415 f4bd - asl 6416 f4bd - ora mousecodex1 6417 f4bd - tay 6418 f4bd - lda rotationalcompare,y 6419 f4bd - adc mousexdelta ; carry was clear by previous ASL 6420 f4bd - sta mousexdelta 6421 f4bd - stx mousecodex1 6422 f4bd -mouse1loopcondition 6423 f4bd - lda TIMINT 6424 f4bd - bpl mouse1updateloop 6425 f4bd - 6426 f4bd - ; *** adapt to selected device resolution. 6427 f4bd - ldx port1control 6428 f4bd - 6429 f4bd - ifconst PRECISIONMOUSING 6430 f4bd - ldy port1resolution 6431 f4bd - bne mouse1halveddone 6432 f4bd - cpx #6 ; half-resolution is no good for driving wheels 6433 f4bd - beq mouse1halveddone 6434 f4bd - ; resolution=0 is half mouse resolution, necessary for precision 6435 f4bd - ; mousing on a 160x240 screen with a 1000 dpi mouse. 6436 f4bd - 6437 f4bd - lda mousexdelta 6438 f4bd - cmp #$80 6439 f4bd - ror ; do a signed divide by 2. 6440 f4bd - clc 6441 f4bd - adc mousex1 6442 f4bd - sta mousex1 6443 f4bd - ifnconst MOUSEXONLY 6444 f4bd - lda mouseydelta 6445 f4bd - clc 6446 f4bd - adc mousey1 6447 f4bd - sta mousey1 6448 f4bd - endif 6449 f4bd - ; at half resolution we just exit after updating x and y 6450 f4bd - jmp LLRET1 6451 f4bd -mouse1halveddone 6452 f4bd - endif ; PRECISIONMOUSING 6453 f4bd - 6454 f4bd - ifnconst MOUSEXONLY 6455 f4bd - asl mouseydelta ; *2 because Y resolution is finer 6456 f4bd - ldy port1resolution 6457 f4bd - dey 6458 f4bd - lda #0 6459 f4bd -mousey1resolutionfix 6460 f4bd - clc 6461 f4bd - adc mouseydelta 6462 f4bd - dey 6463 f4bd - bpl mousey1resolutionfix 6464 f4bd - clc 6465 f4bd - adc mousey1 6466 f4bd - sta mousey1 6467 f4bd - endif ; MOUSEXONLY 6468 f4bd - 6469 f4bd - ldy port1resolution 6470 f4bd - dey 6471 f4bd - lda #0 6472 f4bd -mousex1resolutionfix 6473 f4bd - clc 6474 f4bd - adc mousexdelta 6475 f4bd - dey 6476 f4bd - bpl mousex1resolutionfix 6477 f4bd - ifnconst DRIVINGBOOST 6478 f4bd - clc 6479 f4bd - adc mousex1 6480 f4bd - sta mousex1 6481 f4bd - else 6482 f4bd - cpx #6 6483 f4bd - beq carryonmouse1boost 6484 f4bd - clc 6485 f4bd - adc mousex1 6486 f4bd - sta mousex1 6487 f4bd - jmp LLRET1 6488 f4bd -carryonmouse1boost 6489 f4bd - sta mousexdelta 6490 f4bd - clc 6491 f4bd - adc mousecodey1 6492 f4bd - sta mousecodey1 6493 f4bd - clc 6494 f4bd - adc mousex1 6495 f4bd - tay ; save the target X 6496 f4bd - adc mousey1 ; average in the smoothly-trailing X 6497 f4bd - ror 6498 f4bd - sta mousex1 ; mousex0 now has the smoothly trailing X 6499 f4bd - sty mousey1 ; and mousey0 has the the target X 6500 f4bd - 6501 f4bd - ; check to see if the coordinate wrapped. If so, undo the averaging code. 6502 f4bd - ; A has mousex1, the smoothly trailing X 6503 f4bd - sbc mousey1 ; less the target X 6504 f4bd - bpl skipabsolutedrive1 6505 f4bd - eor #$ff 6506 f4bd -skipabsolutedrive1 6507 f4bd - cmp #64 ; just an unreasonably large change 6508 f4bd - bcc skipdrivewrapfix1 6509 f4bd - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 6510 f4bd -skipdrivewrapfix1 6511 f4bd - 6512 f4bd - ; get rid of the tweening if the distance travelled was very small 6513 f4bd - lda mousexdelta 6514 f4bd - cmp port1resolution 6515 f4bd - bcs skipbetweenfix1 6516 f4bd - lda mousex1 6517 f4bd - sta mousey1 6518 f4bd -skipbetweenfix1 6519 f4bd - 6520 f4bd -drivingboostreductioncheck1 6521 f4bd - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 6522 f4bd - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 6523 f4bd - ; negated again because truncation during BCD math results in 6524 f4bd - ; differing magnitudes, depending if the value is +ve or -ve. 6525 f4bd -driving1fix 6526 f4bd - lax mousecodey1 6527 f4bd - cmp #$80 6528 f4bd - bcs driving0skipnegate1 6529 f4bd - eor #$FF 6530 f4bd - adc #1 6531 f4bd - sta mousecodey1 6532 f4bd -driving0skipnegate1 6533 f4bd - cmp #$80 6534 f4bd - ror 6535 f4bd - cmp #$80 6536 f4bd - ror 6537 f4bd - cmp #$80 6538 f4bd - ror 6539 f4bd - sta inttemp1 6540 f4bd - lda mousecodey1 6541 f4bd - sec 6542 f4bd - sbc inttemp1 6543 f4bd - cpx #$80 6544 f4bd - bcs driving1skipnegate2 6545 f4bd - eor #$FF 6546 f4bd - adc #1 6547 f4bd -driving1skipnegate2 6548 f4bd - sta mousecodey1 6549 f4bd -drivingboostdone1 6550 f4bd - endif ; DRIVINGBOOST 6551 f4bd - 6552 f4bd - jmp LLRET1 6553 f4bd - 6554 f4bd endif ; MOUSE1SUPPORT 6555 f4bd 6556 f4bd 6557 f4bd trakball0update 6558 f4bd - ifconst TRAKBALL0SUPPORT 6559 f4bd - ifnconst TRAKTIME 6560 f4bd - ifnconst TRAKXONLY 6561 f4bd - lda #180 ; minimum for x+y 6562 f4bd - else ; !TRAKXONLY 6563 f4bd - lda #100 ; minimum for just x 6564 f4bd - endif ; !TRAKXONLY 6565 f4bd - else ; !TRAKTIME 6566 f4bd - lda #TRAKTIME 6567 f4bd - endif ; !TRAKTIME 6568 f4bd - jsr SETTIM64T ; INTIM is in Y 6569 f4bd - ldx #0 6570 f4bd - ifnconst TRAKXONLY 6571 f4bd - ldy #0 6572 f4bd - endif ; TRAKXONLY 6573 f4bd -trakball0updateloop 6574 f4bd - lda SWCHA 6575 f4bd - and #%00110000 6576 f4bd - cmp trakballcodex0 6577 f4bd - sta trakballcodex0 6578 f4bd - beq trakball0movementXdone 6579 f4bd - and #%00010000 6580 f4bd - beq trakball0negativeX 6581 f4bd -trakball0positiveX 6582 f4bd - ;(2 from beq) 6583 f4bd - inx ; 2 6584 f4bd - jmp trakball0movementXdone ; 3 6585 f4bd -trakball0negativeX 6586 f4bd - ;(3 from beq) 6587 f4bd - dex ; 2 6588 f4bd - nop ; 2 6589 f4bd -trakball0movementXdone 6590 f4bd - 6591 f4bd - ifnconst TRAKXONLY 6592 f4bd - lda SWCHA 6593 f4bd - and #%11000000 6594 f4bd - cmp trakballcodey0 6595 f4bd - sta trakballcodey0 6596 f4bd - beq trakball0movementYdone 6597 f4bd - and #%01000000 6598 f4bd - beq trakball0negativeY 6599 f4bd -trakball0positiveY 6600 f4bd - ;(2 from beq) 6601 f4bd - iny ; 2 6602 f4bd - jmp trakball0movementYdone ; 3 6603 f4bd -trakball0negativeY 6604 f4bd - ;(3 from beq) 6605 f4bd - dey ; 2 6606 f4bd - nop ; 2 6607 f4bd -trakball0movementYdone 6608 f4bd - endif ; !TRAKXONLY 6609 f4bd - 6610 f4bd - lda TIMINT 6611 f4bd - bpl trakball0updateloop 6612 f4bd - lda #0 6613 f4bd - cpx #0 6614 f4bd - beq trakball0skipXadjust 6615 f4bd - clc 6616 f4bd -trakball0Xloop 6617 f4bd - adc port0resolution 6618 f4bd - dex 6619 f4bd - bne trakball0Xloop 6620 f4bd - clc 6621 f4bd - adc trakballx0 6622 f4bd - sta trakballx0 6623 f4bd -trakball0skipXadjust 6624 f4bd - ifnconst TRAKXONLY 6625 f4bd - lda #0 6626 f4bd - cpy #0 6627 f4bd - beq trakball0skipYadjust 6628 f4bd - clc 6629 f4bd -trakball0yloop 6630 f4bd - adc port0resolution 6631 f4bd - dey 6632 f4bd - bne trakball0yloop 6633 f4bd - clc 6634 f4bd - adc trakbally0 6635 f4bd - sta trakbally0 6636 f4bd -trakball0skipYadjust 6637 f4bd - endif ; !TRAKXONLY 6638 f4bd - 6639 f4bd - jmp LLRET0 6640 f4bd endif 6641 f4bd 6642 f4bd 6643 f4bd 6644 f4bd trakball1update 6645 f4bd - ifconst TRAKBALL1SUPPORT 6646 f4bd - ifnconst TRAKTIME 6647 f4bd - ifnconst TRAKXONLY 6648 f4bd - lda #180 ; minimum for x+y 6649 f4bd - else ; !TRAKXONLY 6650 f4bd - lda #100 ; minimum for just x 6651 f4bd - endif ; !TRAKXONLY 6652 f4bd - else ; !TRAKTIME 6653 f4bd - lda #TRAKTIME 6654 f4bd - endif ; !TRAKTIME 6655 f4bd - jsr SETTIM64T ; INTIM is in Y 6656 f4bd - ldx #0 6657 f4bd - ifnconst TRAKXONLY 6658 f4bd - ldy #0 6659 f4bd - endif ; TRAKXONLY 6660 f4bd -trakball1updateloop 6661 f4bd - lda SWCHA 6662 f4bd - and #%00000011 6663 f4bd - cmp trakballcodex1 6664 f4bd - sta trakballcodex1 6665 f4bd - beq trakball1movementXdone 6666 f4bd - and #%00000001 6667 f4bd - beq trakball1negativeX 6668 f4bd -trakball1positiveX 6669 f4bd - ;(2 from beq) 6670 f4bd - inx ; 2 6671 f4bd - jmp trakball1movementXdone ; 3 6672 f4bd -trakball1negativeX 6673 f4bd - ;(3 from beq) 6674 f4bd - dex ; 2 6675 f4bd - nop ; 2 6676 f4bd -trakball1movementXdone 6677 f4bd - 6678 f4bd - ifnconst TRAKXONLY 6679 f4bd - lda SWCHA 6680 f4bd - and #%00001100 6681 f4bd - cmp trakballcodey1 6682 f4bd - sta trakballcodey1 6683 f4bd - beq trakball1movementYdone 6684 f4bd - and #%00000100 6685 f4bd - beq trakball1negativeY 6686 f4bd -trakball1positiveY 6687 f4bd - ;(2 from beq) 6688 f4bd - iny ; 2 6689 f4bd - jmp trakball1movementYdone ; 3 6690 f4bd -trakball1negativeY 6691 f4bd - ;(3 from beq) 6692 f4bd - dey ; 2 6693 f4bd - nop ; 2 6694 f4bd -trakball1movementYdone 6695 f4bd - endif ; !TRAKXONLY 6696 f4bd - 6697 f4bd - lda TIMINT 6698 f4bd - bpl trakball1updateloop 6699 f4bd - lda #0 6700 f4bd - cpx #0 6701 f4bd - beq trakball1skipXadjust 6702 f4bd - clc 6703 f4bd -trakball1Xloop 6704 f4bd - adc port1resolution 6705 f4bd - dex 6706 f4bd - bne trakball1Xloop 6707 f4bd - clc 6708 f4bd - adc trakballx1 6709 f4bd - sta trakballx1 6710 f4bd -trakball1skipXadjust 6711 f4bd - ifnconst TRAKXONLY 6712 f4bd - lda #0 6713 f4bd - cpy #0 6714 f4bd - beq trakball1skipYadjust 6715 f4bd - clc 6716 f4bd -trakball1yloop 6717 f4bd - adc port1resolution 6718 f4bd - dey 6719 f4bd - bne trakball1yloop 6720 f4bd - clc 6721 f4bd - adc trakbally1 6722 f4bd - sta trakbally1 6723 f4bd -trakball1skipYadjust 6724 f4bd - endif ; !TRAKXONLY 6725 f4bd - 6726 f4bd - jmp LLRET1 6727 f4bd endif 6728 f4bd 6729 f4bd 6730 f4bd paddleport0update 6731 f4bd - ifconst PADDLE0SUPPORT 6732 f4bd - lda #6 6733 f4bd - sta VBLANK ; start charging the paddle caps 6734 f4bd - lda #0 ; use PADDLE timing 6735 f4bd - jsr SETTIM64T ; INTIM is in Y 6736 f4bd - 6737 f4bd -paddleport0updateloop 6738 f4bd - lda INPT0 6739 f4bd - bmi skippaddle0setposition 6740 f4bd - sty paddleposition0 6741 f4bd -skippaddle0setposition 6742 f4bd - ifconst TWOPADDLESUPPORT 6743 f4bd - lda INPT1 6744 f4bd - bmi skippaddle1setposition 6745 f4bd - sty paddleposition1 6746 f4bd -skippaddle1setposition 6747 f4bd - endif 6748 f4bd - ldy INTIM 6749 f4bd - cpy #TIMEOFFSET 6750 f4bd - bcs paddleport0updateloop 6751 f4bd - 6752 f4bd - lda #%10000110 6753 f4bd - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 6754 f4bd - sec 6755 f4bd - lda paddleposition0 6756 f4bd - sbc #TIMEOFFSET 6757 f4bd - ifconst PADDLESCALEX2 6758 f4bd - asl 6759 f4bd - endif 6760 f4bd - 6761 f4bd - ifnconst PADDLESMOOTHINGOFF 6762 f4bd - clc 6763 f4bd - adc paddleprevious0 6764 f4bd - ror 6765 f4bd - sta paddleprevious0 6766 f4bd - endif 6767 f4bd - 6768 f4bd - sta paddleposition0 6769 f4bd - 6770 f4bd - ifconst TWOPADDLESUPPORT 6771 f4bd - sec 6772 f4bd - lda paddleposition1 6773 f4bd - sbc #TIMEOFFSET 6774 f4bd - ifconst PADDLESCALEX2 6775 f4bd - asl 6776 f4bd - endif 6777 f4bd - 6778 f4bd - ifnconst PADDLESMOOTHINGOFF 6779 f4bd - clc 6780 f4bd - adc paddleprevious1 6781 f4bd - ror 6782 f4bd - sta paddleprevious1 6783 f4bd - endif 6784 f4bd - sta paddleposition1 6785 f4bd - endif ; TWOPADDLESUPPORT 6786 f4bd - 6787 f4bd - jmp LLRET0 6788 f4bd endif 6789 f4bd 6790 f4bd paddleport1update 6791 f4bd - ifconst PADDLE1SUPPORT 6792 f4bd - lda #6 6793 f4bd - sta VBLANK ; start charging the paddle caps 6794 f4bd - 6795 f4bd - lda #0 ; use PADDLE timing 6796 f4bd - jsr SETTIM64T ; INTIM is in Y 6797 f4bd - 6798 f4bd -paddleport1updateloop 6799 f4bd - lda INPT2 6800 f4bd - bmi skippaddle2setposition 6801 f4bd - sty paddleposition2 6802 f4bd -skippaddle2setposition 6803 f4bd - ifconst TWOPADDLESUPPORT 6804 f4bd - lda INPT3 6805 f4bd - bmi skippaddle3setposition 6806 f4bd - sty paddleposition3 6807 f4bd -skippaddle3setposition 6808 f4bd - endif 6809 f4bd - ldy INTIM 6810 f4bd - cpy #TIMEOFFSET 6811 f4bd - bcs paddleport1updateloop 6812 f4bd - 6813 f4bd - lda #%10000110 6814 f4bd - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 6815 f4bd - sec 6816 f4bd - lda paddleposition2 6817 f4bd - sbc #TIMEOFFSET 6818 f4bd - ifconst PADDLESCALEX2 6819 f4bd - asl 6820 f4bd - endif 6821 f4bd - 6822 f4bd - ifnconst PADDLESMOOTHINGOFF 6823 f4bd - clc 6824 f4bd - adc paddleprevious2 6825 f4bd - ror 6826 f4bd - sta paddleprevious2 6827 f4bd - endif 6828 f4bd - 6829 f4bd - sta paddleposition2 6830 f4bd - 6831 f4bd - ifconst TWOPADDLESUPPORT 6832 f4bd - sec 6833 f4bd - lda paddleposition3 6834 f4bd - sbc #TIMEOFFSET 6835 f4bd - ifconst PADDLESCALEX2 6836 f4bd - asl 6837 f4bd - endif 6838 f4bd - 6839 f4bd - ifnconst PADDLESMOOTHINGOFF 6840 f4bd - clc 6841 f4bd - adc paddleprevious3 6842 f4bd - ror 6843 f4bd - sta paddleprevious3 6844 f4bd - endif 6845 f4bd - sta paddleposition3 6846 f4bd - endif ; TWOPADDLESUPPORT 6847 f4bd - 6848 f4bd - jmp LLRET1 6849 f4bd endif 6850 f4bd 6851 f4bd 6852 f4bd paddlebuttonhandler ; outside of conditional, for button-handler LUT 6853 f4bd - ifconst PADDLESUPPORT 6854 f4bd - ; x=0|1 for port, rather than paddle #. 6855 f4bd - ; Only the first paddle button will integrate into "joy0fire" testing. If the 6856 f4bd - ; game wants to support 2 paddles, up to the game to instead test the 6857 f4bd - ; joystick right+left directions instead. 6858 f4bd - lda SWCHA ; top of nibble is first paddle button 6859 f4bd - cpx #0 ; port 0? 6860 f4bd - beq skippaddleport2shift 6861 f4bd - asl ; shift second port to upper nibble 6862 f4bd - asl 6863 f4bd - asl 6864 f4bd - asl 6865 f4bd -skippaddleport2shift 6866 f4bd - and #%10000000 6867 f4bd - eor #%10000000 ; invert 6868 f4bd - sta sINPT1,x 6869 f4bd - jmp buttonreadloopreturn 6870 f4bd endif ; PADDLESUPPORT 6871 f4bd 6872 f4bd mousebuttonhandler ; outside of conditional, for button-handler LUT 6873 f4bd - ifconst MOUSESUPPORT 6874 f4bd - ; stick the mouse buttons in the correct shadow register... 6875 f4bd - txa 6876 f4bd - asl 6877 f4bd - tay ; y=x*2 6878 f4bd - lda INPT4,x 6879 f4bd - eor #%10000000 6880 f4bd - lsr 6881 f4bd - sta sINPT1,x 6882 f4bd - 6883 f4bd - lda INPT1,y 6884 f4bd - and #%10000000 6885 f4bd - eor #%10000000 6886 f4bd - ora sINPT1,x 6887 f4bd - sta sINPT1,x 6888 f4bd - jmp buttonreadloopreturn 6889 f4bd endif ; MOUSESUPPORT 6890 f4bd 6891 f4bd - ifconst KEYPADSUPPORT 6892 f4bd - ; ** select keypad rows 0 to 3 over 4 frames... 6893 f4bd -keypadrowselect 6894 f4bd - ldy #0 6895 f4bd - lda port0control 6896 f4bd - cmp #7 6897 f4bd - bne skipport0val 6898 f4bd - iny ; y=y+1 6899 f4bd -skipport0val 6900 f4bd - lda port1control 6901 f4bd - cmp #7 6902 f4bd - bne skipport1val 6903 f4bd - iny 6904 f4bd - iny ; y=y+2 6905 f4bd -skipport1val 6906 f4bd - lda keyrowdirectionmask,y 6907 f4bd - sta CTLSWA 6908 f4bd - tya 6909 f4bd - asl 6910 f4bd - asl 6911 f4bd - sta inttemp1 6912 f4bd - lda framecounter 6913 f4bd - and #3 6914 f4bd - ora inttemp1 6915 f4bd - tax 6916 f4bd - lda keyrowselectvalue,x 6917 f4bd - sta SWCHA 6918 f4bd - rts 6919 f4bd - 6920 f4bd -keyrowdirectionmask 6921 f4bd - .byte #%00000000 ; 0 : port0=input port1=input 6922 f4bd - .byte #%11110000 ; 1 : port0=output port1=input 6923 f4bd - .byte #%00001111 ; 2 : port0=input port1=output 6924 f4bd - .byte #%11111111 ; 3 : port0=output port1=output 6925 f4bd - 6926 f4bd -keyrowselectvalue 6927 f4bd - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 6928 f4bd - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 6929 f4bd - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 6930 f4bd - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 6931 f4bd endif ; KEYPADSUPPORT 6932 f4bd 6933 f4bd - ifconst KEYPADSUPPORT 6934 f4bd - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 6935 f4bd -keypadcolumnread 6936 f4bd - lda port0control 6937 f4bd - cmp #7 6938 f4bd - bne skipkeypadcolumnread0 6939 f4bd - lda framecounter 6940 f4bd - and #3 6941 f4bd - asl ; x2 because keypad variables are interleaved 6942 f4bd - tax 6943 f4bd - lda #0 6944 f4bd - sta keypadmatrix0a,x 6945 f4bd - lda INPT0 6946 f4bd - cmp #$80 6947 f4bd - rol keypadmatrix0a,x 6948 f4bd - lda INPT1 6949 f4bd - cmp #$80 6950 f4bd - rol keypadmatrix0a,x 6951 f4bd - lda INPT4 6952 f4bd - cmp #$80 6953 f4bd - rol keypadmatrix0a,x 6954 f4bd - lda keypadmatrix0a,x 6955 f4bd - eor #%00000111 6956 f4bd - sta keypadmatrix0a,x 6957 f4bd -skipkeypadcolumnread0 6958 f4bd - 6959 f4bd - lda port1control 6960 f4bd - cmp #7 6961 f4bd - bne skipkeypadcolumnread1 6962 f4bd - lda framecounter 6963 f4bd - and #3 6964 f4bd - asl ; x2 because keypad variables are interleaved 6965 f4bd - tax 6966 f4bd - lda #0 6967 f4bd - sta keypadmatrix1a,x 6968 f4bd - rol keypadmatrix1a,x 6969 f4bd - lda INPT2 6970 f4bd - cmp #$80 6971 f4bd - rol keypadmatrix1a,x 6972 f4bd - lda INPT3 6973 f4bd - cmp #$80 6974 f4bd - rol keypadmatrix1a,x 6975 f4bd - lda INPT5 6976 f4bd - cmp #$80 6977 f4bd - rol keypadmatrix1a,x 6978 f4bd - lda keypadmatrix1a,x 6979 f4bd - eor #%00000111 6980 f4bd - sta keypadmatrix1a,x 6981 f4bd -skipkeypadcolumnread1 6982 f4bd - rts 6983 f4bd endif ; KEYPADSUPPORT 6984 f4bd 6985 f4bd setportforinput 6986 f4bd a5 e4 lda CTLSWAs 6987 f4bf 3d c8 f4 and allpinsinputlut,x 6988 f4c2 85 e4 sta CTLSWAs 6989 f4c4 8d 81 02 sta CTLSWA 6990 f4c7 60 rts 6991 f4c8 6992 f4c8 allpinsinputlut 6993 f4c8 0f f0 .byte.b $0F, $F0 6994 f4ca 6995 f4ca setonebuttonmode 6996 f4ca a9 06 lda #6 ; in case we're in unlocked-bios mode 6997 f4cc 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 6998 f4ce a9 14 lda #$14 6999 f4d0 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 7000 f4d3 a5 e5 lda CTLSWBs 7001 f4d5 1d de f4 ora thisjoy2buttonbit,x 7002 f4d8 85 e5 sta CTLSWBs 7003 f4da 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 7004 f4dd 60 rts 7005 f4de 7006 f4de thisjoy2buttonbit 7007 f4de 04 10 .byte.b $04, $10 7008 f4e0 7009 f4e0 settwobuttonmode 7010 f4e0 a9 06 lda #6 ; in case we're in unlocked-bios mode 7011 f4e2 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 7012 f4e4 a9 14 lda #$14 7013 f4e6 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 7014 f4e9 a5 e5 lda CTLSWBs 7015 f4eb 3d f4 f4 and thisjoy2buttonmask,x 7016 f4ee 85 e5 sta CTLSWBs 7017 f4f0 8d 82 02 sta SWCHB 7018 f4f3 60 rts 7019 f4f4 7020 f4f4 thisjoy2buttonmask 7021 f4f4 fb ef .byte.b $fb, $ef 7022 f4f6 7023 f4f6 ; Provided under the CC0 license. See the included LICENSE.txt for details. 7024 f4f6 7025 f4f6 START 7026 f4f6 start 7027 f4f6 7028 f4f6 ;******** more or less the Atari recommended startup procedure 7029 f4f6 7030 f4f6 78 sei 7031 f4f7 d8 cld 7032 f4f8 7033 f4f8 ifnconst NOTIALOCK 7034 f4f8 a9 07 lda #$07 7035 f4fa - else 7036 f4fa - lda #$06 7037 f4fa endif 7038 f4fa 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 7039 f4fc a9 7f lda #$7F 7040 f4fe 85 3c sta CTRL ;disable DMA 7041 f500 a9 00 lda #$00 7042 f502 85 38 sta OFFSET 7043 f504 ifnconst NOTIALOCK 7044 f504 85 01 sta INPTCTRL 7045 f506 85 20 sta BACKGRND ; black default, in case a flash cart is using something else 7046 f508 endif 7047 f508 a2 ff ldx #$FF 7048 f50a 9a txs 7049 f50b 7050 f50b ;************** Clear Memory 7051 f50b 7052 f50b a2 40 ldx #$40 7053 f50d a9 00 lda #$00 7054 f50f crloop1 7055 f50f 95 00 sta $00,x ;Clear zero page 7056 f511 9d 00 01 sta $100,x ;Clear page 1 7057 f514 e8 inx 7058 f515 d0 f8 bne crloop1 7059 f517 7060 f517 7061 f517 a0 00 ldy #$00 ;Clear Ram 7062 f519 a9 18 lda #$18 ;Start at $1800 7063 f51b 85 81 sta $81 7064 f51d a9 00 lda #$00 7065 f51f 85 80 sta $80 7066 f521 crloop3 7067 f521 a9 00 lda #$00 7068 f523 91 80 sta ($80),y ;Store data 7069 f525 c8 iny ;Next byte 7070 f526 d0 f9 bne crloop3 ;Branch if not done page 7071 f528 e6 81 inc $81 ;Next page 7072 f52a a5 81 lda $81 7073 f52c c9 20 cmp #$20 ;End at $1FFF 7074 f52e d0 f1 bne crloop3 ;Branch if not 7075 f530 7076 f530 a0 00 ldy #$00 ;Clear Ram 7077 f532 a9 22 lda #$22 ;Start at $2200 7078 f534 85 81 sta $81 7079 f536 a9 00 lda #$00 7080 f538 85 80 sta $80 7081 f53a crloop4 7082 f53a a9 00 lda #$00 7083 f53c 91 80 sta ($80),y ;Store data 7084 f53e c8 iny ;Next byte 7085 f53f d0 f9 bne crloop4 ;Branch if not done page 7086 f541 e6 81 inc $81 ;Next page 7087 f543 a5 81 lda $81 7088 f545 c9 27 cmp #$27 ;End at $27FF 7089 f547 d0 f1 bne crloop4 ;Branch if not 7090 f549 7091 f549 a2 00 ldx #$00 7092 f54b a9 00 lda #$00 7093 f54d crloop5 ;Clear 2100-213F, 2000-203F 7094 f54d 9d 00 20 sta $2000,x 7095 f550 9d 00 21 sta $2100,x 7096 f553 e8 inx 7097 f554 e0 40 cpx #$40 7098 f556 d0 f5 bne crloop5 7099 f558 7100 f558 85 80 sta $80 7101 f55a 85 81 sta $81 7102 f55c 85 82 sta $82 7103 f55e 85 83 sta $83 7104 f560 7105 f560 ;seed random number with hopefully-random timer value 7106 f560 a9 01 lda #1 7107 f562 0d 84 02 ora INTIM 7108 f565 85 40 sta rand 7109 f567 7110 f567 ; detect the console type... 7111 f567 pndetectvblankstart 7112 f567 a5 28 lda MSTAT 7113 f569 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 7114 f56b pndetectvblankover 7115 f56b a5 28 lda MSTAT 7116 f56d 30 fc bmi pndetectvblankover ; then wait for it to be over 7117 f56f a0 00 ldy #$00 7118 f571 a2 00 ldx #$00 7119 f573 pndetectvblankhappening 7120 f573 a5 28 lda MSTAT 7121 f575 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 7122 f577 85 24 sta WSYNC 7123 f579 85 24 sta WSYNC 7124 f57b e8 inx 7125 f57c d0 f5 bne pndetectvblankhappening 7126 f57e pndetectinvblank 7127 f57e e0 7d cpx #125 7128 f580 90 02 bcc pndetecispal 7129 f582 a0 01 ldy #$01 7130 f584 pndetecispal 7131 f584 8c 09 21 sty paldetected 7132 f587 7133 f587 20 23 f4 jsr createallgamedlls 7134 f58a 7135 f58a a9 18 lda #>DLLMEM 7136 f58c 85 2c sta DPPH 7137 f58e a9 00 lda # 255 7332 f5b9 -DOUBLEBUFFEROFFSET = 255 7333 f5b9 else 7334 f5b9 00 4d DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 7335 f5b9 endif 7336 f5b9 7337 f5b9 - ifconst EXTRADLMEMORY 7338 f5b9 -SECONDDLHALFSTART SET $2300 7339 f5b9 endif 7340 f5b9 7341 f5b9 DLPOINTH 7342 f5b9 DLINDEX SET 0 7343 f5b9 REPEAT WZONECOUNT 7344 f5b9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5b9 - ifconst EXTRADLMEMORY 7346 f5b9 - if TMPMEMADDRESS > $1FFF 7347 f5b9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5b9 - else 7349 f5b9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5b9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5b9 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5b9 - endif 7353 f5b9 - endif ; TMPMEMADDRESS > $1FFF 7354 f5b9 endif ; EXTRADLMEMORY 7355 f5b9 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5b9 18 .byte.b >TMPMEMADDRESS 7357 f5b9 DLINDEX SET DLINDEX + 1 7343 f5b9 REPEND 7344 f5b9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5ba - ifconst EXTRADLMEMORY 7346 f5ba - if TMPMEMADDRESS > $1FFF 7347 f5ba -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5ba - else 7349 f5ba - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5ba -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5ba -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5ba - endif 7353 f5ba - endif ; TMPMEMADDRESS > $1FFF 7354 f5ba endif ; EXTRADLMEMORY 7355 f5ba ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5ba 18 .byte.b >TMPMEMADDRESS 7357 f5ba DLINDEX SET DLINDEX + 1 7343 f5ba REPEND 7344 f5ba TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5bb - ifconst EXTRADLMEMORY 7346 f5bb - if TMPMEMADDRESS > $1FFF 7347 f5bb -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5bb - else 7349 f5bb - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5bb -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5bb -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5bb - endif 7353 f5bb - endif ; TMPMEMADDRESS > $1FFF 7354 f5bb endif ; EXTRADLMEMORY 7355 f5bb ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5bb 19 .byte.b >TMPMEMADDRESS 7357 f5bb DLINDEX SET DLINDEX + 1 7343 f5bb REPEND 7344 f5bb TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5bc - ifconst EXTRADLMEMORY 7346 f5bc - if TMPMEMADDRESS > $1FFF 7347 f5bc -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5bc - else 7349 f5bc - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5bc -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5bc -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5bc - endif 7353 f5bc - endif ; TMPMEMADDRESS > $1FFF 7354 f5bc endif ; EXTRADLMEMORY 7355 f5bc ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5bc 19 .byte.b >TMPMEMADDRESS 7357 f5bc DLINDEX SET DLINDEX + 1 7343 f5bc REPEND 7344 f5bc TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5bd - ifconst EXTRADLMEMORY 7346 f5bd - if TMPMEMADDRESS > $1FFF 7347 f5bd -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5bd - else 7349 f5bd - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5bd -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5bd -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5bd - endif 7353 f5bd - endif ; TMPMEMADDRESS > $1FFF 7354 f5bd endif ; EXTRADLMEMORY 7355 f5bd ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5bd 19 .byte.b >TMPMEMADDRESS 7357 f5bd DLINDEX SET DLINDEX + 1 7343 f5bd REPEND 7344 f5bd TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5be - ifconst EXTRADLMEMORY 7346 f5be - if TMPMEMADDRESS > $1FFF 7347 f5be -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5be - else 7349 f5be - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5be -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5be -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5be - endif 7353 f5be - endif ; TMPMEMADDRESS > $1FFF 7354 f5be endif ; EXTRADLMEMORY 7355 f5be ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5be 1a .byte.b >TMPMEMADDRESS 7357 f5be DLINDEX SET DLINDEX + 1 7343 f5be REPEND 7344 f5be TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5bf - ifconst EXTRADLMEMORY 7346 f5bf - if TMPMEMADDRESS > $1FFF 7347 f5bf -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5bf - else 7349 f5bf - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5bf -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5bf -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5bf - endif 7353 f5bf - endif ; TMPMEMADDRESS > $1FFF 7354 f5bf endif ; EXTRADLMEMORY 7355 f5bf ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5bf 1a .byte.b >TMPMEMADDRESS 7357 f5bf DLINDEX SET DLINDEX + 1 7343 f5bf REPEND 7344 f5bf TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5c0 - ifconst EXTRADLMEMORY 7346 f5c0 - if TMPMEMADDRESS > $1FFF 7347 f5c0 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5c0 - else 7349 f5c0 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5c0 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5c0 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5c0 - endif 7353 f5c0 - endif ; TMPMEMADDRESS > $1FFF 7354 f5c0 endif ; EXTRADLMEMORY 7355 f5c0 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5c0 1a .byte.b >TMPMEMADDRESS 7357 f5c0 DLINDEX SET DLINDEX + 1 7343 f5c0 REPEND 7344 f5c0 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5c1 - ifconst EXTRADLMEMORY 7346 f5c1 - if TMPMEMADDRESS > $1FFF 7347 f5c1 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5c1 - else 7349 f5c1 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5c1 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5c1 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5c1 - endif 7353 f5c1 - endif ; TMPMEMADDRESS > $1FFF 7354 f5c1 endif ; EXTRADLMEMORY 7355 f5c1 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5c1 1b .byte.b >TMPMEMADDRESS 7357 f5c1 DLINDEX SET DLINDEX + 1 7343 f5c1 REPEND 7344 f5c1 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5c2 - ifconst EXTRADLMEMORY 7346 f5c2 - if TMPMEMADDRESS > $1FFF 7347 f5c2 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5c2 - else 7349 f5c2 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5c2 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5c2 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5c2 - endif 7353 f5c2 - endif ; TMPMEMADDRESS > $1FFF 7354 f5c2 endif ; EXTRADLMEMORY 7355 f5c2 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5c2 1b .byte.b >TMPMEMADDRESS 7357 f5c2 DLINDEX SET DLINDEX + 1 7343 f5c2 REPEND 7344 f5c2 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5c3 - ifconst EXTRADLMEMORY 7346 f5c3 - if TMPMEMADDRESS > $1FFF 7347 f5c3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5c3 - else 7349 f5c3 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5c3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5c3 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5c3 - endif 7353 f5c3 - endif ; TMPMEMADDRESS > $1FFF 7354 f5c3 endif ; EXTRADLMEMORY 7355 f5c3 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5c3 1b .byte.b >TMPMEMADDRESS 7357 f5c3 DLINDEX SET DLINDEX + 1 7343 f5c3 REPEND 7344 f5c3 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5c4 - ifconst EXTRADLMEMORY 7346 f5c4 - if TMPMEMADDRESS > $1FFF 7347 f5c4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5c4 - else 7349 f5c4 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5c4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5c4 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5c4 - endif 7353 f5c4 - endif ; TMPMEMADDRESS > $1FFF 7354 f5c4 endif ; EXTRADLMEMORY 7355 f5c4 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5c4 1b .byte.b >TMPMEMADDRESS 7357 f5c4 DLINDEX SET DLINDEX + 1 7343 f5c4 REPEND 7344 f5c4 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5c5 - ifconst EXTRADLMEMORY 7346 f5c5 - if TMPMEMADDRESS > $1FFF 7347 f5c5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5c5 - else 7349 f5c5 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5c5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5c5 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5c5 - endif 7353 f5c5 - endif ; TMPMEMADDRESS > $1FFF 7354 f5c5 endif ; EXTRADLMEMORY 7355 f5c5 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5c5 1c .byte.b >TMPMEMADDRESS 7357 f5c5 DLINDEX SET DLINDEX + 1 7343 f5c5 REPEND 7344 f5c5 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5c6 - ifconst EXTRADLMEMORY 7346 f5c6 - if TMPMEMADDRESS > $1FFF 7347 f5c6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5c6 - else 7349 f5c6 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5c6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5c6 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5c6 - endif 7353 f5c6 - endif ; TMPMEMADDRESS > $1FFF 7354 f5c6 endif ; EXTRADLMEMORY 7355 f5c6 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5c6 1c .byte.b >TMPMEMADDRESS 7357 f5c6 DLINDEX SET DLINDEX + 1 7343 f5c6 REPEND 7344 f5c6 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5c7 - ifconst EXTRADLMEMORY 7346 f5c7 - if TMPMEMADDRESS > $1FFF 7347 f5c7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5c7 - else 7349 f5c7 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5c7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5c7 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5c7 - endif 7353 f5c7 - endif ; TMPMEMADDRESS > $1FFF 7354 f5c7 endif ; EXTRADLMEMORY 7355 f5c7 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5c7 1c .byte.b >TMPMEMADDRESS 7357 f5c7 DLINDEX SET DLINDEX + 1 7343 f5c7 REPEND 7344 f5c7 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5c8 - ifconst EXTRADLMEMORY 7346 f5c8 - if TMPMEMADDRESS > $1FFF 7347 f5c8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5c8 - else 7349 f5c8 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5c8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5c8 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5c8 - endif 7353 f5c8 - endif ; TMPMEMADDRESS > $1FFF 7354 f5c8 endif ; EXTRADLMEMORY 7355 f5c8 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5c8 1d .byte.b >TMPMEMADDRESS 7357 f5c8 DLINDEX SET DLINDEX + 1 7343 f5c8 REPEND 7344 f5c8 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5c9 - ifconst EXTRADLMEMORY 7346 f5c9 - if TMPMEMADDRESS > $1FFF 7347 f5c9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5c9 - else 7349 f5c9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5c9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5c9 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5c9 - endif 7353 f5c9 - endif ; TMPMEMADDRESS > $1FFF 7354 f5c9 endif ; EXTRADLMEMORY 7355 f5c9 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5c9 1d .byte.b >TMPMEMADDRESS 7357 f5c9 DLINDEX SET DLINDEX + 1 7343 f5c9 REPEND 7344 f5c9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5ca - ifconst EXTRADLMEMORY 7346 f5ca - if TMPMEMADDRESS > $1FFF 7347 f5ca -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5ca - else 7349 f5ca - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5ca -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5ca -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5ca - endif 7353 f5ca - endif ; TMPMEMADDRESS > $1FFF 7354 f5ca endif ; EXTRADLMEMORY 7355 f5ca ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5ca 1d .byte.b >TMPMEMADDRESS 7357 f5ca DLINDEX SET DLINDEX + 1 7343 f5ca REPEND 7344 f5ca TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5cb - ifconst EXTRADLMEMORY 7346 f5cb - if TMPMEMADDRESS > $1FFF 7347 f5cb -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5cb - else 7349 f5cb - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5cb -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5cb -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5cb - endif 7353 f5cb - endif ; TMPMEMADDRESS > $1FFF 7354 f5cb endif ; EXTRADLMEMORY 7355 f5cb ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5cb 1e .byte.b >TMPMEMADDRESS 7357 f5cb DLINDEX SET DLINDEX + 1 7343 f5cb REPEND 7344 f5cb TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5cc - ifconst EXTRADLMEMORY 7346 f5cc - if TMPMEMADDRESS > $1FFF 7347 f5cc -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5cc - else 7349 f5cc - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5cc -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5cc -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5cc - endif 7353 f5cc - endif ; TMPMEMADDRESS > $1FFF 7354 f5cc endif ; EXTRADLMEMORY 7355 f5cc ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5cc 1e .byte.b >TMPMEMADDRESS 7357 f5cc DLINDEX SET DLINDEX + 1 7343 f5cc REPEND 7344 f5cc TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5cd - ifconst EXTRADLMEMORY 7346 f5cd - if TMPMEMADDRESS > $1FFF 7347 f5cd -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5cd - else 7349 f5cd - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5cd -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5cd -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5cd - endif 7353 f5cd - endif ; TMPMEMADDRESS > $1FFF 7354 f5cd endif ; EXTRADLMEMORY 7355 f5cd ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5cd 1e .byte.b >TMPMEMADDRESS 7357 f5cd DLINDEX SET DLINDEX + 1 7343 f5cd REPEND 7344 f5cd TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5ce - ifconst EXTRADLMEMORY 7346 f5ce - if TMPMEMADDRESS > $1FFF 7347 f5ce -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5ce - else 7349 f5ce - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5ce -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5ce -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5ce - endif 7353 f5ce - endif ; TMPMEMADDRESS > $1FFF 7354 f5ce endif ; EXTRADLMEMORY 7355 f5ce ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5ce 1f .byte.b >TMPMEMADDRESS 7357 f5ce DLINDEX SET DLINDEX + 1 7343 f5ce REPEND 7344 f5ce TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5cf - ifconst EXTRADLMEMORY 7346 f5cf - if TMPMEMADDRESS > $1FFF 7347 f5cf -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5cf - else 7349 f5cf - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5cf -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5cf -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5cf - endif 7353 f5cf - endif ; TMPMEMADDRESS > $1FFF 7354 f5cf endif ; EXTRADLMEMORY 7355 f5cf ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5cf 1f .byte.b >TMPMEMADDRESS 7357 f5cf DLINDEX SET DLINDEX + 1 7343 f5cf REPEND 7344 f5cf TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7345 f5d0 - ifconst EXTRADLMEMORY 7346 f5d0 - if TMPMEMADDRESS > $1FFF 7347 f5d0 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7348 f5d0 - else 7349 f5d0 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7350 f5d0 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7351 f5d0 -SECONDDLHALFSTART SET TMPMEMADDRESS 7352 f5d0 - endif 7353 f5d0 - endif ; TMPMEMADDRESS > $1FFF 7354 f5d0 endif ; EXTRADLMEMORY 7355 f5d0 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7356 f5d0 1f .byte.b >TMPMEMADDRESS 7357 f5d0 DLINDEX SET DLINDEX + 1 7358 f5d1 REPEND 7359 f5d1 7360 f5d1 - ifconst EXTRADLMEMORY 7361 f5d1 - echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 7362 f5d1 endif 7363 f5d1 7364 f5d1 7365 f5d1 DLPOINTL 7366 f5d1 DLINDEX SET 0 7367 f5d1 REPEAT WZONECOUNT 7368 f5d1 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7369 f5d1 - ifconst EXTRADLMEMORY 7370 f5d1 - if TMPMEMADDRESS > $1FFF 7371 f5d1 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5d1 - else 7373 f5d1 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5d1 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5d1 - endif 7376 f5d1 - endif ; TMPMEMADDRESS > $1FFF 7377 f5d1 endif ; EXTRADLMEMORY 7378 f5d1 80 .byte.b $1FFF 7371 f5d2 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5d2 - else 7373 f5d2 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5d2 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5d2 - endif 7376 f5d2 - endif ; TMPMEMADDRESS > $1FFF 7377 f5d2 endif ; EXTRADLMEMORY 7378 f5d2 d0 .byte.b $1FFF 7371 f5d3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5d3 - else 7373 f5d3 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5d3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5d3 - endif 7376 f5d3 - endif ; TMPMEMADDRESS > $1FFF 7377 f5d3 endif ; EXTRADLMEMORY 7378 f5d3 20 .byte.b $1FFF 7371 f5d4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5d4 - else 7373 f5d4 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5d4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5d4 - endif 7376 f5d4 - endif ; TMPMEMADDRESS > $1FFF 7377 f5d4 endif ; EXTRADLMEMORY 7378 f5d4 70 .byte.b $1FFF 7371 f5d5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5d5 - else 7373 f5d5 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5d5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5d5 - endif 7376 f5d5 - endif ; TMPMEMADDRESS > $1FFF 7377 f5d5 endif ; EXTRADLMEMORY 7378 f5d5 c0 .byte.b $1FFF 7371 f5d6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5d6 - else 7373 f5d6 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5d6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5d6 - endif 7376 f5d6 - endif ; TMPMEMADDRESS > $1FFF 7377 f5d6 endif ; EXTRADLMEMORY 7378 f5d6 10 .byte.b $1FFF 7371 f5d7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5d7 - else 7373 f5d7 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5d7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5d7 - endif 7376 f5d7 - endif ; TMPMEMADDRESS > $1FFF 7377 f5d7 endif ; EXTRADLMEMORY 7378 f5d7 60 .byte.b $1FFF 7371 f5d8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5d8 - else 7373 f5d8 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5d8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5d8 - endif 7376 f5d8 - endif ; TMPMEMADDRESS > $1FFF 7377 f5d8 endif ; EXTRADLMEMORY 7378 f5d8 b0 .byte.b $1FFF 7371 f5d9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5d9 - else 7373 f5d9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5d9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5d9 - endif 7376 f5d9 - endif ; TMPMEMADDRESS > $1FFF 7377 f5d9 endif ; EXTRADLMEMORY 7378 f5d9 00 .byte.b $1FFF 7371 f5da -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5da - else 7373 f5da - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5da -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5da - endif 7376 f5da - endif ; TMPMEMADDRESS > $1FFF 7377 f5da endif ; EXTRADLMEMORY 7378 f5da 50 .byte.b $1FFF 7371 f5db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5db - else 7373 f5db - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5db -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5db - endif 7376 f5db - endif ; TMPMEMADDRESS > $1FFF 7377 f5db endif ; EXTRADLMEMORY 7378 f5db a0 .byte.b $1FFF 7371 f5dc -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5dc - else 7373 f5dc - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5dc -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5dc - endif 7376 f5dc - endif ; TMPMEMADDRESS > $1FFF 7377 f5dc endif ; EXTRADLMEMORY 7378 f5dc f0 .byte.b $1FFF 7371 f5dd -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5dd - else 7373 f5dd - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5dd -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5dd - endif 7376 f5dd - endif ; TMPMEMADDRESS > $1FFF 7377 f5dd endif ; EXTRADLMEMORY 7378 f5dd 40 .byte.b $1FFF 7371 f5de -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5de - else 7373 f5de - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5de -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5de - endif 7376 f5de - endif ; TMPMEMADDRESS > $1FFF 7377 f5de endif ; EXTRADLMEMORY 7378 f5de 90 .byte.b $1FFF 7371 f5df -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5df - else 7373 f5df - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5df -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5df - endif 7376 f5df - endif ; TMPMEMADDRESS > $1FFF 7377 f5df endif ; EXTRADLMEMORY 7378 f5df e0 .byte.b $1FFF 7371 f5e0 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5e0 - else 7373 f5e0 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5e0 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5e0 - endif 7376 f5e0 - endif ; TMPMEMADDRESS > $1FFF 7377 f5e0 endif ; EXTRADLMEMORY 7378 f5e0 30 .byte.b $1FFF 7371 f5e1 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5e1 - else 7373 f5e1 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5e1 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5e1 - endif 7376 f5e1 - endif ; TMPMEMADDRESS > $1FFF 7377 f5e1 endif ; EXTRADLMEMORY 7378 f5e1 80 .byte.b $1FFF 7371 f5e2 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5e2 - else 7373 f5e2 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5e2 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5e2 - endif 7376 f5e2 - endif ; TMPMEMADDRESS > $1FFF 7377 f5e2 endif ; EXTRADLMEMORY 7378 f5e2 d0 .byte.b $1FFF 7371 f5e3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5e3 - else 7373 f5e3 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5e3 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5e3 - endif 7376 f5e3 - endif ; TMPMEMADDRESS > $1FFF 7377 f5e3 endif ; EXTRADLMEMORY 7378 f5e3 20 .byte.b $1FFF 7371 f5e4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5e4 - else 7373 f5e4 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5e4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5e4 - endif 7376 f5e4 - endif ; TMPMEMADDRESS > $1FFF 7377 f5e4 endif ; EXTRADLMEMORY 7378 f5e4 70 .byte.b $1FFF 7371 f5e5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5e5 - else 7373 f5e5 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5e5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5e5 - endif 7376 f5e5 - endif ; TMPMEMADDRESS > $1FFF 7377 f5e5 endif ; EXTRADLMEMORY 7378 f5e5 c0 .byte.b $1FFF 7371 f5e6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5e6 - else 7373 f5e6 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5e6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5e6 - endif 7376 f5e6 - endif ; TMPMEMADDRESS > $1FFF 7377 f5e6 endif ; EXTRADLMEMORY 7378 f5e6 10 .byte.b $1FFF 7371 f5e7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5e7 - else 7373 f5e7 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5e7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5e7 - endif 7376 f5e7 - endif ; TMPMEMADDRESS > $1FFF 7377 f5e7 endif ; EXTRADLMEMORY 7378 f5e7 60 .byte.b $1FFF 7371 f5e8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7372 f5e8 - else 7373 f5e8 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7374 f5e8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7375 f5e8 - endif 7376 f5e8 - endif ; TMPMEMADDRESS > $1FFF 7377 f5e8 endif ; EXTRADLMEMORY 7378 f5e8 b0 .byte.b $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 18 80 ZONE0ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 18 d0 ZONE1ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 19 20 ZONE2ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 19 70 ZONE3ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 19 c0 ZONE4ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1a 10 ZONE5ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1a 60 ZONE6ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1a b0 ZONE7ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1b 00 ZONE8ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1b 50 ZONE9ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1b a0 ZONE10ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1b f0 ZONE11ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1c 40 ZONE12ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1c 90 ZONE13ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1c e0 ZONE14ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1d 30 ZONE15ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1d 80 ZONE16ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1d d0 ZONE17ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1e 20 ZONE18ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1e 70 ZONE19ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1e c0 ZONE20ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1f 10 ZONE21ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1f 60 ZONE22ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7384 f5e9 REPEND 7385 f5e9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7386 f5e9 - ifconst EXTRADLMEMORY 7387 f5e9 - if TMPMEMADDRESS > $1FFF 7388 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7389 f5e9 - else 7390 f5e9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7391 f5e9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7392 f5e9 - endif 7393 f5e9 - endif ; TMPMEMADDRESS > $1FFF 7394 f5e9 endif ; EXTRADLMEMORY 7395 f5e9 7396 f5e9 1f b0 ZONE23ADDRESS = TMPMEMADDRESS 7397 f5e9 7398 f5e9 DLINDEX SET DLINDEX + 1 7399 f5e9 REPEND 7400 f5e9 7401 f5e9 $1880 to $1fff used as zone memory, allowing 15 display objects per zone. 7402 f5e9 echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 7403 f5e9 7404 f5e9 DLHEIGHT 7405 f5e9 REPEAT WZONECOUNT 7406 f5e9 07 .byte.b (WZONEHEIGHT-1) 7405 f5e9 REPEND 7406 f5ea 07 .byte.b (WZONEHEIGHT-1) 7405 f5ea REPEND 7406 f5eb 07 .byte.b (WZONEHEIGHT-1) 7405 f5eb REPEND 7406 f5ec 07 .byte.b (WZONEHEIGHT-1) 7405 f5ec REPEND 7406 f5ed 07 .byte.b (WZONEHEIGHT-1) 7405 f5ed REPEND 7406 f5ee 07 .byte.b (WZONEHEIGHT-1) 7405 f5ee REPEND 7406 f5ef 07 .byte.b (WZONEHEIGHT-1) 7405 f5ef REPEND 7406 f5f0 07 .byte.b (WZONEHEIGHT-1) 7405 f5f0 REPEND 7406 f5f1 07 .byte.b (WZONEHEIGHT-1) 7405 f5f1 REPEND 7406 f5f2 07 .byte.b (WZONEHEIGHT-1) 7405 f5f2 REPEND 7406 f5f3 07 .byte.b (WZONEHEIGHT-1) 7405 f5f3 REPEND 7406 f5f4 07 .byte.b (WZONEHEIGHT-1) 7405 f5f4 REPEND 7406 f5f5 07 .byte.b (WZONEHEIGHT-1) 7405 f5f5 REPEND 7406 f5f6 07 .byte.b (WZONEHEIGHT-1) 7405 f5f6 REPEND 7406 f5f7 07 .byte.b (WZONEHEIGHT-1) 7405 f5f7 REPEND 7406 f5f8 07 .byte.b (WZONEHEIGHT-1) 7405 f5f8 REPEND 7406 f5f9 07 .byte.b (WZONEHEIGHT-1) 7405 f5f9 REPEND 7406 f5fa 07 .byte.b (WZONEHEIGHT-1) 7405 f5fa REPEND 7406 f5fb 07 .byte.b (WZONEHEIGHT-1) 7405 f5fb REPEND 7406 f5fc 07 .byte.b (WZONEHEIGHT-1) 7405 f5fc REPEND 7406 f5fd 07 .byte.b (WZONEHEIGHT-1) 7405 f5fd REPEND 7406 f5fe 07 .byte.b (WZONEHEIGHT-1) 7405 f5fe REPEND 7406 f5ff 07 .byte.b (WZONEHEIGHT-1) 7405 f5ff REPEND 7406 f600 07 .byte.b (WZONEHEIGHT-1) 7407 f601 REPEND 7408 f601 7409 f601 ; Provided under the CC0 license. See the included LICENSE.txt for details. 7410 f601 7411 f601 ; a simple guard, than ensures the 7800basic code hasn't 7412 f601 ; spilled into the encryption area... 2429 bytes left in the 7800basic reserved area. 7413 f601 echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 7414 f601 - if (*>$FF7D) 7415 f601 - ERR ; abort the assembly 7416 f601 endif 7417 f601 ; Provided under the CC0 license. See the included LICENSE.txt for details. 7418 f601 7419 f601 - ifconst DEV 7420 f601 - ifnconst ZONEHEIGHT 7421 f601 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 7422 f601 - else 7423 f601 - if ZONEHEIGHT = 8 7424 f601 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 7425 f601 - else 7426 f601 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 7427 f601 - endif 7428 f601 - endif 7429 f601 endif 7430 f601 7431 f601 ; FF7E/FF7F contains the 7800basic crc checksum word 7432 f601 7433 f601 ; FF80 - FFF7 contains the 7800 encryption key 7434 f601 7435 f601 ifnconst bankswitchmode 7436 fff8 ORG $FFF8 7437 fff8 - else 7438 fff8 - ifconst ROM128K 7439 fff8 - ORG $27FF8 7440 fff8 - RORG $FFF8 7441 fff8 - endif 7442 fff8 - ifconst ROM144K 7443 fff8 - ORG $27FF8 7444 fff8 - RORG $FFF8 7445 fff8 - endif 7446 fff8 - ifconst ROM256K 7447 fff8 - ORG $47FF8 7448 fff8 - RORG $FFF8 7449 fff8 - endif 7450 fff8 - ifconst ROM272K 7451 fff8 - ORG $47FF8 7452 fff8 - RORG $FFF8 7453 fff8 - endif 7454 fff8 - ifconst ROM512K 7455 fff8 - ORG $87FF8 7456 fff8 - RORG $FFF8 7457 fff8 - endif 7458 fff8 - ifconst ROM528K 7459 fff8 - ORG $87FF8 7460 fff8 - RORG $FFF8 7461 fff8 - endif 7462 fff8 endif 7463 fff8 7464 fff8 7465 fff8 ff .byte.b $FF ; region verification. $FF=all regions 7466 fff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 7467 fffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 7468 fffa 7469 fffa ;Vectors 7470 fffa 00 f0 .word.w NMI 7471 fffc f6 f4 .word.w START 7472 fffe 5f f0 .word.w IRQ 7473 10000