------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Lucelia_Movement_demo.bas.asm LEVEL 1 PASS 3 1 28000 ???? ; MACRO.H 2 28000 ???? 3 28000 ???? ; Based on the 2600 macro.h file. 4 28000 ???? ; Macros irrelevant to the 7800 have been removed, and the sleep macro 5 28000 ???? ; has been adapted to give accurate results on the 7800. 6 28000 ???? 7 28000 ???? ; Version 1.0 2019/12/11 (based on the 2600 Version 1.05, 13/NOVEMBER/2003) 8 28000 ???? 9 28000 ???? ; Available macros... 10 28000 ???? ; SLEEP n - sleep for n cycles 11 28000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable 12 28000 ???? 13 28000 ???? ;------------------------------------------------------------------------------- 14 28000 ???? ; SLEEP duration 15 28000 ???? ; Original author: Thomas Jentzsch 16 28000 ???? ; Inserts code which takes the specified number of cycles to execute. This is 17 28000 ???? ; useful for code where precise timing is required. 18 28000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS. 19 28000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS 20 28000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards). 21 28000 ???? 22 28000 ???? MAC sleep 23 28000 ???? .CYCLES SET {1} 24 28000 ???? 25 28000 ???? IF .CYCLES < 2 26 28000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 27 28000 ???? ERR 28 28000 ???? ENDIF 29 28000 ???? 30 28000 ???? IF .CYCLES & 1 31 28000 ???? IFNCONST NO_ILLEGAL_OPCODES 32 28000 ???? nop $80 33 28000 ???? ELSE 34 28000 ???? bit $80 35 28000 ???? ENDIF 36 28000 ???? .CYCLES SET .CYCLES - 3 37 28000 ???? ENDIF 38 28000 ???? 39 28000 ???? REPEAT .CYCLES / 2 40 28000 ???? nop 41 28000 ???? REPEND 42 28000 ???? ENDM ;usage: SLEEP n (n>1) 43 28000 ???? 44 28000 ???? ;------------------------------------------------------- 45 28000 ???? ; SET_POINTER 46 28000 ???? ; Original author: Manuel Rotschkar 47 28000 ???? ; 48 28000 ???? ; Sets a 2 byte RAM pointer to an absolute address. 49 28000 ???? ; 50 28000 ???? ; Usage: SET_POINTER pointer, address 51 28000 ???? ; Example: SET_POINTER SpritePTR, SpriteData 52 28000 ???? ; 53 28000 ???? ; Note: Alters the accumulator, NZ flags 54 28000 ???? ; IN 1: 2 byte RAM location reserved for pointer 55 28000 ???? ; IN 2: absolute address 56 28000 ???? 57 28000 ???? MAC set_pointer 58 28000 ???? .POINTER SET {1} 59 28000 ???? .ADDRESS SET {2} 60 28000 ???? 61 28000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address 62 28000 ???? STA .POINTER ; Store in pointer 63 28000 ???? LDA #>.ADDRESS ; Get Hibyte of Address 64 28000 ???? STA .POINTER+1 ; Store in pointer+1 65 28000 ???? 66 28000 ???? ENDM 67 28000 ???? 68 28000 ???? ; EOF 69 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 70 28000 ???? 71 28000 ???? ; 7800MACRO.H 72 28000 ???? 73 28000 ???? ;------------------------------------------------------- 74 28000 ???? ; BOXCOLLISIONCHECK 75 28000 ???? ; author: Mike Saarna 76 28000 ???? ; 77 28000 ???? ; A general bounding box collision check. compares 2 rectangles of differing size 78 28000 ???? ; and shape for overlap. Carry is set for collision detected, clear for none. 79 28000 ???? ; 80 28000 ???? ; Usage: BOXCOLLISIONCHECK x1var,y1var,w1var,h1var,x2var,y2var,w2var,h2var 81 28000 ???? ; 82 28000 ???? 83 28000 ???? MAC boxcollisioncheck 84 28000 ???? .boxx1 SET {1} 85 28000 ???? .boxy1 SET {2} 86 28000 ???? .boxw1 SET {3} 87 28000 ???? .boxh1 SET {4} 88 28000 ???? .boxx2 SET {5} 89 28000 ???? .boxy2 SET {6} 90 28000 ???? .boxw2 SET {7} 91 28000 ???? .boxh2 SET {8} 92 28000 ???? 93 28000 ???? .DoXCollisionCheck 94 28000 ???? lda .boxx1 ;3 95 28000 ???? cmp .boxx2 ;2 96 28000 ???? bcs .X1isbiggerthanX2 ;2/3 97 28000 ???? .X2isbiggerthanX1 98 28000 ???? adc #.boxw1 ;2 99 28000 ???? cmp .boxx2 ;3 100 28000 ???? bcs .DoYCollisionCheck ;3/2 101 28000 ???? bcc .noboxcollision ;3 102 28000 ???? .X1isbiggerthanX2 103 28000 ???? clc ;2 104 28000 ???? sbc #.boxw2 ;2 105 28000 ???? cmp .boxx2 ;3 106 28000 ???? bcs .noboxcollision ;3/2 107 28000 ???? .DoYCollisionCheck 108 28000 ???? lda .boxy1 ;3 109 28000 ???? cmp .boxy2 ;3 110 28000 ???? bcs .Y1isbiggerthanY2 ;3/2 111 28000 ???? .Y2isbiggerthanY1 112 28000 ???? adc #.boxh1 ;2 113 28000 ???? cmp .boxy2 ;3 114 28000 ???? jmp .checkdone ;6 115 28000 ???? .Y1isbiggerthanY2 116 28000 ???? clc ;2 117 28000 ???? sbc #.boxh2 ;2 118 28000 ???? cmp .boxy2 ;3 119 28000 ???? bcs .noboxcollision ;3/2 120 28000 ???? .boxcollision 121 28000 ???? sec ;2 122 28000 ???? .byte $24 ; hardcoded "BIT [clc opcode]", used to skip over the following clc 123 28000 ???? .noboxcollision 124 28000 ???? clc ;2 125 28000 ???? .checkdone 126 28000 ???? 127 28000 ???? ENDM 128 28000 ???? 129 28000 ???? MAC median3 130 28000 ???? 131 28000 ???? ; A median filter (for smoothing paddle jitter) 132 28000 ???? ; this macro takes the current paddle value, compares it to historic 133 28000 ???? ; values, and replaces the current paddle value with the median. 134 28000 ???? ; 135 28000 ???? ; called as: MEDIAN3 STORAGE CURRENT 136 28000 ???? ; where STORAGE points to 3 consecutive bytes of memory. The first 2 137 28000 ???? ; must be dedicated to this MEDIAN filter. The last 1 is a temp. 138 28000 ???? ; where CURRENT is memory holding the new value you wish to compare to 139 28000 ???? ; the previous values, and update with the median value. 140 28000 ???? ; 141 28000 ???? ; returns: CURRENT (modified to contain median value) 142 28000 ???? ; 143 28000 ???? ; author: Mike Saarna (aka RevEng) 144 28000 ???? 145 28000 ???? .MedianBytes SET {1} 146 28000 ???? .NewValue SET {2} 147 28000 ???? 148 28000 ???? lda #0 149 28000 ???? ldy .NewValue 150 28000 ???? sty .MedianBytes+2 ; put the new value in the most "recent" slot 151 28000 ???? 152 28000 ???? ; build an index from relative size comparisons between our 3 values. 153 28000 ???? cpy .MedianBytes 154 28000 ???? rol 155 28000 ???? cpy .MedianBytes+1 156 28000 ???? rol 157 28000 ???? ldy .MedianBytes 158 28000 ???? cpy .MedianBytes+1 159 28000 ???? rol 160 28000 ???? tay 161 28000 ???? 162 28000 ???? ldx MedianOrderLUT,y ; convert the size-comparison index to an index to the median value 163 28000 ???? lda .MedianBytes,x 164 28000 ???? sta .NewValue ; we replace the new value memory with the median value 165 28000 ???? 166 28000 ???? ; then shift values from "newer" bytes to "older" bytes, leaving the 167 28000 ???? ; newest byte (.MedianBytes+2) empty for next time. 168 28000 ???? lda .MedianBytes+1 169 28000 ???? sta .MedianBytes 170 28000 ???? lda .MedianBytes+2 171 28000 ???? sta .MedianBytes+1 172 28000 ???? ifnconst MedianOrderLUT 173 28000 ???? jmp MedianOrderLUTend 174 28000 ???? MedianOrderLUT ; converts our "comparison index" to an index to the median value 175 28000 ???? .byte 0 ; 0 B2 < B0 < B1 176 28000 ???? .byte 1 ; 1 B2 < B1 < B0 177 28000 ???? .byte 2 ; 2 impossible 178 28000 ???? .byte 2 ; 3 B1 < B2 < B0 179 28000 ???? .byte 2 ; 4 B0 < B2 < B1 180 28000 ???? .byte 2 ; 5 impossible 181 28000 ???? .byte 1 ; 6 B0 < B1 < B2 182 28000 ???? .byte 0 ; 7 B1 < B0 < B2 183 28000 ???? MedianOrderLUTend 184 28000 ???? endif 185 28000 ???? ENDM 186 28000 ???? 187 28000 ???? MAC plotsprite 188 28000 ???? 189 28000 ???? ; A macro version of the plotsprite command. 190 28000 ???? ; This trades off rom space for speed. 191 28000 ???? ; It also doesn't check if the visible screen is displayed or not. 192 28000 ???? ; It has no training wheels. It is all rusty sharp edges. 193 28000 ???? 194 28000 ???? .GFXLabel SET {1} 195 28000 ???? .Palette SET {2} ; constant 196 28000 ???? .SpriteX SET {3} ; variable 197 28000 ???? .SpriteY SET {4} ; variable 198 28000 ???? .ByteOffset SET {5} ; variable 199 28000 ???? 200 28000 ???? lda .SpriteY 201 28000 ???? lsr 202 28000 ???? lsr 203 28000 ???? asr #%11111110 ; ensure carry is clear 204 28000 ???? if WZONEHEIGHT = 16 205 28000 ???? asr #%11111110 ; ensure carry is clear 206 28000 ???? endif 207 28000 ???? 208 28000 ???? tax 209 28000 ???? 210 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 211 28000 ???? sta dlpnt 212 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 213 28000 ???? sta dlpnt+1 214 28000 ???? 215 28000 ???? ldy dlend,x ; find the next new object position in this zone 216 28000 ???? 217 28000 ???? lda .ByteOffset 218 28000 ???? if {1}_width = 2 219 28000 ???? asl 220 28000 ???? endif 221 28000 ???? if {1}_width = 3 222 28000 ???? asl 223 28000 ???? adc .ByteOffset 224 28000 ???? endif 225 28000 ???? if {1}_width = 4 226 28000 ???? asl 227 28000 ???? asl 228 28000 ???? endif 229 28000 ???? if {1}_width = 5 230 28000 ???? asl 231 28000 ???? asl 232 28000 ???? adc .ByteOffset 233 28000 ???? endif 234 28000 ???? if {1}_width = 6 235 28000 ???? asl 236 28000 ???? adc .ByteOffset 237 28000 ???? asl 238 28000 ???? endif 239 28000 ???? if {1}_width = 7 240 28000 ???? asl 241 28000 ???? adc .ByteOffset 242 28000 ???? asl 243 28000 ???? adc .ByteOffset 244 28000 ???? endif 245 28000 ???? if {1}_width = 8 246 28000 ???? asl 247 28000 ???? asl 248 28000 ???? asl 249 28000 ???? endif 250 28000 ???? if {1}_width = 9 251 28000 ???? asl 252 28000 ???? asl 253 28000 ???? asl 254 28000 ???? adc .ByteOffset 255 28000 ???? endif 256 28000 ???? if {1}_width = 10 257 28000 ???? asl 258 28000 ???? asl 259 28000 ???? adc .ByteOffset 260 28000 ???? asl 261 28000 ???? endif 262 28000 ???? if {1}_width = 11 263 28000 ???? asl 264 28000 ???? asl 265 28000 ???? adc .ByteOffset 266 28000 ???? asl 267 28000 ???? adc .ByteOffset 268 28000 ???? endif 269 28000 ???? if {1}_width = 12 270 28000 ???? asl 271 28000 ???? adc .ByteOffset 272 28000 ???? asl 273 28000 ???? asl 274 28000 ???? endif 275 28000 ???? if {1}_width = 13 276 28000 ???? asl 277 28000 ???? adc .ByteOffset 278 28000 ???? asl 279 28000 ???? asl 280 28000 ???? adc .ByteOffset 281 28000 ???? endif 282 28000 ???? if {1}_width = 14 283 28000 ???? asl 284 28000 ???? adc .ByteOffset 285 28000 ???? asl 286 28000 ???? adc .ByteOffset 287 28000 ???? asl 288 28000 ???? endif 289 28000 ???? 290 28000 ???? adc #<.GFXLabel ; carry is clear via previous asl or asr 291 28000 ???? sta (dlpnt),y ; #1 - low byte object address 292 28000 ???? 293 28000 ???? iny 294 28000 ???? 295 28000 ???? lda #({1}_mode | %01000000) 296 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 297 28000 ???? 298 28000 ???? iny 299 28000 ???? 300 28000 ???? lda .SpriteY 301 28000 ???? and #(WZONEHEIGHT - 1) 302 28000 ???? cmp #1 ; clear carry if our sprite is just in this zone 303 28000 ???? ora #>.GFXLabel 304 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 305 28000 ???? 306 28000 ???? iny 307 28000 ???? 308 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 309 28000 ???? sta (dlpnt),y ; #4 - palette|width 310 28000 ???? 311 28000 ???? iny 312 28000 ???? 313 28000 ???? lda .SpriteX 314 28000 ???? sta (dlpnt),y ; #5 - x object position 315 28000 ???? 316 28000 ???? iny 317 28000 ???? sty dlend,x 318 28000 ???? 319 28000 ???? ifconst ALWAYSTERMINATE 320 28000 ???? iny 321 28000 ???? lda #0 322 28000 ???? sta (dlpnt),y 323 28000 ???? endif 324 28000 ???? 325 28000 ???? bcc .PLOTSPRITEend 326 28000 ???? 327 28000 ???? inx ; next zone 328 28000 ???? 329 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 330 28000 ???? sta dlpnt 331 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 332 28000 ???? sta dlpnt+1 333 28000 ???? 334 28000 ???? ldy dlend,x ; find the next new object position in this zone 335 28000 ???? 336 28000 ???? lda .ByteOffset 337 28000 ???? if {1}_width = 1 338 28000 ???? clc 339 28000 ???? endif 340 28000 ???? if {1}_width = 2 341 28000 ???? asl ; carry clear 342 28000 ???? endif 343 28000 ???? if {1}_width = 3 344 28000 ???? asl ; carry clear 345 28000 ???? adc .ByteOffset 346 28000 ???? endif 347 28000 ???? if {1}_width = 4 348 28000 ???? asl ; carry clear 349 28000 ???? asl 350 28000 ???? endif 351 28000 ???? if {1}_width = 5 352 28000 ???? asl ; carry clear 353 28000 ???? asl 354 28000 ???? adc .ByteOffset 355 28000 ???? endif 356 28000 ???? if {1}_width = 6 357 28000 ???? asl ; carry clear 358 28000 ???? adc .ByteOffset 359 28000 ???? asl 360 28000 ???? endif 361 28000 ???? if {1}_width = 7 362 28000 ???? asl ; carry clear 363 28000 ???? adc .ByteOffset 364 28000 ???? asl 365 28000 ???? endif 366 28000 ???? if {1}_width = 8 367 28000 ???? asl ; carry clear 368 28000 ???? asl 369 28000 ???? asl 370 28000 ???? endif 371 28000 ???? if {1}_width = 9 372 28000 ???? asl ; carry clear 373 28000 ???? asl 374 28000 ???? asl 375 28000 ???? adc .ByteOffset 376 28000 ???? endif 377 28000 ???? if {1}_width = 10 378 28000 ???? asl ; carry clear 379 28000 ???? asl 380 28000 ???? adc .ByteOffset 381 28000 ???? asl 382 28000 ???? endif 383 28000 ???? if {1}_width = 11 384 28000 ???? asl ; carry clear 385 28000 ???? asl 386 28000 ???? adc .ByteOffset 387 28000 ???? asl 388 28000 ???? adc .ByteOffset 389 28000 ???? endif 390 28000 ???? if {1}_width = 12 391 28000 ???? asl ; carry clear 392 28000 ???? adc .ByteOffset 393 28000 ???? asl 394 28000 ???? asl 395 28000 ???? endif 396 28000 ???? if {1}_width = 13 397 28000 ???? asl ; carry clear 398 28000 ???? adc .ByteOffset 399 28000 ???? asl 400 28000 ???? asl 401 28000 ???? adc .ByteOffset 402 28000 ???? endif 403 28000 ???? if {1}_width = 14 404 28000 ???? asl ; carry clear 405 28000 ???? adc .ByteOffset 406 28000 ???? asl 407 28000 ???? adc .ByteOffset 408 28000 ???? asl 409 28000 ???? endif 410 28000 ???? 411 28000 ???? adc #<.GFXLabel 412 28000 ???? sta (dlpnt),y ; #1 - low byte object address 413 28000 ???? 414 28000 ???? iny 415 28000 ???? 416 28000 ???? lda #({1}_mode | %01000000) 417 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 418 28000 ???? 419 28000 ???? iny 420 28000 ???? 421 28000 ???? lda .SpriteY 422 28000 ???? and #(WZONEHEIGHT - 1) 423 28000 ???? ora #>(.GFXLabel - (WZONEHEIGHT * 256)) ; start in the dma hole 424 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 425 28000 ???? 426 28000 ???? iny 427 28000 ???? 428 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 429 28000 ???? sta (dlpnt),y ; #4 - palette|width 430 28000 ???? 431 28000 ???? iny 432 28000 ???? 433 28000 ???? lda .SpriteX 434 28000 ???? sta (dlpnt),y ; #5 - x object position 435 28000 ???? 436 28000 ???? iny 437 28000 ???? sty dlend,x 438 28000 ???? 439 28000 ???? ifconst ALWAYSTERMINATE 440 28000 ???? iny 441 28000 ???? lda #0 442 28000 ???? sta (dlpnt),y 443 28000 ???? endif 444 28000 ???? 445 28000 ???? .PLOTSPRITEend 446 28000 ???? ENDM 447 28000 ???? 448 28000 ???? MAC sizeof 449 28000 ???? 450 28000 ???? ; echo's the size difference between the current address and the 451 28000 ???? ; a label that was passed as an argument. This is a quick way to 452 28000 ???? ; determine the size of a structure. 453 28000 ???? 454 28000 ???? .NAME SETSTR {1} 455 28000 ???? echo " The Size of",.NAME,"is:",[* - {1}]d,[* - {2}]d,"bytes." 456 28000 ???? ENDM 457 28000 ???? 458 28000 ???? ; 459 28000 ???? ; speakjet.inc 460 28000 ???? ; 461 28000 ???? ; 462 28000 ???? ; AtariVox Speech Synth Driver 463 28000 ???? ; 464 28000 ???? ; By Alex Herbert, 2004 465 28000 ???? ; 466 28000 ???? 467 28000 ???? 468 28000 ???? 469 28000 ???? 470 28000 ???? ; Constants 471 28000 ???? 472 28000 ???? 473 28000 ???? 00 01 SERIAL_OUTMASK equ $01 474 28000 ???? 00 02 SERIAL_RDYMASK equ $02 475 28000 ???? 476 28000 ???? 477 28000 ???? 478 28000 ???? ; Macros 479 28000 ???? 480 28000 ???? mac spkout 481 28000 ???? 482 28000 ???? ; check buffer-full status 483 28000 ???? lda SWCHA 484 28000 ???? and #SERIAL_RDYMASK 485 28000 ???? beq .speech_done 486 28000 ???? 487 28000 ???? ; get next speech byte 488 28000 ???? ldy #$00 489 28000 ???? lda (speech_addr),y 490 28000 ???? 491 28000 ???? ; invert data and check for end of string 492 28000 ???? eor #$ff 493 28000 ???? ;sta BACKGRND ; debug - uncomment to flash the background color with vox data 494 28000 ???? beq .speech_done 495 28000 ???? sta {1} 496 28000 ???? 497 28000 ???? ; increment speech pointer 498 28000 ???? inc speech_addr 499 28000 ???? bne .incaddr_skip 500 28000 ???? inc speech_addr+1 501 28000 ???? .incaddr_skip 502 28000 ???? 503 28000 ???? ; output byte as serial data 504 28000 ???? 505 28000 ???? sec ; start bit 506 28000 ???? .byteout_loop 507 28000 ???? ; put carry flag into bit 0 of SWACNT, perserving other bits 508 28000 ???? lda SWACNT ; 4 509 28000 ???? and #$fe ; 2 6 510 28000 ???? adc #$00 ; 2 8 511 28000 ???? sta SWACNT ; 4 12 512 28000 ???? 513 28000 ???? ; 10 bits sent? (1 start bit, 8 data bits, 1 stop bit) 514 28000 ???? cpy #$09 ; 2 14 515 28000 ???? beq .speech_done ; 2 16 516 28000 ???? iny ; 2 18 517 28000 ???? 518 28000 ???? ; the 7800 is 1.5x faster than the 2600. Waste more cycles here 519 28000 ???? ; to match the original baud rate... 520 28000 ???? ;ldx #$07 ; 2600 521 28000 ???? ldx #$0D 522 28000 ???? 523 28000 ???? .delay_loop 524 28000 ???? dex ; 525 28000 ???? bne .delay_loop ; 36 54 526 28000 ???? 527 28000 ???? ; shift next data bit into carry 528 28000 ???? lsr {1} ; 5 59 529 28000 ???? 530 28000 ???? ; and loop (branch always taken) 531 28000 ???? bpl .byteout_loop ; 3 62 cycles for loop 532 28000 ???? 533 28000 ???? .speech_done 534 28000 ???? 535 28000 ???? endm 536 28000 ???? 537 28000 ???? 538 28000 ???? mac speak 539 28000 ???? 540 28000 ???? lda #<{1} 541 28000 ???? sta speech_addr 542 28000 ???? lda #>{1} 543 28000 ???? sta speech_addr+1 544 28000 ???? 545 28000 ???? endm 546 28000 ???? 547 28000 ???? 548 28000 ???? 549 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 550 28000 ???? 551 28000 ???? processor 6502 552 28000 ???? ------- FILE 7800basic.h LEVEL 2 PASS 3 0 28000 ???? include "7800basic.h" 1 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 28000 ???? 3 28000 ???? processor 6502 ------- FILE 7800.h LEVEL 3 PASS 3 0 28000 ???? include "7800.h" 1 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 28000 ???? 3 28000 ???? ; 7800.h 4 28000 ???? ; Version 1.0, 2019/12/13 5 28000 ???? 6 28000 ???? ; This file defines hardware registers and memory mapping for the 7 28000 ???? ; Atari 7800. It is distributed as a companion machine-specific support package 8 28000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are 9 28000 ???? ; available at https://github.com/dasm-assembler/dasm 10 28000 ???? 11 28000 ???? 12 28000 ???? ; ******************** 7800 Hardware Adresses *************************** 13 28000 ???? ; 14 28000 ???? ; MEMORY MAP USAGE OF THE 7800 15 28000 ???? ; 16 28000 ???? ; 00 - 1F TIA REGISTERS 17 28000 ???? ; 20 - 3F MARIA REGISTERS 18 28000 ???? ; 40 - FF RAM block 0 (zero page) 19 28000 ???? ; 100 - 11F TIA (mirror of 0000-001f) 20 28000 ???? ; 120 - 13F MARIA (mirror of 0020-003f) 21 28000 ???? ; 140 - 1FF RAM block 1 (stack) 22 28000 ???? ; 200 - 21F TIA (mirror of 0000-001f) 23 28000 ???? ; 220 - 23F MARIA (mirror of 0020-003f) 24 28000 ???? ; 240 - 27F ??? 25 28000 ???? ; 280 - 2FF RIOT I/O ports and timers 26 28000 ???? ; 300 - 31F TIA (mirror of 0000-001f) 27 28000 ???? ; 320 - 33F MARIA (mirror of 0020-003f) 28 28000 ???? ; 340 - 3FF ??? 29 28000 ???? ; 400 - 47F unused address space 30 28000 ???? ; 480 - 4FF RIOT RAM 31 28000 ???? ; 500 - 57F unused address space 32 28000 ???? ; 580 - 5FF RIOT RAM (mirror of 0480-04ff) 33 28000 ???? ; 600 - 17FF unused address space 34 28000 ???? ; 1800 - 203F RAM 35 28000 ???? ; 2040 - 20FF RAM block 0 (mirror of 0000-001f) 36 28000 ???? ; 2100 - 213F RAM 37 28000 ???? ; 2140 - 21FF RAM block 1 (mirror of 0140-01ff) 38 28000 ???? ; 2200 - 27FF RAM 39 28000 ???? ; 2800 - 2FFF mirror of 1800-27ff 40 28000 ???? ; 3000 - 3FFF unused address space 41 28000 ???? ; 4000 - FF7F potential cartridge address space 42 28000 ???? ; FF80 - FFF9 RESERVED FOR ENCRYPTION 43 28000 ???? ; FFFA - FFFF 6502 VECTORS 44 28000 ???? 45 28000 ???? 46 28000 ???? ;****** 00-1F ********* TIA REGISTERS ****************** 47 28000 ???? 48 28000 ???? 00 01 INPTCTRL = $01 ;Input control. In same address space as TIA. write-only 49 28000 ???? 00 01 VBLANK = $01 ;VBLANK. D7=1:dump paddle caps to ground. write-only 50 28000 ???? 00 08 INPT0 = $08 ;Paddle Control Input 0 read-only 51 28000 ???? 00 09 INPT1 = $09 ;Paddle Control Input 1 read-only 52 28000 ???? 00 0a INPT2 = $0A ;Paddle Control Input 2 read-only 53 28000 ???? 00 0b INPT3 = $0B ;Paddle Control Input 3 read-only 54 28000 ???? 55 28000 ???? ; ** some common alternate names for INPT0/1/2/3 56 28000 ???? 00 08 INPT4B = $08 ;Joystick 0 Fire 1 read-only 57 28000 ???? 00 09 INPT4A = $09 ;Joystick 0 Fire 1 read-only 58 28000 ???? 00 0a INPT5B = $0A ;Joystick 1 Fire 0 read-only 59 28000 ???? 00 0b INPT5A = $0B ;Joystick 1 Fire 1 read-only 60 28000 ???? 00 08 INPT4R = $08 ;Joystick 0 Fire 1 read-only 61 28000 ???? 00 09 INPT4L = $09 ;Joystick 0 Fire 1 read-only 62 28000 ???? 00 0a INPT5R = $0A ;Joystick 1 Fire 0 read-only 63 28000 ???? 00 0b INPT5L = $0B ;Joystick 1 Fire 1 read-only 64 28000 ???? 65 28000 ???? 00 0c INPT4 = $0C ;Player 0 Fire Button Input read-only 66 28000 ???? 00 0d INPT5 = $0D ;Player 1 Fire Button Input read-only 67 28000 ???? 68 28000 ???? 00 15 AUDC0 = $15 ;Audio Control Channel 0 write-only 69 28000 ???? 00 16 AUDC1 = $16 ;Audio Control Channel 1 write-only 70 28000 ???? 00 17 AUDF0 = $17 ;Audio Frequency Channel 0 write-only 71 28000 ???? 00 18 AUDF1 = $18 ;Audio Frequency Channel 1 write-only 72 28000 ???? 00 19 AUDV0 = $19 ;Audio Volume Channel 0 write-only 73 28000 ???? 00 1a AUDV1 = $1A ;Audio Volume Channel 1 write-only 74 28000 ???? 75 28000 ???? ;****** 20-3F ********* MARIA REGISTERS *************** 76 28000 ???? 77 28000 ???? 00 20 BACKGRND = $20 ;Background Color write-only 78 28000 ???? 00 21 P0C1 = $21 ;Palette 0 - Color 1 write-only 79 28000 ???? 00 22 P0C2 = $22 ;Palette 0 - Color 2 write-only 80 28000 ???? 00 23 P0C3 = $23 ;Palette 0 - Color 3 write-only 81 28000 ???? 00 24 WSYNC = $24 ;Wait For Sync write-only 82 28000 ???? 00 25 P1C1 = $25 ;Palette 1 - Color 1 write-only 83 28000 ???? 00 26 P1C2 = $26 ;Palette 1 - Color 2 write-only 84 28000 ???? 00 27 P1C3 = $27 ;Palette 1 - Color 3 write-only 85 28000 ???? 00 28 MSTAT = $28 ;Maria Status read-only 86 28000 ???? 00 29 P2C1 = $29 ;Palette 2 - Color 1 write-only 87 28000 ???? 00 2a P2C2 = $2A ;Palette 2 - Color 2 write-only 88 28000 ???? 00 2b P2C3 = $2B ;Palette 2 - Color 3 write-only 89 28000 ???? 00 2c DPPH = $2C ;Display List List Pointer High write-only 90 28000 ???? 00 2d P3C1 = $2D ;Palette 3 - Color 1 write-only 91 28000 ???? 00 2e P3C2 = $2E ;Palette 3 - Color 2 write-only 92 28000 ???? 00 2f P3C3 = $2F ;Palette 3 - Color 3 write-only 93 28000 ???? 00 30 DPPL = $30 ;Display List List Pointer Low write-only 94 28000 ???? 00 31 P4C1 = $31 ;Palette 4 - Color 1 write-only 95 28000 ???? 00 32 P4C2 = $32 ;Palette 4 - Color 2 write-only 96 28000 ???? 00 33 P4C3 = $33 ;Palette 4 - Color 3 write-only 97 28000 ???? 00 34 CHARBASE = $34 ;Character Base Address write-only 98 28000 ???? 00 34 CHBASE = $34 ;Character Base Address write-only 99 28000 ???? 00 35 P5C1 = $35 ;Palette 5 - Color 1 write-only 100 28000 ???? 00 36 P5C2 = $36 ;Palette 5 - Color 2 write-only 101 28000 ???? 00 37 P5C3 = $37 ;Palette 5 - Color 3 write-only 102 28000 ???? 00 38 OFFSET = $38 ;Unused - Store zero here write-only 103 28000 ???? 00 39 P6C1 = $39 ;Palette 6 - Color 1 write-only 104 28000 ???? 00 3a P6C2 = $3A ;Palette 6 - Color 2 write-only 105 28000 ???? 00 3b P6C3 = $3B ;Palette 6 - Color 3 write-only 106 28000 ???? 00 3c CTRL = $3C ;Maria Control Register write-only 107 28000 ???? 00 3d P7C1 = $3D ;Palette 7 - Color 1 write-only 108 28000 ???? 00 3e P7C2 = $3E ;Palette 7 - Color 2 write-only 109 28000 ???? 00 3f P7C3 = $3F ;Palette 7 - Color 3 write-only 110 28000 ???? 111 28000 ???? 112 28000 ???? ;****** 280-2FF ******* PIA PORTS AND TIMERS ************ 113 28000 ???? 114 28000 ???? 02 80 SWCHA = $280 ;P0+P1 Joystick Directional Input read-write 115 28000 ???? 02 81 CTLSWA = $281 ;I/O Control for SCHWA read-write 116 28000 ???? 02 81 SWACNT = $281 ;VCS name for above read-write 117 28000 ???? 02 82 SWCHB = $282 ;Console Switches read-write 118 28000 ???? 02 83 CTLSWB = $283 ;I/O Control for SCHWB read-write 119 28000 ???? 02 83 SWBCNT = $283 ;VCS name for above read-write 120 28000 ???? 121 28000 ???? 02 84 INTIM = $284 ;Interval Timer Read read-only 122 28000 ???? 02 94 TIM1T = $294 ;Set 1 CLK Interval (838 nsec/interval) write-only 123 28000 ???? 02 95 TIMINT = $295 ;Interval Timer Interrupt read-only 124 28000 ???? 02 95 TIM8T = $295 ;Set 8 CLK Interval (6.7 usec/interval) write-only 125 28000 ???? 02 96 TIM64T = $296 ;Set 64 CLK Interval (63.6 usec/interval) write-only 126 28000 ???? 02 97 T1024T = $297 ;Set 1024 CLK Interval (858.2 usec/interval) write-only 127 28000 ???? 02 9e TIM64TI = $29E ;Interrupt timer 64T write-only 128 28000 ???? 129 28000 ???? ;XM 130 28000 ???? 04 70 XCTRL = $470 ; 7=YM2151 6=RAM@6k 5=RAM@4k 4=pokey@450 3=hsc 2=cart 1=RoF_bank1 0=RoF_bank2 131 28000 ???? 04 70 XCTRL1 = $470 132 28000 ???? 04 78 XCTRL2 = $478 133 28000 ???? 04 7c XCTRL3 = $47c 134 28000 ???? 04 71 XCTRL4 = $471 135 28000 ???? 04 72 XCTRL5 = $472 136 28000 ???? 137 28000 ???? ; Pokey register relative locations, since its base may be different 138 28000 ???? ; depending on the hardware. 139 28000 ???? 00 00 PAUDF0 = $0 ; extra audio channels and frequencies 140 28000 ???? 00 01 PAUDC0 = $1 141 28000 ???? 00 02 PAUDF1 = $2 142 28000 ???? 00 03 PAUDC1 = $3 143 28000 ???? 00 04 PAUDF2 = $4 144 28000 ???? 00 05 PAUDC2 = $5 145 28000 ???? 00 06 PAUDF3 = $6 146 28000 ???? 00 07 PAUDC3 = $7 147 28000 ???? 00 08 PAUDCTL = $8 ; Audio Control 148 28000 ???? 00 09 PSTIMER = $9 149 28000 ???? 00 0a PRANDOM = $A ; 17 bit polycounter pseudo random 150 28000 ???? 00 0f PSKCTL = $F ; Serial Port control ------- FILE 7800basic.h ------- FILE 7800basic_variable_redefs.h LEVEL 3 PASS 3 0 28000 ???? include "7800basic_variable_redefs.h" 1 28000 ???? ; This file contains variable mapping and other information for the current project. 2 28000 ???? 3 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_02_mode = $00 4 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_02_width_twoscompliment = $00 5 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_02_width = $00 6 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_01_mode = $00 7 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_8_tallsprite_01_width_twoscompliment = $1d 8 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_8_tallsprite_01_width = $03 9 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_00_mode = $00 10 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_8_tallsprite_00_width_twoscompliment = $1d 11 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_8_tallsprite_00_width = $03 12 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_mode = $00 13 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_8_width_twoscompliment = $1d 14 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_8_width = $03 15 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_tallsprite_01_mode = $00 16 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_7_tallsprite_01_width_twoscompliment = $1d 17 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_7_tallsprite_01_width = $03 18 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_tallsprite_00_mode = $00 19 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_7_tallsprite_00_width_twoscompliment = $1d 20 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_7_tallsprite_00_width = $03 21 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_mode = $00 22 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_7_width_twoscompliment = $1d 23 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_7_width = $03 24 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_tallsprite_01_mode = $00 25 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_6_tallsprite_01_width_twoscompliment = $1d 26 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_6_tallsprite_01_width = $03 27 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_tallsprite_00_mode = $00 28 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_6_tallsprite_00_width_twoscompliment = $1d 29 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_6_tallsprite_00_width = $03 30 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_mode = $00 31 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_6_width_twoscompliment = $1d 32 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_6_width = $03 33 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_tallsprite_01_mode = $00 34 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_5_tallsprite_01_width_twoscompliment = $1d 35 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_5_tallsprite_01_width = $03 36 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_tallsprite_00_mode = $00 37 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_5_tallsprite_00_width_twoscompliment = $1d 38 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_5_tallsprite_00_width = $03 39 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_mode = $00 40 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_5_width_twoscompliment = $1d 41 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_5_width = $03 42 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_tallsprite_01_mode = $00 43 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_4_tallsprite_01_width_twoscompliment = $1d 44 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_4_tallsprite_01_width = $03 45 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_tallsprite_00_mode = $00 46 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_4_tallsprite_00_width_twoscompliment = $1d 47 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_4_tallsprite_00_width = $03 48 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_mode = $00 49 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_4_width_twoscompliment = $1d 50 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_4_width = $03 51 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_tallsprite_01_mode = $00 52 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_3_tallsprite_01_width_twoscompliment = $1d 53 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_3_tallsprite_01_width = $03 54 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_tallsprite_00_mode = $00 55 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_3_tallsprite_00_width_twoscompliment = $1d 56 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_3_tallsprite_00_width = $03 57 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_mode = $00 58 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_3_width_twoscompliment = $1d 59 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_3_width = $03 60 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_tallsprite_01_mode = $00 61 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_2_tallsprite_01_width_twoscompliment = $1d 62 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_2_tallsprite_01_width = $03 63 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_tallsprite_00_mode = $00 64 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_2_tallsprite_00_width_twoscompliment = $1d 65 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_2_tallsprite_00_width = $03 66 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_mode = $00 67 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_2_width_twoscompliment = $1d 68 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_2_width = $03 69 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_tallsprite_01_mode = $00 70 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_1_tallsprite_01_width_twoscompliment = $1d 71 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_1_tallsprite_01_width = $03 72 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_tallsprite_00_mode = $00 73 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_1_tallsprite_00_width_twoscompliment = $1d 74 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_1_tallsprite_00_width = $03 75 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_mode = $00 76 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_1_width_twoscompliment = $1d 77 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_1_width = $03 78 28000 ???? 00 00 heofonfir_lucelia_layer1_8_tallsprite_01_mode = $00 79 28000 ???? 00 1d heofonfir_lucelia_layer1_8_tallsprite_01_width_twoscompliment = $1d 80 28000 ???? 00 03 heofonfir_lucelia_layer1_8_tallsprite_01_width = $03 81 28000 ???? 00 00 heofonfir_lucelia_layer1_8_tallsprite_00_mode = $00 82 28000 ???? 00 1d heofonfir_lucelia_layer1_8_tallsprite_00_width_twoscompliment = $1d 83 28000 ???? 00 03 heofonfir_lucelia_layer1_8_tallsprite_00_width = $03 84 28000 ???? 00 00 heofonfir_lucelia_layer1_8_mode = $00 85 28000 ???? 00 1d heofonfir_lucelia_layer1_8_width_twoscompliment = $1d 86 28000 ???? 00 03 heofonfir_lucelia_layer1_8_width = $03 87 28000 ???? 00 00 heofonfir_lucelia_layer1_7_tallsprite_01_mode = $00 88 28000 ???? 00 1d heofonfir_lucelia_layer1_7_tallsprite_01_width_twoscompliment = $1d 89 28000 ???? 00 03 heofonfir_lucelia_layer1_7_tallsprite_01_width = $03 90 28000 ???? 00 00 heofonfir_lucelia_layer1_7_tallsprite_00_mode = $00 91 28000 ???? 00 1d heofonfir_lucelia_layer1_7_tallsprite_00_width_twoscompliment = $1d 92 28000 ???? 00 03 heofonfir_lucelia_layer1_7_tallsprite_00_width = $03 93 28000 ???? 00 00 heofonfir_lucelia_layer1_7_mode = $00 94 28000 ???? 00 1d heofonfir_lucelia_layer1_7_width_twoscompliment = $1d 95 28000 ???? 00 03 heofonfir_lucelia_layer1_7_width = $03 96 28000 ???? 00 00 heofonfir_lucelia_layer1_6_tallsprite_01_mode = $00 97 28000 ???? 00 1d heofonfir_lucelia_layer1_6_tallsprite_01_width_twoscompliment = $1d 98 28000 ???? 00 03 heofonfir_lucelia_layer1_6_tallsprite_01_width = $03 99 28000 ???? 00 00 heofonfir_lucelia_layer1_6_tallsprite_00_mode = $00 100 28000 ???? 00 1d heofonfir_lucelia_layer1_6_tallsprite_00_width_twoscompliment = $1d 101 28000 ???? 00 03 heofonfir_lucelia_layer1_6_tallsprite_00_width = $03 102 28000 ???? 00 00 heofonfir_lucelia_layer1_6_mode = $00 103 28000 ???? 00 1d heofonfir_lucelia_layer1_6_width_twoscompliment = $1d 104 28000 ???? 00 03 heofonfir_lucelia_layer1_6_width = $03 105 28000 ???? 00 00 heofonfir_lucelia_layer1_5_tallsprite_01_mode = $00 106 28000 ???? 00 1d heofonfir_lucelia_layer1_5_tallsprite_01_width_twoscompliment = $1d 107 28000 ???? 00 03 heofonfir_lucelia_layer1_5_tallsprite_01_width = $03 108 28000 ???? 00 00 heofonfir_lucelia_layer1_5_tallsprite_00_mode = $00 109 28000 ???? 00 1d heofonfir_lucelia_layer1_5_tallsprite_00_width_twoscompliment = $1d 110 28000 ???? 00 03 heofonfir_lucelia_layer1_5_tallsprite_00_width = $03 111 28000 ???? 00 00 heofonfir_lucelia_layer1_5_mode = $00 112 28000 ???? 00 1d heofonfir_lucelia_layer1_5_width_twoscompliment = $1d 113 28000 ???? 00 03 heofonfir_lucelia_layer1_5_width = $03 114 28000 ???? 00 00 heofonfir_lucelia_layer1_4_tallsprite_01_mode = $00 115 28000 ???? 00 1d heofonfir_lucelia_layer1_4_tallsprite_01_width_twoscompliment = $1d 116 28000 ???? 00 03 heofonfir_lucelia_layer1_4_tallsprite_01_width = $03 117 28000 ???? 00 00 heofonfir_lucelia_layer1_4_tallsprite_00_mode = $00 118 28000 ???? 00 1d heofonfir_lucelia_layer1_4_tallsprite_00_width_twoscompliment = $1d 119 28000 ???? 00 03 heofonfir_lucelia_layer1_4_tallsprite_00_width = $03 120 28000 ???? 00 00 heofonfir_lucelia_layer1_4_mode = $00 121 28000 ???? 00 1d heofonfir_lucelia_layer1_4_width_twoscompliment = $1d 122 28000 ???? 00 03 heofonfir_lucelia_layer1_4_width = $03 123 28000 ???? 00 00 heofonfir_lucelia_layer1_3_tallsprite_01_mode = $00 124 28000 ???? 00 1d heofonfir_lucelia_layer1_3_tallsprite_01_width_twoscompliment = $1d 125 28000 ???? 00 03 heofonfir_lucelia_layer1_3_tallsprite_01_width = $03 126 28000 ???? 00 00 heofonfir_lucelia_layer1_3_tallsprite_00_mode = $00 127 28000 ???? 00 1d heofonfir_lucelia_layer1_3_tallsprite_00_width_twoscompliment = $1d 128 28000 ???? 00 03 heofonfir_lucelia_layer1_3_tallsprite_00_width = $03 129 28000 ???? 00 00 heofonfir_lucelia_layer1_3_mode = $00 130 28000 ???? 00 1d heofonfir_lucelia_layer1_3_width_twoscompliment = $1d 131 28000 ???? 00 03 heofonfir_lucelia_layer1_3_width = $03 132 28000 ???? 00 00 heofonfir_lucelia_layer1_2_tallsprite_01_mode = $00 133 28000 ???? 00 1d heofonfir_lucelia_layer1_2_tallsprite_01_width_twoscompliment = $1d 134 28000 ???? 00 03 heofonfir_lucelia_layer1_2_tallsprite_01_width = $03 135 28000 ???? 00 00 heofonfir_lucelia_layer1_2_tallsprite_00_mode = $00 136 28000 ???? 00 1d heofonfir_lucelia_layer1_2_tallsprite_00_width_twoscompliment = $1d 137 28000 ???? 00 03 heofonfir_lucelia_layer1_2_tallsprite_00_width = $03 138 28000 ???? 00 00 heofonfir_lucelia_layer1_2_mode = $00 139 28000 ???? 00 1d heofonfir_lucelia_layer1_2_width_twoscompliment = $1d 140 28000 ???? 00 03 heofonfir_lucelia_layer1_2_width = $03 141 28000 ???? 00 00 heofonfir_lucelia_layer1_1_tallsprite_01_mode = $00 142 28000 ???? 00 1d heofonfir_lucelia_layer1_1_tallsprite_01_width_twoscompliment = $1d 143 28000 ???? 00 03 heofonfir_lucelia_layer1_1_tallsprite_01_width = $03 144 28000 ???? 00 00 heofonfir_lucelia_layer1_1_tallsprite_00_mode = $00 145 28000 ???? 00 1d heofonfir_lucelia_layer1_1_tallsprite_00_width_twoscompliment = $1d 146 28000 ???? 00 03 heofonfir_lucelia_layer1_1_tallsprite_00_width = $03 147 28000 ???? 00 00 heofonfir_lucelia_layer1_1_mode = $00 148 28000 ???? 00 1d heofonfir_lucelia_layer1_1_width_twoscompliment = $1d 149 28000 ???? 00 03 heofonfir_lucelia_layer1_1_width = $03 150 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_8_tallsprite_01_color3 = $26 151 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_8_tallsprite_01_color2 = $04 152 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_8_tallsprite_01_color1 = $3c 153 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_01_color0 = $00 154 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_8_tallsprite_00_color3 = $26 155 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_8_tallsprite_00_color2 = $04 156 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_8_tallsprite_00_color1 = $3c 157 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_00_color0 = $00 158 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_8_color3 = $26 159 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_8_color2 = $04 160 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_8_color1 = $3c 161 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_color0 = $00 162 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_7_tallsprite_01_color3 = $26 163 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_7_tallsprite_01_color2 = $04 164 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_7_tallsprite_01_color1 = $3c 165 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_tallsprite_01_color0 = $00 166 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_7_tallsprite_00_color3 = $26 167 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_7_tallsprite_00_color2 = $04 168 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_7_tallsprite_00_color1 = $3c 169 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_tallsprite_00_color0 = $00 170 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_7_color3 = $26 171 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_7_color2 = $04 172 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_7_color1 = $3c 173 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_color0 = $00 174 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_6_tallsprite_01_color3 = $26 175 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_6_tallsprite_01_color2 = $04 176 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_6_tallsprite_01_color1 = $3c 177 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_tallsprite_01_color0 = $00 178 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_6_tallsprite_00_color3 = $26 179 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_6_tallsprite_00_color2 = $04 180 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_6_tallsprite_00_color1 = $3c 181 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_tallsprite_00_color0 = $00 182 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_6_color3 = $26 183 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_6_color2 = $04 184 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_6_color1 = $3c 185 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_color0 = $00 186 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_5_tallsprite_01_color3 = $26 187 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_5_tallsprite_01_color2 = $04 188 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_5_tallsprite_01_color1 = $3c 189 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_tallsprite_01_color0 = $00 190 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_5_tallsprite_00_color3 = $26 191 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_5_tallsprite_00_color2 = $04 192 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_5_tallsprite_00_color1 = $3c 193 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_tallsprite_00_color0 = $00 194 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_5_color3 = $26 195 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_5_color2 = $04 196 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_5_color1 = $3c 197 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_color0 = $00 198 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_4_tallsprite_01_color3 = $26 199 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_4_tallsprite_01_color2 = $04 200 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_4_tallsprite_01_color1 = $3c 201 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_tallsprite_01_color0 = $00 202 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_4_tallsprite_00_color3 = $26 203 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_4_tallsprite_00_color2 = $04 204 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_4_tallsprite_00_color1 = $3c 205 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_tallsprite_00_color0 = $00 206 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_4_color3 = $26 207 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_4_color2 = $04 208 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_4_color1 = $3c 209 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_color0 = $00 210 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_3_tallsprite_01_color3 = $26 211 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_3_tallsprite_01_color2 = $04 212 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_3_tallsprite_01_color1 = $3c 213 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_tallsprite_01_color0 = $00 214 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_3_tallsprite_00_color3 = $26 215 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_3_tallsprite_00_color2 = $04 216 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_3_tallsprite_00_color1 = $3c 217 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_tallsprite_00_color0 = $00 218 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_3_color3 = $26 219 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_3_color2 = $04 220 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_3_color1 = $3c 221 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_color0 = $00 222 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_2_tallsprite_01_color3 = $26 223 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_2_tallsprite_01_color2 = $04 224 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_2_tallsprite_01_color1 = $3c 225 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_tallsprite_01_color0 = $00 226 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_2_tallsprite_00_color3 = $26 227 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_2_tallsprite_00_color2 = $04 228 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_2_tallsprite_00_color1 = $3c 229 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_tallsprite_00_color0 = $00 230 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_2_color3 = $26 231 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_2_color2 = $04 232 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_2_color1 = $3c 233 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_color0 = $00 234 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_1_tallsprite_01_color3 = $26 235 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_1_tallsprite_01_color2 = $04 236 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_1_tallsprite_01_color1 = $3c 237 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_tallsprite_01_color0 = $00 238 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_1_tallsprite_00_color3 = $26 239 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_1_tallsprite_00_color2 = $04 240 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_1_tallsprite_00_color1 = $3c 241 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_tallsprite_00_color0 = $00 242 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_1_color3 = $26 243 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_1_color2 = $04 244 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_1_color1 = $3c 245 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_color0 = $00 246 28000 ???? 00 28 heofonfir_lucelia_layer1_8_tallsprite_01_color3 = $28 247 28000 ???? 00 2c heofonfir_lucelia_layer1_8_tallsprite_01_color2 = $2c 248 28000 ???? 00 0f heofonfir_lucelia_layer1_8_tallsprite_01_color1 = $0f 249 28000 ???? 00 00 heofonfir_lucelia_layer1_8_tallsprite_01_color0 = $00 250 28000 ???? 00 28 heofonfir_lucelia_layer1_8_tallsprite_00_color3 = $28 251 28000 ???? 00 2c heofonfir_lucelia_layer1_8_tallsprite_00_color2 = $2c 252 28000 ???? 00 0f heofonfir_lucelia_layer1_8_tallsprite_00_color1 = $0f 253 28000 ???? 00 00 heofonfir_lucelia_layer1_8_tallsprite_00_color0 = $00 254 28000 ???? 00 28 heofonfir_lucelia_layer1_8_color3 = $28 255 28000 ???? 00 2c heofonfir_lucelia_layer1_8_color2 = $2c 256 28000 ???? 00 0f heofonfir_lucelia_layer1_8_color1 = $0f 257 28000 ???? 00 00 heofonfir_lucelia_layer1_8_color0 = $00 258 28000 ???? 00 28 heofonfir_lucelia_layer1_7_tallsprite_01_color3 = $28 259 28000 ???? 00 2c heofonfir_lucelia_layer1_7_tallsprite_01_color2 = $2c 260 28000 ???? 00 0f heofonfir_lucelia_layer1_7_tallsprite_01_color1 = $0f 261 28000 ???? 00 00 heofonfir_lucelia_layer1_7_tallsprite_01_color0 = $00 262 28000 ???? 00 28 heofonfir_lucelia_layer1_7_tallsprite_00_color3 = $28 263 28000 ???? 00 2c heofonfir_lucelia_layer1_7_tallsprite_00_color2 = $2c 264 28000 ???? 00 0f heofonfir_lucelia_layer1_7_tallsprite_00_color1 = $0f 265 28000 ???? 00 00 heofonfir_lucelia_layer1_7_tallsprite_00_color0 = $00 266 28000 ???? 00 28 heofonfir_lucelia_layer1_7_color3 = $28 267 28000 ???? 00 2c heofonfir_lucelia_layer1_7_color2 = $2c 268 28000 ???? 00 0f heofonfir_lucelia_layer1_7_color1 = $0f 269 28000 ???? 00 00 heofonfir_lucelia_layer1_7_color0 = $00 270 28000 ???? 00 28 heofonfir_lucelia_layer1_6_tallsprite_01_color3 = $28 271 28000 ???? 00 2c heofonfir_lucelia_layer1_6_tallsprite_01_color2 = $2c 272 28000 ???? 00 0f heofonfir_lucelia_layer1_6_tallsprite_01_color1 = $0f 273 28000 ???? 00 00 heofonfir_lucelia_layer1_6_tallsprite_01_color0 = $00 274 28000 ???? 00 28 heofonfir_lucelia_layer1_6_tallsprite_00_color3 = $28 275 28000 ???? 00 2c heofonfir_lucelia_layer1_6_tallsprite_00_color2 = $2c 276 28000 ???? 00 0f heofonfir_lucelia_layer1_6_tallsprite_00_color1 = $0f 277 28000 ???? 00 00 heofonfir_lucelia_layer1_6_tallsprite_00_color0 = $00 278 28000 ???? 00 28 heofonfir_lucelia_layer1_6_color3 = $28 279 28000 ???? 00 2c heofonfir_lucelia_layer1_6_color2 = $2c 280 28000 ???? 00 0f heofonfir_lucelia_layer1_6_color1 = $0f 281 28000 ???? 00 00 heofonfir_lucelia_layer1_6_color0 = $00 282 28000 ???? 00 28 heofonfir_lucelia_layer1_5_tallsprite_01_color3 = $28 283 28000 ???? 00 0f heofonfir_lucelia_layer1_5_tallsprite_01_color2 = $0f 284 28000 ???? 00 2c heofonfir_lucelia_layer1_5_tallsprite_01_color1 = $2c 285 28000 ???? 00 00 heofonfir_lucelia_layer1_5_tallsprite_01_color0 = $00 286 28000 ???? 00 28 heofonfir_lucelia_layer1_5_tallsprite_00_color3 = $28 287 28000 ???? 00 0f heofonfir_lucelia_layer1_5_tallsprite_00_color2 = $0f 288 28000 ???? 00 2c heofonfir_lucelia_layer1_5_tallsprite_00_color1 = $2c 289 28000 ???? 00 00 heofonfir_lucelia_layer1_5_tallsprite_00_color0 = $00 290 28000 ???? 00 28 heofonfir_lucelia_layer1_5_color3 = $28 291 28000 ???? 00 0f heofonfir_lucelia_layer1_5_color2 = $0f 292 28000 ???? 00 2c heofonfir_lucelia_layer1_5_color1 = $2c 293 28000 ???? 00 00 heofonfir_lucelia_layer1_5_color0 = $00 294 28000 ???? 00 28 heofonfir_lucelia_layer1_4_tallsprite_01_color3 = $28 295 28000 ???? 00 0f heofonfir_lucelia_layer1_4_tallsprite_01_color2 = $0f 296 28000 ???? 00 2c heofonfir_lucelia_layer1_4_tallsprite_01_color1 = $2c 297 28000 ???? 00 00 heofonfir_lucelia_layer1_4_tallsprite_01_color0 = $00 298 28000 ???? 00 28 heofonfir_lucelia_layer1_4_tallsprite_00_color3 = $28 299 28000 ???? 00 0f heofonfir_lucelia_layer1_4_tallsprite_00_color2 = $0f 300 28000 ???? 00 2c heofonfir_lucelia_layer1_4_tallsprite_00_color1 = $2c 301 28000 ???? 00 00 heofonfir_lucelia_layer1_4_tallsprite_00_color0 = $00 302 28000 ???? 00 28 heofonfir_lucelia_layer1_4_color3 = $28 303 28000 ???? 00 0f heofonfir_lucelia_layer1_4_color2 = $0f 304 28000 ???? 00 2c heofonfir_lucelia_layer1_4_color1 = $2c 305 28000 ???? 00 00 heofonfir_lucelia_layer1_4_color0 = $00 306 28000 ???? 00 28 heofonfir_lucelia_layer1_3_tallsprite_01_color3 = $28 307 28000 ???? 00 0f heofonfir_lucelia_layer1_3_tallsprite_01_color2 = $0f 308 28000 ???? 00 2c heofonfir_lucelia_layer1_3_tallsprite_01_color1 = $2c 309 28000 ???? 00 00 heofonfir_lucelia_layer1_3_tallsprite_01_color0 = $00 310 28000 ???? 00 28 heofonfir_lucelia_layer1_3_tallsprite_00_color3 = $28 311 28000 ???? 00 0f heofonfir_lucelia_layer1_3_tallsprite_00_color2 = $0f 312 28000 ???? 00 2c heofonfir_lucelia_layer1_3_tallsprite_00_color1 = $2c 313 28000 ???? 00 00 heofonfir_lucelia_layer1_3_tallsprite_00_color0 = $00 314 28000 ???? 00 28 heofonfir_lucelia_layer1_3_color3 = $28 315 28000 ???? 00 0f heofonfir_lucelia_layer1_3_color2 = $0f 316 28000 ???? 00 2c heofonfir_lucelia_layer1_3_color1 = $2c 317 28000 ???? 00 00 heofonfir_lucelia_layer1_3_color0 = $00 318 28000 ???? 00 28 heofonfir_lucelia_layer1_2_tallsprite_01_color3 = $28 319 28000 ???? 00 0f heofonfir_lucelia_layer1_2_tallsprite_01_color2 = $0f 320 28000 ???? 00 2c heofonfir_lucelia_layer1_2_tallsprite_01_color1 = $2c 321 28000 ???? 00 00 heofonfir_lucelia_layer1_2_tallsprite_01_color0 = $00 322 28000 ???? 00 28 heofonfir_lucelia_layer1_2_tallsprite_00_color3 = $28 323 28000 ???? 00 0f heofonfir_lucelia_layer1_2_tallsprite_00_color2 = $0f 324 28000 ???? 00 2c heofonfir_lucelia_layer1_2_tallsprite_00_color1 = $2c 325 28000 ???? 00 00 heofonfir_lucelia_layer1_2_tallsprite_00_color0 = $00 326 28000 ???? 00 28 heofonfir_lucelia_layer1_2_color3 = $28 327 28000 ???? 00 0f heofonfir_lucelia_layer1_2_color2 = $0f 328 28000 ???? 00 2c heofonfir_lucelia_layer1_2_color1 = $2c 329 28000 ???? 00 00 heofonfir_lucelia_layer1_2_color0 = $00 330 28000 ???? 00 28 heofonfir_lucelia_layer1_1_tallsprite_01_color3 = $28 331 28000 ???? 00 2c heofonfir_lucelia_layer1_1_tallsprite_01_color2 = $2c 332 28000 ???? 00 0f heofonfir_lucelia_layer1_1_tallsprite_01_color1 = $0f 333 28000 ???? 00 00 heofonfir_lucelia_layer1_1_tallsprite_01_color0 = $00 334 28000 ???? 00 28 heofonfir_lucelia_layer1_1_tallsprite_00_color3 = $28 335 28000 ???? 00 2c heofonfir_lucelia_layer1_1_tallsprite_00_color2 = $2c 336 28000 ???? 00 0f heofonfir_lucelia_layer1_1_tallsprite_00_color1 = $0f 337 28000 ???? 00 00 heofonfir_lucelia_layer1_1_tallsprite_00_color0 = $00 338 28000 ???? 00 28 heofonfir_lucelia_layer1_1_color3 = $28 339 28000 ???? 00 2c heofonfir_lucelia_layer1_1_color2 = $2c 340 28000 ???? 00 0f heofonfir_lucelia_layer1_1_color1 = $0f 341 28000 ???? 00 00 heofonfir_lucelia_layer1_1_color0 = $00 342 28000 ???? 01 49 player_l2_AniFrame = var9 343 28000 ???? 344 28000 ???? 01 48 joyposright = var8 345 28000 ???? 346 28000 ???? 01 47 joyposleft = var7 347 28000 ???? 348 28000 ???? 01 46 joyposup = var6 349 28000 ???? 350 28000 ???? 01 45 joyposdown = var5 351 28000 ???? 352 28000 ???? 01 44 player_l1_AniFrame = var4 353 28000 ???? 354 28000 ???? 01 43 fire_debounce = var3 355 28000 ???? 356 28000 ???? 01 42 playerY = var2 357 28000 ???? 358 28000 ???? 01 41 playerX = var1 359 28000 ???? 360 28000 ???? 01 40 frameCounter = var0 361 28000 ???? 362 28000 ???? 00 01 EXTRADLMEMORY = 1 363 28000 ???? 00 01 NTSC = 1 364 28000 ???? 00 01 CHECKOVERWRITE = 1 365 28000 ???? 00 08 ZONEHEIGHT = 8 366 28000 ???? 00 01 SGRAM = 1 367 28000 ???? 00 08 bankswitchmode = 8 368 28000 ???? 00 01 ROM128K = 1 ------- FILE 7800basic.h 6 28000 ???? 7 28000 ???? ;************ 7800 overall RAM map ************** 8 28000 ???? 9 28000 ???? ; 40-FF zero page RAM 10 28000 ???? ; 140-1FF RAM (stack) 11 28000 ???? ; 1800-203F RAM 12 28000 ???? ; 2100-213F RAM 13 28000 ???? ; 2200-27FF RAM 14 28000 ???? 15 28000 ???? ;************ 7800basic RAM usage map ************** 16 28000 ???? 17 28000 ???? ; 40-FF numerous defines, listed below 18 28000 ???? ; 140-1FF RAM (stack) 19 28000 ???? 20 28000 ???? ; 1800-187F DLL (1800-18DF with page flipping enabled) 21 28000 ???? ; 1880-1FFF DLs (18E0-1FFF with page flipping enabled) 22 28000 ???? 23 28000 ???? ; 2000-203F Reserved 24 28000 ???? ; 2100-213F Reserved 25 28000 ???? ; 2200-27FF Free 26 28000 ???? 27 28000 ???? 1f e0 eeprombuffer = $1FE0 28 28000 ???? 18 00 DLLMEM = $1800 29 28000 ???? 00 70 DBOFFSET = $70 ; $E0 length DL is /2 for double-buffering 30 28000 ???? 31 28000 ???? - ifconst PLOTVALUEPAGE 32 28000 ???? -VALBUFFER = (PLOTVALUEPAGE*256) 33 28000 ???? else 34 28000 ???? 20 00 VALBUFFER = $2000 ; to $203F ** never let VALBUFFER straddle pages 35 28000 ???? endif 36 28000 ???? 37 28000 ???? 38 28000 ???? 21 00 pausestate = $2100 39 28000 ???? 21 01 dlzero = $2101 ; zero to force end of $2100 DL, which we use in vblank and overscan 40 28000 ???? 21 02 sINPT1 = $2102 ; save register for joy button joy0 41 28000 ???? 21 03 sINPT3 = $2103 ; save register for joy button joy1 42 28000 ???? 21 04 currentbank = $2104 43 28000 ???? 44 28000 ???? 21 05 currentrambank = $2105 45 28000 ???? 21 06 charactermode = $2106 46 28000 ???? 21 07 sCTRL = $2107 47 28000 ???? 21 08 pokeydetected = $2108 48 28000 ???? 21 09 paldetected = $2109 49 28000 ???? 21 0a avoxdetected = $210A 50 28000 ???? 21 0b sCHARBASE = $210B ; save register for CHARBASE 51 28000 ???? 52 28000 ???? 21 0c hsdevice = $210C 53 28000 ???? 21 0d hsdifficulty = $210D 54 28000 ???? 21 0e hserror = $210E 55 28000 ???? 21 0f hsgameslot = $210F 56 28000 ???? 21 10 hsnewscoreline = $2110 57 28000 ???? 21 11 hsnewscorerank = $2111 58 28000 ???? 21 12 HSRAMTable = $2112 ; to $212F (30 bytes) Format: III*5, SSS*5 59 28000 ???? 21 12 HSRAMInitials = $2112 ; see above 60 28000 ???? 21 21 HSRAMScores = $2121 ; see above 61 28000 ???? 62 28000 ???? 21 31 ssCTRL = $2131 63 28000 ???? 21 32 ssCHARBASE = $2132 64 28000 ???? 21 33 hsdisplaymode = $2133 65 28000 ???? 21 34 gamedifficulty = $2134 66 28000 ???? 21 35 hsinitialpos = $2135 67 28000 ???? 21 36 hsinitialhold = $2136 68 28000 ???? 21 37 hscursorx = $2137 69 28000 ???? 21 38 hsjoydebounce = $2138 70 28000 ???? 21 39 hsswcha = $2139 71 28000 ???? 21 3a hsinpt1 = $213A 72 28000 ???? 21 3b hscolorchaseindex = $213B 73 28000 ???? 21 3c visibleDLLstart = $213C 74 28000 ???? 21 3d overscanDLLstart = $213D 75 28000 ???? 21 3e frameslost = $213E 76 28000 ???? 77 28000 ???? 78 28000 ???? 00 40 rand = $40 79 28000 ???? 00 41 rand16 = $41 80 28000 ???? 00 42 temp1 = $42 81 28000 ???? 00 43 temp2 = $43 82 28000 ???? 00 44 temp3 = $44 83 28000 ???? 00 45 temp4 = $45 84 28000 ???? 00 46 temp5 = $46 85 28000 ???? 00 47 temp6 = $47 86 28000 ???? 00 48 temp7 = $48 87 28000 ???? 00 49 temp8 = $49 88 28000 ???? 00 4a temp9 = $4a 89 28000 ???? 90 28000 ???? 00 4b pokeybase = $4b 91 28000 ???? 00 4b pokeybaselo = $4b 92 28000 ???? 00 4c pokeybasehi = $4c 93 28000 ???? 94 28000 ???? 00 4d visibleover = $4d 95 28000 ???? 96 28000 ???? 00 4e sfx1pointlo = $4e 97 28000 ???? 00 4f sfx2pointlo = $4f 98 28000 ???? 00 50 sfx1pointhi = $50 99 28000 ???? 00 51 sfx2pointhi = $51 100 28000 ???? 101 28000 ???? 00 52 sfx1priority = $52 102 28000 ???? 00 53 sfx2priority = $53 103 28000 ???? 00 54 sfx1poffset = $54 104 28000 ???? 00 55 sfx2poffset = $55 105 28000 ???? 106 28000 ???? 00 56 sfx1frames = $56 107 28000 ???? 00 57 sfx2frames = $57 108 28000 ???? 00 58 sfx1tick = $58 109 28000 ???? 00 59 sfx2tick = $59 110 28000 ???? 111 28000 ???? 00 5a tempmath = $5a 112 28000 ???? 113 28000 ???? 00 5b pokey1pointlo = $5b 114 28000 ???? 00 5c pokey1pointhi = $5c 115 28000 ???? 00 5d pokey2pointlo = $5d 116 28000 ???? 00 5e pokey2pointhi = $5e 117 28000 ???? 00 5f pokey3pointlo = $5f 118 28000 ???? 00 60 pokey3pointhi = $60 119 28000 ???? 00 61 pokey4pointlo = $61 120 28000 ???? 00 62 pokey4pointhi = $62 121 28000 ???? 122 28000 ???? 00 63 dlpnt = $63 ; to $64 123 28000 ???? 00 65 dlend = $65 ; to $81 - for 28 possible visible dll entries 124 28000 ???? 00 82 dlendsave = $82 ; to $9e - for 28 possible visible dll entries 125 28000 ???? 126 28000 ???? 00 9f speech_addr = $9f 127 28000 ???? 00 a0 speech_addr_hi = $a0 128 28000 ???? 129 28000 ???? 00 a1 HSGameTableLo = $a1 130 28000 ???? 00 a2 HSGameTableHi = $a2 131 28000 ???? 00 a3 HSVoxHi = $a3 132 28000 ???? 00 a4 HSVoxLo = $a4 133 28000 ???? 134 28000 ???? ;channel pointers 135 28000 ???? 136 28000 ???? 00 a5 songchannel1layer1lo = $a5 137 28000 ???? 00 a6 songchannel2layer1lo = $a6 138 28000 ???? 00 a7 songchannel3layer1lo = $a7 139 28000 ???? 00 a8 songchannel4layer1lo = $a8 140 28000 ???? 141 28000 ???? 00 a9 songchannel1layer2lo = $a9 142 28000 ???? 00 aa songchannel2layer2lo = $aA 143 28000 ???? 00 ab songchannel3layer2lo = $aB 144 28000 ???? 00 ac songchannel4layer2lo = $aC 145 28000 ???? 146 28000 ???? 00 ad songchannel1layer3lo = $aD 147 28000 ???? 00 ae songchannel2layer3lo = $aE 148 28000 ???? 00 af songchannel3layer3lo = $aF 149 28000 ???? 00 b0 songchannel4layer3lo = $b0 150 28000 ???? 151 28000 ???? 00 b1 songchannel1layer1hi = $b1 152 28000 ???? 00 b2 songchannel2layer1hi = $b2 153 28000 ???? 00 b3 songchannel3layer1hi = $b3 154 28000 ???? 00 b4 songchannel4layer1hi = $b4 155 28000 ???? 156 28000 ???? 00 b5 songchannel1layer2hi = $b5 157 28000 ???? 00 b6 songchannel2layer2hi = $b6 158 28000 ???? 00 b7 songchannel3layer2hi = $b7 159 28000 ???? 00 b8 songchannel4layer2hi = $b8 160 28000 ???? 161 28000 ???? 00 b9 songchannel1layer3hi = $b9 162 28000 ???? 00 ba songchannel2layer3hi = $bA 163 28000 ???? 00 bb songchannel3layer3hi = $bB 164 28000 ???? 00 bc songchannel4layer3hi = $bC 165 28000 ???? 166 28000 ???? 00 bd songdatalo = $bd 167 28000 ???? 00 be songdatahi = $be 168 28000 ???? 169 28000 ???? 00 bf inactivechannelcount = $bf 170 28000 ???? 171 28000 ???? 172 28000 ???? 00 c0 songchannel1transpose = $c0 173 28000 ???? 00 c1 songchannel2transpose = $c1 174 28000 ???? 00 c2 songchannel3transpose = $c2 175 28000 ???? 00 c3 songchannel4transpose = $c3 176 28000 ???? 177 28000 ???? 00 c4 songstackindex = $c4 178 28000 ???? 179 28000 ???? 00 c5 songchannel1instrumentlo = $c5 180 28000 ???? 00 c6 songchannel2instrumentlo = $c6 181 28000 ???? 00 c7 songchannel3instrumentlo = $c7 182 28000 ???? 00 c8 songchannel4instrumentlo = $c8 183 28000 ???? 184 28000 ???? 00 c9 songchannel1instrumenthi = $c9 185 28000 ???? 00 ca songchannel2instrumenthi = $ca 186 28000 ???? 00 cb songchannel3instrumenthi = $cb 187 28000 ???? 00 cc songchannel4instrumenthi = $cc 188 28000 ???? 189 28000 ???? 00 cd sfx1notedata = $cd 190 28000 ???? 00 ce sfx2notedata = $ce 191 28000 ???? 192 28000 ???? 00 cf songloops = $cf 193 28000 ???? 194 28000 ???? 00 d0 songpointerlo = $D0 195 28000 ???? 00 d1 songpointerhi = $D1 196 28000 ???? 197 28000 ???? 00 d2 voxlock = $D2 198 28000 ???? 00 d3 voxqueuesize = $D3 199 28000 ???? 200 28000 ???? 00 d4 vblankroutines = $D4 201 28000 ???? 202 28000 ???? 00 d5 doublebufferstate = $D5 203 28000 ???? 00 d6 doublebufferdloffset = $D6 204 28000 ???? 00 d7 doublebufferbufferdirty = $D7 205 28000 ???? 206 28000 ???? 00 d8 inttemp1 = $D8 207 28000 ???? 00 d9 inttemp2 = $D9 208 28000 ???? 00 da inttemp3 = $DA 209 28000 ???? 00 db inttemp4 = $DB 210 28000 ???? 00 dc inttemp5 = $DC 211 28000 ???? 00 dd inttemp6 = $DD 212 28000 ???? 213 28000 ???? 00 de sfxschedulelock = $DE 214 28000 ???? 00 df sfxschedulemissed = $DF 215 28000 ???? 00 e0 sfxinstrumentlo = $E0 216 28000 ???? 00 e1 sfxinstrumenthi = $E1 217 28000 ???? 00 e2 sfxpitchoffset = $E2 218 28000 ???? 00 e3 sfxnoteindex = $E3 219 28000 ???? 220 28000 ???? 00 e4 CTLSWAs = $E4 221 28000 ???? 00 e5 CTLSWBs = $E5 222 28000 ???? 223 28000 ???? 00 e6 A = $e6 224 28000 ???? 00 e6 a = $e6 225 28000 ???? 00 e7 B = $e7 226 28000 ???? 00 e7 b = $e7 227 28000 ???? 00 e8 C = $e8 228 28000 ???? 00 e8 c = $e8 229 28000 ???? 00 e9 D = $e9 230 28000 ???? 00 e9 d = $e9 231 28000 ???? 00 ea E = $ea 232 28000 ???? 00 ea e = $ea 233 28000 ???? 00 eb F = $eb 234 28000 ???? 00 eb f = $eb 235 28000 ???? 00 ec G = $ec 236 28000 ???? 00 ec g = $ec 237 28000 ???? 00 ed H = $ed 238 28000 ???? 00 ed h = $ed 239 28000 ???? 00 ee I = $ee 240 28000 ???? 00 ee i = $ee 241 28000 ???? 00 ef J = $ef 242 28000 ???? 00 ef j = $ef 243 28000 ???? 00 f0 K = $f0 244 28000 ???? 00 f0 k = $f0 245 28000 ???? 00 f1 L = $f1 246 28000 ???? 00 f1 l = $f1 247 28000 ???? 00 f2 M = $f2 248 28000 ???? 00 f2 m = $f2 249 28000 ???? 00 f3 N = $f3 250 28000 ???? 00 f3 n = $f3 251 28000 ???? 00 f4 O = $f4 252 28000 ???? 00 f4 o = $f4 253 28000 ???? 00 f5 P = $f5 254 28000 ???? 00 f5 p = $f5 255 28000 ???? 00 f6 Q = $f6 256 28000 ???? 00 f6 q = $f6 257 28000 ???? 00 f7 R = $f7 258 28000 ???? 00 f7 r = $f7 259 28000 ???? 00 f8 S = $f8 260 28000 ???? 00 f8 s = $f8 261 28000 ???? 00 f9 T = $f9 262 28000 ???? 00 f9 t = $f9 263 28000 ???? 00 fa U = $fa 264 28000 ???? 00 fa u = $fa 265 28000 ???? 00 fb V = $fb 266 28000 ???? 00 fb v = $fb 267 28000 ???? 00 fc W = $fc 268 28000 ???? 00 fc w = $fc 269 28000 ???? 00 fd X = $fd 270 28000 ???? 00 fd x = $fd 271 28000 ???? 00 fe Y = $fe 272 28000 ???? 00 fe y = $fe 273 28000 ???? 00 ff Z = $ff 274 28000 ???? 00 ff z = $ff 275 28000 ???? 276 28000 ???? ; var0-var99 variables use the top of the stack 277 28000 ???? 01 40 var0 = $140 278 28000 ???? 01 41 var1 = $141 279 28000 ???? 01 42 var2 = $142 280 28000 ???? 01 43 var3 = $143 281 28000 ???? 01 44 var4 = $144 282 28000 ???? 01 45 var5 = $145 283 28000 ???? 01 46 var6 = $146 284 28000 ???? 01 47 var7 = $147 285 28000 ???? 01 48 var8 = $148 286 28000 ???? 01 49 var9 = $149 287 28000 ???? 01 4a var10 = $14a 288 28000 ???? 01 4b var11 = $14b 289 28000 ???? 01 4c var12 = $14c 290 28000 ???? 01 4d var13 = $14d 291 28000 ???? 01 4e var14 = $14e 292 28000 ???? 01 4f var15 = $14f 293 28000 ???? 01 50 var16 = $150 294 28000 ???? 01 51 var17 = $151 295 28000 ???? 01 52 var18 = $152 296 28000 ???? 01 53 var19 = $153 297 28000 ???? 01 54 var20 = $154 298 28000 ???? 01 55 var21 = $155 299 28000 ???? 01 56 var22 = $156 300 28000 ???? 01 57 var23 = $157 301 28000 ???? 01 58 var24 = $158 302 28000 ???? 01 59 var25 = $159 303 28000 ???? 01 5a var26 = $15a 304 28000 ???? 01 5b var27 = $15b 305 28000 ???? 01 5c var28 = $15c 306 28000 ???? 01 5d var29 = $15d 307 28000 ???? 01 5e var30 = $15e 308 28000 ???? 01 5f var31 = $15f 309 28000 ???? 01 60 var32 = $160 310 28000 ???? 01 61 var33 = $161 311 28000 ???? 01 62 var34 = $162 312 28000 ???? 01 63 var35 = $163 313 28000 ???? 01 64 var36 = $164 314 28000 ???? 01 65 var37 = $165 315 28000 ???? 01 66 var38 = $166 316 28000 ???? 01 67 var39 = $167 317 28000 ???? 01 68 var40 = $168 318 28000 ???? 01 69 var41 = $169 319 28000 ???? 01 6a var42 = $16a 320 28000 ???? 01 6b var43 = $16b 321 28000 ???? 01 6c var44 = $16c 322 28000 ???? 01 6d var45 = $16d 323 28000 ???? 01 6e var46 = $16e 324 28000 ???? 01 6f var47 = $16f 325 28000 ???? 01 70 var48 = $170 326 28000 ???? 01 71 var49 = $171 327 28000 ???? 01 72 var50 = $172 328 28000 ???? 01 73 var51 = $173 329 28000 ???? 01 74 var52 = $174 330 28000 ???? 01 75 var53 = $175 331 28000 ???? 01 76 var54 = $176 332 28000 ???? 01 77 var55 = $177 333 28000 ???? 01 78 var56 = $178 334 28000 ???? 01 79 var57 = $179 335 28000 ???? 01 7a var58 = $17a 336 28000 ???? 01 7b var59 = $17b 337 28000 ???? 01 7c var60 = $17c 338 28000 ???? 01 7d var61 = $17d 339 28000 ???? 01 7e var62 = $17e 340 28000 ???? 01 7f var63 = $17f 341 28000 ???? 01 80 var64 = $180 342 28000 ???? 01 81 var65 = $181 343 28000 ???? 01 82 var66 = $182 344 28000 ???? 01 83 var67 = $183 345 28000 ???? 01 84 var68 = $184 346 28000 ???? 01 85 var69 = $185 347 28000 ???? 01 86 var70 = $186 348 28000 ???? 01 87 var71 = $187 349 28000 ???? 01 88 var72 = $188 350 28000 ???? 01 89 var73 = $189 351 28000 ???? 01 8a var74 = $18a 352 28000 ???? 01 8b var75 = $18b 353 28000 ???? 01 8c var76 = $18c 354 28000 ???? 01 8d var77 = $18d 355 28000 ???? 01 8e var78 = $18e 356 28000 ???? 01 8f var79 = $18f 357 28000 ???? 01 90 var80 = $190 358 28000 ???? 01 91 var81 = $191 359 28000 ???? 01 92 var82 = $192 360 28000 ???? 01 93 var83 = $193 361 28000 ???? 01 94 var84 = $194 362 28000 ???? 01 95 var85 = $195 363 28000 ???? 01 96 var86 = $196 364 28000 ???? 01 97 var87 = $197 365 28000 ???? 01 98 var88 = $198 366 28000 ???? 01 99 var89 = $199 367 28000 ???? 01 9a var90 = $19a 368 28000 ???? 01 9b var91 = $19b 369 28000 ???? 01 9c var92 = $19c 370 28000 ???? 01 9d var93 = $19d 371 28000 ???? 01 9e var94 = $19e 372 28000 ???? 01 9f var95 = $19f 373 28000 ???? 01 a0 var96 = $1a0 374 28000 ???? 01 a1 var97 = $1a1 375 28000 ???? 01 a2 var98 = $1a2 376 28000 ???? 01 a3 var99 = $1a3 377 28000 ???? 378 U01c2 ???? SEG.U "7800basicRAM" 379 U01a4 ORG $1A4 380 U01a4 381 U01a4 ; MAX allocation locations are in comments... 382 U01a4 00 framecounter DS 1 ; $1A4 383 U01a5 00 countdownseconds DS 1 ; $1A5 384 U01a6 00 00 00 score0 DS 3 ; $1A6 $1A7 $1A8 385 U01a9 00 00 00 score1 DS 3 ; $1A9 $1AA $1AB 386 U01ac 00 pausebuttonflag DS 1 ; $1AC 387 U01ad 00 valbufend DS 1 ; $1AD 388 U01ae 00 valbufendsave DS 1 ; $1AE 389 U01af 00 finescrollx DS 1 ; $1AF 390 U01b0 00 finescrolly DS 1 ; $1B0 391 U01b1 00 joybuttonmode DS 1 ; $1B1 ; track joysticks that were changed to one-button mode 392 U01b2 00 interruptindex DS 1 ; $1B2 393 U01b3 394 U01b3 - ifconst DOUBLEBUFFER 395 U01b3 -doublebufferminimumframetarget DS 1 ; $1B3 396 U01b3 -doublebufferminimumframeindex DS 1 ; $1B4 397 U01b3 endif 398 U01b3 399 U01b3 00 pausedisable DS 1 ; $1B5 400 U01b4 00 XCTRL1s DS 1 ; $1B6 401 U01b5 402 U01b5 - ifconst AVOXVOICE 403 U01b5 -avoxenable DS 1 ; $1B7 404 U01b5 -tempavox DS 1 ; $1B8 405 U01b5 endif 406 U01b5 407 U01b5 - ifconst MUSICTRACKER 408 U01b5 -songtempo DS 1 ; $1B9 409 U01b5 -songtick DS 1 ; $1BA 410 U01b5 - 411 U01b5 -songchannel1layer1loops DS 1 ; $1BB 412 U01b5 -songchannel2layer1loops DS 1 ; $1BC 413 U01b5 -songchannel3layer1loops DS 1 ; $1BD 414 U01b5 -songchannel4layer1loops DS 1 ; $1BE 415 U01b5 - 416 U01b5 -songchannel1layer2loops DS 1 ; $1BF 417 U01b5 -songchannel2layer2loops DS 1 ; $1C0 418 U01b5 -songchannel3layer2loops DS 1 ; $1C1 419 U01b5 -songchannel4layer2loops DS 1 ; $1C2 420 U01b5 - 421 U01b5 -songchannel1layer3loops DS 1 ; $1C3 422 U01b5 -songchannel2layer3loops DS 1 ; $1C4 423 U01b5 -songchannel3layer3loops DS 1 ; $1C5 424 U01b5 -songchannel4layer3loops DS 1 ; $1C6 425 U01b5 - 426 U01b5 -songchannel1busywait DS 1 ; $1C7 427 U01b5 -songchannel2busywait DS 1 ; $1C8 428 U01b5 -songchannel3busywait DS 1 ; $1C9 429 U01b5 -songchannel4busywait DS 1 ; $1CA 430 U01b5 - 431 U01b5 -songchannel1stackdepth DS 1 ; $1CB 432 U01b5 -songchannel2stackdepth DS 1 ; $1CC 433 U01b5 -songchannel3stackdepth DS 1 ; $1CD 434 U01b5 -songchannel4stackdepth DS 1 ; $1CE 435 U01b5 endif 436 U01b5 437 U01b5 00 palframes DS 1 ; $1CF 438 U01b6 00 palfastframe DS 1 ; $1D0 439 U01b7 440 U01b7 - ifconst MOUSESUPPORT 441 U01b7 -port0resolution DS 1 ; $1D1 442 U01b7 -port1resolution DS 1 ; $1D2 443 U01b7 else 444 U01b7 - ifconst TRAKBALLSUPPORT 445 U01b7 -port0resolution DS 1 ; $1D1 446 U01b7 -port1resolution DS 1 ; $1D2 447 U01b7 endif 448 U01b7 endif 449 U01b7 450 U01b7 00 port0control DS 1 ; $1D3 451 U01b8 00 port1control DS 1 ; $1D4 452 U01b9 453 U01b9 ; port#control values... 454 U01b9 ; 1 = proline 455 U01b9 ; 2 = lightgun 456 U01b9 ; 3 = paddle 457 U01b9 ; 4 = trakball 458 U01b9 ; 5 = vcs joystick 459 U01b9 ; 6 = driving 460 U01b9 ; 7 = keypad 461 U01b9 ; 8 = st mouse/cx80 462 U01b9 ; 9 = amiga mouse 463 U01b9 ; 10 = atarivox 464 U01b9 465 U01b9 ; controller 0 data... 466 U01b9 00 paddleposition0 DS 1 ; $1D5 467 U01b9 01 b9 keypadmatrix0a = paddleposition0 468 U01b9 01 b9 drivingposition0 = paddleposition0 469 U01b9 01 b9 trakballx0 = paddleposition0 470 U01b9 01 b9 mousex0 = paddleposition0 471 U01b9 01 b9 lighttgunx0 = paddleposition0 472 U01ba 473 U01ba ; controller 1 data... 474 U01ba 00 paddleposition2 DS 1 ; $1D6 475 U01ba 01 ba keypadmatrix1a = paddleposition2 476 U01ba 01 ba drivingposition1 = paddleposition2 477 U01ba 01 ba trakballx1 = paddleposition2 478 U01ba 01 ba mousex1 = paddleposition2 479 U01ba 01 ba lightgunx1 = paddleposition2 480 U01bb 481 U01bb ; controller 0 altdata... 482 U01bb 00 paddleposition1 DS 1 ; $1D7 483 U01bb 01 bb keypadmatrix0b = paddleposition1 484 U01bb 01 bb trakbally0 = paddleposition1 485 U01bb 01 bb mousey0 = paddleposition1 486 U01bb 01 bb lightguny0 = paddleposition1 487 U01bc 488 U01bc ; controller 1 altdata... 489 U01bc 00 paddleposition3 DS 1 ; $1D8 490 U01bc 01 bc keypadmatrix1b = paddleposition3 491 U01bc 01 bc trakbally1 = paddleposition3 492 U01bc 01 bc mousey1 = paddleposition3 493 U01bc 01 bc lightguny1 = paddleposition3 494 U01bd 495 U01bd ; controller state save. for trakball state+dir codes, rotary position codes 496 U01bd 00 controller0statesave DS 1 ; $1D9 497 U01bd 01 bd paddleprevious0 = controller0statesave 498 U01bd 01 bd mousecodex0 = controller0statesave 499 U01bd 01 bd trakballcodex0 = controller0statesave 500 U01bd 01 bd keypadmatrix0c = controller0statesave 501 U01be 502 U01be 00 controller1statesave DS 1 ; $1DA 503 U01be 01 be paddleprevious2 = controller1statesave 504 U01be 01 be mousecodex1 = controller1statesave 505 U01be 01 be trakballcodex1 = controller1statesave 506 U01be 01 be keypadmatrix1c = controller1statesave 507 U01bf 508 U01bf 00 paddleprevious1 DS 1 ; $1DB 509 U01bf 01 bf keypadmatrix0d = paddleprevious1 510 U01bf 01 bf mousecodey0 = paddleprevious1 511 U01bf 01 bf trakballcodey0 = paddleprevious1 512 U01c0 513 U01c0 00 paddleprevious3 DS 1 ; $1DC 514 U01c0 01 c0 keypadmatrix1d = paddleprevious3 515 U01c0 01 c0 mousecodey1 = paddleprevious3 516 U01c0 01 c0 trakballcodey1 = paddleprevious3 517 U01c1 518 U01c1 - ifconst pokeysupport 519 U01c1 -pokey1frames DS 1 ; $1DD 520 U01c1 -pokey1tick DS 1 ; $1DE 521 U01c1 -pokey2frames DS 1 ; $1DF 522 U01c1 -pokey2tick DS 1 ; $1E0 523 U01c1 -pokey3frames DS 1 ; $1E1 524 U01c1 -pokey3tick DS 1 ; $1E2 525 U01c1 -pokey4frames DS 1 ; $1E3 526 U01c1 -pokey4tick DS 1 ; $1E4 527 U01c1 -pokey1priority DS 1 ; $1E5 528 U01c1 -pokey1offset DS 1 ; $1E6 529 U01c1 -pokey2priority DS 1 ; $1E7 530 U01c1 -pokey2offset DS 1 ; $1E8 531 U01c1 -pokey3priority DS 1 ; $1E9 532 U01c1 -pokey3offset DS 1 ; $1EA 533 U01c1 -pokey4priority DS 1 ; $1EB 534 U01c1 -pokey4offset DS 1 ; $1EC 535 U01c1 endif 536 U01c1 537 U01c1 ; see if we need an interrupthold byte... 538 U01c1 INTERRUPTNEEDED SET 0 539 U01c1 - ifconst .topscreenroutine 540 U01c1 -INTERRUPTNEEDED SET 1 541 U01c1 endif 542 U01c1 - ifconst .bottomscreenroutine 543 U01c1 -INTERRUPTNEEDED SET 1 544 U01c1 endif 545 U01c1 - ifconst .userinterrupt 546 U01c1 -INTERRUPTNEEDED SET 1 547 U01c1 endif 548 U01c1 - if INTERRUPTNEEDED = 1 549 U01c1 -interrupthold DS 1 ; $1ED 550 U01c1 endif 551 U01c1 552 U01c1 ifnconst CANARYOFF 553 U01c1 00 canary DS 1 ; $1EF 554 U01c2 endif 555 U01c2 556 U01c2 557 U01c2 - ifnconst bankswitchmode 558 U01c2 - echo " stack allowance:",[($1FF - .)/2]d,"nested subroutines." 559 U01c2 else stack allowance: 20 nested subroutines. 560 U01c2 echo " stack allowance:",[($1FF - .)/3]d,"nested subroutines." 561 U01c2 endif 562 U01c2 ifnconst CANARYOFF the canary is situated at: $1c1 563 U01c2 echo " the canary is situated at:",[canary] 564 U01c2 - else 565 U01c2 - echo " the canary is disabled." 566 U01c2 endif 567 U01c2 568 U01c2 ; $1EE - $1FF reserved for stack 569 U01c2 570 28000 ???? SEG "GAME" 571 28000 ???? ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Lucelia_Movement_demo.bas.asm ------- FILE 7800basic_variable_redefs.h LEVEL 2 PASS 3 0 28000 ???? include "7800basic_variable_redefs.h" 1 28000 ???? ; This file contains variable mapping and other information for the current project. 2 28000 ???? 3 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_02_mode = $00 4 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_02_width_twoscompliment = $00 5 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_02_width = $00 6 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_01_mode = $00 7 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_8_tallsprite_01_width_twoscompliment = $1d 8 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_8_tallsprite_01_width = $03 9 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_00_mode = $00 10 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_8_tallsprite_00_width_twoscompliment = $1d 11 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_8_tallsprite_00_width = $03 12 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_mode = $00 13 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_8_width_twoscompliment = $1d 14 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_8_width = $03 15 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_tallsprite_01_mode = $00 16 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_7_tallsprite_01_width_twoscompliment = $1d 17 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_7_tallsprite_01_width = $03 18 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_tallsprite_00_mode = $00 19 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_7_tallsprite_00_width_twoscompliment = $1d 20 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_7_tallsprite_00_width = $03 21 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_mode = $00 22 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_7_width_twoscompliment = $1d 23 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_7_width = $03 24 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_tallsprite_01_mode = $00 25 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_6_tallsprite_01_width_twoscompliment = $1d 26 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_6_tallsprite_01_width = $03 27 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_tallsprite_00_mode = $00 28 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_6_tallsprite_00_width_twoscompliment = $1d 29 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_6_tallsprite_00_width = $03 30 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_mode = $00 31 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_6_width_twoscompliment = $1d 32 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_6_width = $03 33 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_tallsprite_01_mode = $00 34 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_5_tallsprite_01_width_twoscompliment = $1d 35 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_5_tallsprite_01_width = $03 36 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_tallsprite_00_mode = $00 37 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_5_tallsprite_00_width_twoscompliment = $1d 38 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_5_tallsprite_00_width = $03 39 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_mode = $00 40 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_5_width_twoscompliment = $1d 41 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_5_width = $03 42 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_tallsprite_01_mode = $00 43 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_4_tallsprite_01_width_twoscompliment = $1d 44 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_4_tallsprite_01_width = $03 45 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_tallsprite_00_mode = $00 46 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_4_tallsprite_00_width_twoscompliment = $1d 47 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_4_tallsprite_00_width = $03 48 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_mode = $00 49 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_4_width_twoscompliment = $1d 50 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_4_width = $03 51 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_tallsprite_01_mode = $00 52 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_3_tallsprite_01_width_twoscompliment = $1d 53 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_3_tallsprite_01_width = $03 54 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_tallsprite_00_mode = $00 55 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_3_tallsprite_00_width_twoscompliment = $1d 56 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_3_tallsprite_00_width = $03 57 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_mode = $00 58 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_3_width_twoscompliment = $1d 59 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_3_width = $03 60 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_tallsprite_01_mode = $00 61 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_2_tallsprite_01_width_twoscompliment = $1d 62 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_2_tallsprite_01_width = $03 63 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_tallsprite_00_mode = $00 64 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_2_tallsprite_00_width_twoscompliment = $1d 65 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_2_tallsprite_00_width = $03 66 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_mode = $00 67 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_2_width_twoscompliment = $1d 68 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_2_width = $03 69 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_tallsprite_01_mode = $00 70 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_1_tallsprite_01_width_twoscompliment = $1d 71 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_1_tallsprite_01_width = $03 72 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_tallsprite_00_mode = $00 73 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_1_tallsprite_00_width_twoscompliment = $1d 74 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_1_tallsprite_00_width = $03 75 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_mode = $00 76 28000 ???? 00 1d heofonfir_lucelia_layer_2nofire_1_width_twoscompliment = $1d 77 28000 ???? 00 03 heofonfir_lucelia_layer_2nofire_1_width = $03 78 28000 ???? 00 00 heofonfir_lucelia_layer1_8_tallsprite_01_mode = $00 79 28000 ???? 00 1d heofonfir_lucelia_layer1_8_tallsprite_01_width_twoscompliment = $1d 80 28000 ???? 00 03 heofonfir_lucelia_layer1_8_tallsprite_01_width = $03 81 28000 ???? 00 00 heofonfir_lucelia_layer1_8_tallsprite_00_mode = $00 82 28000 ???? 00 1d heofonfir_lucelia_layer1_8_tallsprite_00_width_twoscompliment = $1d 83 28000 ???? 00 03 heofonfir_lucelia_layer1_8_tallsprite_00_width = $03 84 28000 ???? 00 00 heofonfir_lucelia_layer1_8_mode = $00 85 28000 ???? 00 1d heofonfir_lucelia_layer1_8_width_twoscompliment = $1d 86 28000 ???? 00 03 heofonfir_lucelia_layer1_8_width = $03 87 28000 ???? 00 00 heofonfir_lucelia_layer1_7_tallsprite_01_mode = $00 88 28000 ???? 00 1d heofonfir_lucelia_layer1_7_tallsprite_01_width_twoscompliment = $1d 89 28000 ???? 00 03 heofonfir_lucelia_layer1_7_tallsprite_01_width = $03 90 28000 ???? 00 00 heofonfir_lucelia_layer1_7_tallsprite_00_mode = $00 91 28000 ???? 00 1d heofonfir_lucelia_layer1_7_tallsprite_00_width_twoscompliment = $1d 92 28000 ???? 00 03 heofonfir_lucelia_layer1_7_tallsprite_00_width = $03 93 28000 ???? 00 00 heofonfir_lucelia_layer1_7_mode = $00 94 28000 ???? 00 1d heofonfir_lucelia_layer1_7_width_twoscompliment = $1d 95 28000 ???? 00 03 heofonfir_lucelia_layer1_7_width = $03 96 28000 ???? 00 00 heofonfir_lucelia_layer1_6_tallsprite_01_mode = $00 97 28000 ???? 00 1d heofonfir_lucelia_layer1_6_tallsprite_01_width_twoscompliment = $1d 98 28000 ???? 00 03 heofonfir_lucelia_layer1_6_tallsprite_01_width = $03 99 28000 ???? 00 00 heofonfir_lucelia_layer1_6_tallsprite_00_mode = $00 100 28000 ???? 00 1d heofonfir_lucelia_layer1_6_tallsprite_00_width_twoscompliment = $1d 101 28000 ???? 00 03 heofonfir_lucelia_layer1_6_tallsprite_00_width = $03 102 28000 ???? 00 00 heofonfir_lucelia_layer1_6_mode = $00 103 28000 ???? 00 1d heofonfir_lucelia_layer1_6_width_twoscompliment = $1d 104 28000 ???? 00 03 heofonfir_lucelia_layer1_6_width = $03 105 28000 ???? 00 00 heofonfir_lucelia_layer1_5_tallsprite_01_mode = $00 106 28000 ???? 00 1d heofonfir_lucelia_layer1_5_tallsprite_01_width_twoscompliment = $1d 107 28000 ???? 00 03 heofonfir_lucelia_layer1_5_tallsprite_01_width = $03 108 28000 ???? 00 00 heofonfir_lucelia_layer1_5_tallsprite_00_mode = $00 109 28000 ???? 00 1d heofonfir_lucelia_layer1_5_tallsprite_00_width_twoscompliment = $1d 110 28000 ???? 00 03 heofonfir_lucelia_layer1_5_tallsprite_00_width = $03 111 28000 ???? 00 00 heofonfir_lucelia_layer1_5_mode = $00 112 28000 ???? 00 1d heofonfir_lucelia_layer1_5_width_twoscompliment = $1d 113 28000 ???? 00 03 heofonfir_lucelia_layer1_5_width = $03 114 28000 ???? 00 00 heofonfir_lucelia_layer1_4_tallsprite_01_mode = $00 115 28000 ???? 00 1d heofonfir_lucelia_layer1_4_tallsprite_01_width_twoscompliment = $1d 116 28000 ???? 00 03 heofonfir_lucelia_layer1_4_tallsprite_01_width = $03 117 28000 ???? 00 00 heofonfir_lucelia_layer1_4_tallsprite_00_mode = $00 118 28000 ???? 00 1d heofonfir_lucelia_layer1_4_tallsprite_00_width_twoscompliment = $1d 119 28000 ???? 00 03 heofonfir_lucelia_layer1_4_tallsprite_00_width = $03 120 28000 ???? 00 00 heofonfir_lucelia_layer1_4_mode = $00 121 28000 ???? 00 1d heofonfir_lucelia_layer1_4_width_twoscompliment = $1d 122 28000 ???? 00 03 heofonfir_lucelia_layer1_4_width = $03 123 28000 ???? 00 00 heofonfir_lucelia_layer1_3_tallsprite_01_mode = $00 124 28000 ???? 00 1d heofonfir_lucelia_layer1_3_tallsprite_01_width_twoscompliment = $1d 125 28000 ???? 00 03 heofonfir_lucelia_layer1_3_tallsprite_01_width = $03 126 28000 ???? 00 00 heofonfir_lucelia_layer1_3_tallsprite_00_mode = $00 127 28000 ???? 00 1d heofonfir_lucelia_layer1_3_tallsprite_00_width_twoscompliment = $1d 128 28000 ???? 00 03 heofonfir_lucelia_layer1_3_tallsprite_00_width = $03 129 28000 ???? 00 00 heofonfir_lucelia_layer1_3_mode = $00 130 28000 ???? 00 1d heofonfir_lucelia_layer1_3_width_twoscompliment = $1d 131 28000 ???? 00 03 heofonfir_lucelia_layer1_3_width = $03 132 28000 ???? 00 00 heofonfir_lucelia_layer1_2_tallsprite_01_mode = $00 133 28000 ???? 00 1d heofonfir_lucelia_layer1_2_tallsprite_01_width_twoscompliment = $1d 134 28000 ???? 00 03 heofonfir_lucelia_layer1_2_tallsprite_01_width = $03 135 28000 ???? 00 00 heofonfir_lucelia_layer1_2_tallsprite_00_mode = $00 136 28000 ???? 00 1d heofonfir_lucelia_layer1_2_tallsprite_00_width_twoscompliment = $1d 137 28000 ???? 00 03 heofonfir_lucelia_layer1_2_tallsprite_00_width = $03 138 28000 ???? 00 00 heofonfir_lucelia_layer1_2_mode = $00 139 28000 ???? 00 1d heofonfir_lucelia_layer1_2_width_twoscompliment = $1d 140 28000 ???? 00 03 heofonfir_lucelia_layer1_2_width = $03 141 28000 ???? 00 00 heofonfir_lucelia_layer1_1_tallsprite_01_mode = $00 142 28000 ???? 00 1d heofonfir_lucelia_layer1_1_tallsprite_01_width_twoscompliment = $1d 143 28000 ???? 00 03 heofonfir_lucelia_layer1_1_tallsprite_01_width = $03 144 28000 ???? 00 00 heofonfir_lucelia_layer1_1_tallsprite_00_mode = $00 145 28000 ???? 00 1d heofonfir_lucelia_layer1_1_tallsprite_00_width_twoscompliment = $1d 146 28000 ???? 00 03 heofonfir_lucelia_layer1_1_tallsprite_00_width = $03 147 28000 ???? 00 00 heofonfir_lucelia_layer1_1_mode = $00 148 28000 ???? 00 1d heofonfir_lucelia_layer1_1_width_twoscompliment = $1d 149 28000 ???? 00 03 heofonfir_lucelia_layer1_1_width = $03 150 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_8_tallsprite_01_color3 = $26 151 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_8_tallsprite_01_color2 = $04 152 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_8_tallsprite_01_color1 = $3c 153 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_01_color0 = $00 154 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_8_tallsprite_00_color3 = $26 155 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_8_tallsprite_00_color2 = $04 156 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_8_tallsprite_00_color1 = $3c 157 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_tallsprite_00_color0 = $00 158 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_8_color3 = $26 159 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_8_color2 = $04 160 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_8_color1 = $3c 161 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_8_color0 = $00 162 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_7_tallsprite_01_color3 = $26 163 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_7_tallsprite_01_color2 = $04 164 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_7_tallsprite_01_color1 = $3c 165 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_tallsprite_01_color0 = $00 166 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_7_tallsprite_00_color3 = $26 167 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_7_tallsprite_00_color2 = $04 168 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_7_tallsprite_00_color1 = $3c 169 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_tallsprite_00_color0 = $00 170 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_7_color3 = $26 171 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_7_color2 = $04 172 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_7_color1 = $3c 173 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_7_color0 = $00 174 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_6_tallsprite_01_color3 = $26 175 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_6_tallsprite_01_color2 = $04 176 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_6_tallsprite_01_color1 = $3c 177 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_tallsprite_01_color0 = $00 178 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_6_tallsprite_00_color3 = $26 179 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_6_tallsprite_00_color2 = $04 180 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_6_tallsprite_00_color1 = $3c 181 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_tallsprite_00_color0 = $00 182 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_6_color3 = $26 183 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_6_color2 = $04 184 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_6_color1 = $3c 185 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_6_color0 = $00 186 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_5_tallsprite_01_color3 = $26 187 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_5_tallsprite_01_color2 = $04 188 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_5_tallsprite_01_color1 = $3c 189 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_tallsprite_01_color0 = $00 190 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_5_tallsprite_00_color3 = $26 191 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_5_tallsprite_00_color2 = $04 192 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_5_tallsprite_00_color1 = $3c 193 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_tallsprite_00_color0 = $00 194 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_5_color3 = $26 195 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_5_color2 = $04 196 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_5_color1 = $3c 197 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_5_color0 = $00 198 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_4_tallsprite_01_color3 = $26 199 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_4_tallsprite_01_color2 = $04 200 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_4_tallsprite_01_color1 = $3c 201 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_tallsprite_01_color0 = $00 202 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_4_tallsprite_00_color3 = $26 203 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_4_tallsprite_00_color2 = $04 204 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_4_tallsprite_00_color1 = $3c 205 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_tallsprite_00_color0 = $00 206 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_4_color3 = $26 207 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_4_color2 = $04 208 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_4_color1 = $3c 209 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_4_color0 = $00 210 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_3_tallsprite_01_color3 = $26 211 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_3_tallsprite_01_color2 = $04 212 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_3_tallsprite_01_color1 = $3c 213 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_tallsprite_01_color0 = $00 214 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_3_tallsprite_00_color3 = $26 215 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_3_tallsprite_00_color2 = $04 216 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_3_tallsprite_00_color1 = $3c 217 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_tallsprite_00_color0 = $00 218 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_3_color3 = $26 219 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_3_color2 = $04 220 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_3_color1 = $3c 221 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_3_color0 = $00 222 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_2_tallsprite_01_color3 = $26 223 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_2_tallsprite_01_color2 = $04 224 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_2_tallsprite_01_color1 = $3c 225 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_tallsprite_01_color0 = $00 226 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_2_tallsprite_00_color3 = $26 227 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_2_tallsprite_00_color2 = $04 228 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_2_tallsprite_00_color1 = $3c 229 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_tallsprite_00_color0 = $00 230 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_2_color3 = $26 231 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_2_color2 = $04 232 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_2_color1 = $3c 233 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_2_color0 = $00 234 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_1_tallsprite_01_color3 = $26 235 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_1_tallsprite_01_color2 = $04 236 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_1_tallsprite_01_color1 = $3c 237 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_tallsprite_01_color0 = $00 238 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_1_tallsprite_00_color3 = $26 239 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_1_tallsprite_00_color2 = $04 240 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_1_tallsprite_00_color1 = $3c 241 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_tallsprite_00_color0 = $00 242 28000 ???? 00 26 heofonfir_lucelia_layer_2nofire_1_color3 = $26 243 28000 ???? 00 04 heofonfir_lucelia_layer_2nofire_1_color2 = $04 244 28000 ???? 00 3c heofonfir_lucelia_layer_2nofire_1_color1 = $3c 245 28000 ???? 00 00 heofonfir_lucelia_layer_2nofire_1_color0 = $00 246 28000 ???? 00 28 heofonfir_lucelia_layer1_8_tallsprite_01_color3 = $28 247 28000 ???? 00 2c heofonfir_lucelia_layer1_8_tallsprite_01_color2 = $2c 248 28000 ???? 00 0f heofonfir_lucelia_layer1_8_tallsprite_01_color1 = $0f 249 28000 ???? 00 00 heofonfir_lucelia_layer1_8_tallsprite_01_color0 = $00 250 28000 ???? 00 28 heofonfir_lucelia_layer1_8_tallsprite_00_color3 = $28 251 28000 ???? 00 2c heofonfir_lucelia_layer1_8_tallsprite_00_color2 = $2c 252 28000 ???? 00 0f heofonfir_lucelia_layer1_8_tallsprite_00_color1 = $0f 253 28000 ???? 00 00 heofonfir_lucelia_layer1_8_tallsprite_00_color0 = $00 254 28000 ???? 00 28 heofonfir_lucelia_layer1_8_color3 = $28 255 28000 ???? 00 2c heofonfir_lucelia_layer1_8_color2 = $2c 256 28000 ???? 00 0f heofonfir_lucelia_layer1_8_color1 = $0f 257 28000 ???? 00 00 heofonfir_lucelia_layer1_8_color0 = $00 258 28000 ???? 00 28 heofonfir_lucelia_layer1_7_tallsprite_01_color3 = $28 259 28000 ???? 00 2c heofonfir_lucelia_layer1_7_tallsprite_01_color2 = $2c 260 28000 ???? 00 0f heofonfir_lucelia_layer1_7_tallsprite_01_color1 = $0f 261 28000 ???? 00 00 heofonfir_lucelia_layer1_7_tallsprite_01_color0 = $00 262 28000 ???? 00 28 heofonfir_lucelia_layer1_7_tallsprite_00_color3 = $28 263 28000 ???? 00 2c heofonfir_lucelia_layer1_7_tallsprite_00_color2 = $2c 264 28000 ???? 00 0f heofonfir_lucelia_layer1_7_tallsprite_00_color1 = $0f 265 28000 ???? 00 00 heofonfir_lucelia_layer1_7_tallsprite_00_color0 = $00 266 28000 ???? 00 28 heofonfir_lucelia_layer1_7_color3 = $28 267 28000 ???? 00 2c heofonfir_lucelia_layer1_7_color2 = $2c 268 28000 ???? 00 0f heofonfir_lucelia_layer1_7_color1 = $0f 269 28000 ???? 00 00 heofonfir_lucelia_layer1_7_color0 = $00 270 28000 ???? 00 28 heofonfir_lucelia_layer1_6_tallsprite_01_color3 = $28 271 28000 ???? 00 2c heofonfir_lucelia_layer1_6_tallsprite_01_color2 = $2c 272 28000 ???? 00 0f heofonfir_lucelia_layer1_6_tallsprite_01_color1 = $0f 273 28000 ???? 00 00 heofonfir_lucelia_layer1_6_tallsprite_01_color0 = $00 274 28000 ???? 00 28 heofonfir_lucelia_layer1_6_tallsprite_00_color3 = $28 275 28000 ???? 00 2c heofonfir_lucelia_layer1_6_tallsprite_00_color2 = $2c 276 28000 ???? 00 0f heofonfir_lucelia_layer1_6_tallsprite_00_color1 = $0f 277 28000 ???? 00 00 heofonfir_lucelia_layer1_6_tallsprite_00_color0 = $00 278 28000 ???? 00 28 heofonfir_lucelia_layer1_6_color3 = $28 279 28000 ???? 00 2c heofonfir_lucelia_layer1_6_color2 = $2c 280 28000 ???? 00 0f heofonfir_lucelia_layer1_6_color1 = $0f 281 28000 ???? 00 00 heofonfir_lucelia_layer1_6_color0 = $00 282 28000 ???? 00 28 heofonfir_lucelia_layer1_5_tallsprite_01_color3 = $28 283 28000 ???? 00 0f heofonfir_lucelia_layer1_5_tallsprite_01_color2 = $0f 284 28000 ???? 00 2c heofonfir_lucelia_layer1_5_tallsprite_01_color1 = $2c 285 28000 ???? 00 00 heofonfir_lucelia_layer1_5_tallsprite_01_color0 = $00 286 28000 ???? 00 28 heofonfir_lucelia_layer1_5_tallsprite_00_color3 = $28 287 28000 ???? 00 0f heofonfir_lucelia_layer1_5_tallsprite_00_color2 = $0f 288 28000 ???? 00 2c heofonfir_lucelia_layer1_5_tallsprite_00_color1 = $2c 289 28000 ???? 00 00 heofonfir_lucelia_layer1_5_tallsprite_00_color0 = $00 290 28000 ???? 00 28 heofonfir_lucelia_layer1_5_color3 = $28 291 28000 ???? 00 0f heofonfir_lucelia_layer1_5_color2 = $0f 292 28000 ???? 00 2c heofonfir_lucelia_layer1_5_color1 = $2c 293 28000 ???? 00 00 heofonfir_lucelia_layer1_5_color0 = $00 294 28000 ???? 00 28 heofonfir_lucelia_layer1_4_tallsprite_01_color3 = $28 295 28000 ???? 00 0f heofonfir_lucelia_layer1_4_tallsprite_01_color2 = $0f 296 28000 ???? 00 2c heofonfir_lucelia_layer1_4_tallsprite_01_color1 = $2c 297 28000 ???? 00 00 heofonfir_lucelia_layer1_4_tallsprite_01_color0 = $00 298 28000 ???? 00 28 heofonfir_lucelia_layer1_4_tallsprite_00_color3 = $28 299 28000 ???? 00 0f heofonfir_lucelia_layer1_4_tallsprite_00_color2 = $0f 300 28000 ???? 00 2c heofonfir_lucelia_layer1_4_tallsprite_00_color1 = $2c 301 28000 ???? 00 00 heofonfir_lucelia_layer1_4_tallsprite_00_color0 = $00 302 28000 ???? 00 28 heofonfir_lucelia_layer1_4_color3 = $28 303 28000 ???? 00 0f heofonfir_lucelia_layer1_4_color2 = $0f 304 28000 ???? 00 2c heofonfir_lucelia_layer1_4_color1 = $2c 305 28000 ???? 00 00 heofonfir_lucelia_layer1_4_color0 = $00 306 28000 ???? 00 28 heofonfir_lucelia_layer1_3_tallsprite_01_color3 = $28 307 28000 ???? 00 0f heofonfir_lucelia_layer1_3_tallsprite_01_color2 = $0f 308 28000 ???? 00 2c heofonfir_lucelia_layer1_3_tallsprite_01_color1 = $2c 309 28000 ???? 00 00 heofonfir_lucelia_layer1_3_tallsprite_01_color0 = $00 310 28000 ???? 00 28 heofonfir_lucelia_layer1_3_tallsprite_00_color3 = $28 311 28000 ???? 00 0f heofonfir_lucelia_layer1_3_tallsprite_00_color2 = $0f 312 28000 ???? 00 2c heofonfir_lucelia_layer1_3_tallsprite_00_color1 = $2c 313 28000 ???? 00 00 heofonfir_lucelia_layer1_3_tallsprite_00_color0 = $00 314 28000 ???? 00 28 heofonfir_lucelia_layer1_3_color3 = $28 315 28000 ???? 00 0f heofonfir_lucelia_layer1_3_color2 = $0f 316 28000 ???? 00 2c heofonfir_lucelia_layer1_3_color1 = $2c 317 28000 ???? 00 00 heofonfir_lucelia_layer1_3_color0 = $00 318 28000 ???? 00 28 heofonfir_lucelia_layer1_2_tallsprite_01_color3 = $28 319 28000 ???? 00 0f heofonfir_lucelia_layer1_2_tallsprite_01_color2 = $0f 320 28000 ???? 00 2c heofonfir_lucelia_layer1_2_tallsprite_01_color1 = $2c 321 28000 ???? 00 00 heofonfir_lucelia_layer1_2_tallsprite_01_color0 = $00 322 28000 ???? 00 28 heofonfir_lucelia_layer1_2_tallsprite_00_color3 = $28 323 28000 ???? 00 0f heofonfir_lucelia_layer1_2_tallsprite_00_color2 = $0f 324 28000 ???? 00 2c heofonfir_lucelia_layer1_2_tallsprite_00_color1 = $2c 325 28000 ???? 00 00 heofonfir_lucelia_layer1_2_tallsprite_00_color0 = $00 326 28000 ???? 00 28 heofonfir_lucelia_layer1_2_color3 = $28 327 28000 ???? 00 0f heofonfir_lucelia_layer1_2_color2 = $0f 328 28000 ???? 00 2c heofonfir_lucelia_layer1_2_color1 = $2c 329 28000 ???? 00 00 heofonfir_lucelia_layer1_2_color0 = $00 330 28000 ???? 00 28 heofonfir_lucelia_layer1_1_tallsprite_01_color3 = $28 331 28000 ???? 00 2c heofonfir_lucelia_layer1_1_tallsprite_01_color2 = $2c 332 28000 ???? 00 0f heofonfir_lucelia_layer1_1_tallsprite_01_color1 = $0f 333 28000 ???? 00 00 heofonfir_lucelia_layer1_1_tallsprite_01_color0 = $00 334 28000 ???? 00 28 heofonfir_lucelia_layer1_1_tallsprite_00_color3 = $28 335 28000 ???? 00 2c heofonfir_lucelia_layer1_1_tallsprite_00_color2 = $2c 336 28000 ???? 00 0f heofonfir_lucelia_layer1_1_tallsprite_00_color1 = $0f 337 28000 ???? 00 00 heofonfir_lucelia_layer1_1_tallsprite_00_color0 = $00 338 28000 ???? 00 28 heofonfir_lucelia_layer1_1_color3 = $28 339 28000 ???? 00 2c heofonfir_lucelia_layer1_1_color2 = $2c 340 28000 ???? 00 0f heofonfir_lucelia_layer1_1_color1 = $0f 341 28000 ???? 00 00 heofonfir_lucelia_layer1_1_color0 = $00 342 28000 ???? 01 49 player_l2_AniFrame = var9 343 28000 ???? 344 28000 ???? 01 48 joyposright = var8 345 28000 ???? 346 28000 ???? 01 47 joyposleft = var7 347 28000 ???? 348 28000 ???? 01 46 joyposup = var6 349 28000 ???? 350 28000 ???? 01 45 joyposdown = var5 351 28000 ???? 352 28000 ???? 01 44 player_l1_AniFrame = var4 353 28000 ???? 354 28000 ???? 01 43 fire_debounce = var3 355 28000 ???? 356 28000 ???? 01 42 playerY = var2 357 28000 ???? 358 28000 ???? 01 41 playerX = var1 359 28000 ???? 360 28000 ???? 01 40 frameCounter = var0 361 28000 ???? 362 28000 ???? 00 01 EXTRADLMEMORY = 1 363 28000 ???? 00 01 NTSC = 1 364 28000 ???? 00 01 CHECKOVERWRITE = 1 365 28000 ???? 00 08 ZONEHEIGHT = 8 366 28000 ???? 00 01 SGRAM = 1 367 28000 ???? 00 08 bankswitchmode = 8 368 28000 ???? 00 01 ROM128K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Lucelia_Movement_demo.bas.asm 555 28000 ???? 556 28000 ???? ; A BEAD header gets automatically incorportated into the ROM header. 557 28000 ???? ; For more BEAD executable info, check out the spec... 558 28000 ???? ; http://7800.8bitdev.org/index.php/The_Atari_7800_BEAD_Execuable_Specification 559 28000 ???? 560 28000 ???? 00 01 GAMEDESCRIPTIONSET = 1 561 28000 ???? 4e 61 6d 65 GAMEDESCRIPTION = "Test Name" 562 28000 ???? 563 28000 ???? 00 40 BDHSC = %01000000 564 28000 ???? 00 20 BDYM = %00100000 565 28000 ???? 00 10 BDPOKEY = %00010000 566 28000 ???? 00 08 BDROF = %00001000 567 28000 ???? 00 00 BD16K = %00000000 568 28000 ???? 00 01 BD32K = %00000001 569 28000 ???? 00 02 BD48K = %00000010 570 28000 ???? 00 05 BD1800 = %00000101 571 28000 ???? 00 06 BD4000 = %00000110 572 28000 ???? 573 28000 ???? - ifconst ROM32K 574 28000 ???? -BEADHEADER = 1 575 28000 ???? endif 576 28000 ???? - ifconst ROM48K 577 28000 ???? -BEADHEADER = 1 578 28000 ???? endif 579 28000 ???? 580 28000 ???? - ifconst BEADHEADER 581 28000 ???? -BEADHARDWARE SET 0 582 28000 ???? - ifconst ROM16K 583 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD16K) 584 28000 ???? - endif 585 28000 ???? - ifconst ROM32K 586 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD32K) 587 28000 ???? - endif 588 28000 ???? - ifconst ROM48K 589 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD48K) 590 28000 ???? - endif 591 28000 ???? - ifconst pokeysupport 592 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDPOKEY) 593 28000 ???? - endif 594 28000 ???? - ifconst HSSUPPORT 595 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDHSC) 596 28000 ???? - endif 597 28000 ???? endif 598 28000 ???? 599 28000 ???? ;start address of cart... 600 28000 ???? - ifconst ROM48K 601 28000 ???? - ORG $4000,0 602 28000 ???? - ifconst BEADHEADER 603 28000 ???? - .byte $BE,$AD,BEADHARDWARE 604 28000 ???? - ifconst GAMEDESCRIPTIONSET 605 28000 ???? - CLC 606 28000 ???? - BCC _SKIPDESCRIPTION 607 28000 ???? - .byte GAMEDESCRIPTION,0 608 28000 ???? -_SKIPDESCRIPTION 609 28000 ???? - endif 610 28000 ???? - jmp ($FFFC) 611 28000 ???? - endif 612 28000 ???? else 613 28000 ???? ifconst bankswitchmode 614 28000 ???? - ifconst ROMAT4K 615 28000 ???? - ORG $4000,0 616 28000 ???? - RORG $4000 617 28000 ???? else 618 8000 ORG $8000,0 619 8000 RORG $8000 620 8000 endif 621 8000 - else ; not bankswitchmode 622 8000 - ifconst ROM16K 623 8000 - ORG $C000,0 624 8000 - ifconst BEADHEADER 625 8000 - .byte $BE,$AD,BEADHARDWARE 626 8000 - ifconst GAMEDESCRIPTION 627 8000 - CLC 628 8000 - BCC _SKIPDESCRIPTION 629 8000 - .byte GAMEDESCRIPTION,0 630 8000 -_SKIPDESCRIPTION 631 8000 - endif 632 8000 - jmp ($FFFC) 633 8000 - endif 634 8000 - else 635 8000 - ifconst ROM8K 636 8000 - ORG $E000,0 637 8000 - else 638 8000 - ORG $8000,0 639 8000 - ifconst BEADHEADER 640 8000 - .byte $BE,$AD,BEADHARDWARE 641 8000 - ifconst GAMEDESCRIPTION 642 8000 - CLC 643 8000 - BCC _SKIPDESCRIPTION 644 8000 - .byte GAMEDESCRIPTION,0 645 8000 -_SKIPDESCRIPTION 646 8000 - endif 647 8000 - jmp ($FFFC) 648 8000 - endif 649 8000 - endif 650 8000 - endif 651 8000 endif 652 8000 endif 653 8000 654 8000 ;7800basic v0.18 Mar 14 2021 14:27:24 655 8000 SPACEOVERFLOW SET 0 656 8000 game 657 8000 . 658 8000 ;; 659 8000 660 8000 . 661 8000 ;; 662 8000 663 8000 . 664 8000 ;; 665 8000 666 8000 .L00 ;; set romsize 128kRAM 667 8000 668 8000 .L01 ;; set zoneheight 8 669 8000 670 8000 .L02 ;; set zoneprotection on 671 8000 672 8000 .L03 ;; set basepath graphics 673 8000 674 8000 .L04 ;; set tallsprite on 675 8000 676 8000 .L05 ;; set tv ntsc 677 8000 678 8000 .L06 ;; set extradlmemory on 679 8000 680 8000 .L07 ;; displaymode 160A 681 8000 682 8000 a9 40 lda #%01000000 ;Enable DMA, mode=160x2/160x4 683 8002 85 3c sta CTRL 684 8004 685 8004 8d 07 21 sta sCTRL 686 8007 687 8007 . 688 8007 ;; 689 8007 690 8007 . 691 8007 ;; 692 8007 693 8007 .L08 ;; dim frameCounter = var0 694 8007 695 8007 .L09 ;; dim playerX = var1 696 8007 697 8007 .L010 ;; dim playerY = var2 698 8007 699 8007 .L011 ;; dim fire_debounce = var3 700 8007 701 8007 .L012 ;; dim player_l1_AniFrame = var4 702 8007 703 8007 .L013 ;; dim joyposdown = var5 704 8007 705 8007 .L014 ;; dim joyposup = var6 706 8007 707 8007 .L015 ;; dim joyposleft = var7 708 8007 709 8007 .L016 ;; dim joyposright = var8 710 8007 711 8007 .L017 ;; dim player_l2_AniFrame = var9 712 8007 713 8007 . 714 8007 ;; 715 8007 716 8007 . 717 8007 ;; 718 8007 719 8007 .L018 ;; BACKGRND = $00 720 8007 721 8007 a9 00 LDA #$00 722 8009 85 20 STA BACKGRND 723 800b . 724 800b ;; 725 800b 726 800b .L019 ;; P0C1 = $F7 : P0C2 = $1C : P0C3 = $0F 727 800b 728 800b a9 f7 LDA #$F7 729 800d 85 21 STA P0C1 730 800f a9 1c LDA #$1C 731 8011 85 22 STA P0C2 732 8013 a9 0f LDA #$0F 733 8015 85 23 STA P0C3 734 8017 .L020 ;; P1C1 = $05 : P1C2 = $15 : P1C3 = $3D 735 8017 736 8017 a9 05 LDA #$05 737 8019 85 25 STA P1C1 738 801b a9 15 LDA #$15 739 801d 85 26 STA P1C2 740 801f a9 3d LDA #$3D 741 8021 85 27 STA P1C3 742 8023 .L021 ;; P2C1 = $90 : P2C2 = $96 : P2C3 = $AF 743 8023 744 8023 a9 90 LDA #$90 745 8025 85 29 STA P2C1 746 8027 a9 96 LDA #$96 747 8029 85 2a STA P2C2 748 802b a9 af LDA #$AF 749 802d 85 2b STA P2C3 750 802f .L022 ;; P3C1 = $77 : P3C2 = $7A : P3C3 = $6F 751 802f 752 802f a9 77 LDA #$77 753 8031 85 2d STA P3C1 754 8033 a9 7a LDA #$7A 755 8035 85 2e STA P3C2 756 8037 a9 6f LDA #$6F 757 8039 85 2f STA P3C3 758 803b .L023 ;; P4C1 = $E1 : P4C2 = $CA : P4C3 = $DD 759 803b 760 803b a9 e1 LDA #$E1 761 803d 85 31 STA P4C1 762 803f a9 ca LDA #$CA 763 8041 85 32 STA P4C2 764 8043 a9 dd LDA #$DD 765 8045 85 33 STA P4C3 766 8047 .L024 ;; P5C1 = $02 : P5C2 = $31 : P5C3 = $25 767 8047 768 8047 a9 02 LDA #$02 769 8049 85 35 STA P5C1 770 804b a9 31 LDA #$31 771 804d 85 36 STA P5C2 772 804f a9 25 LDA #$25 773 8051 85 37 STA P5C3 774 8053 .L025 ;; P6C1 = $07 : P6C2 = $0A : P6C3 = $0C 775 8053 776 8053 a9 07 LDA #$07 777 8055 85 39 STA P6C1 778 8057 a9 0a LDA #$0A 779 8059 85 3a STA P6C2 780 805b a9 0c LDA #$0C 781 805d 85 3b STA P6C3 782 805f .L026 ;; P7C1 = $50 : P7C2 = $64 : P7C3 = $78 783 805f 784 805f a9 50 LDA #$50 785 8061 85 3d STA P7C1 786 8063 a9 64 LDA #$64 787 8065 85 3e STA P7C2 788 8067 a9 78 LDA #$78 789 8069 85 3f STA P7C3 790 806b . 791 806b ;; 792 806b 793 806b .L027 ;; incgraphic player\heofonfir_lucelia_layer1_1.png 160A 794 806b 795 806b .L028 ;; incgraphic player\heofonfir_lucelia_layer1_2.png 160A 796 806b 797 806b .L029 ;; incgraphic player\heofonfir_lucelia_layer1_3.png 160A 798 806b 799 806b .L030 ;; incgraphic player\heofonfir_lucelia_layer1_4.png 160A 800 806b 801 806b .L031 ;; incgraphic player\heofonfir_lucelia_layer1_5.png 160A 802 806b 803 806b .L032 ;; incgraphic player\heofonfir_lucelia_layer1_6.png 160A 804 806b 805 806b .L033 ;; incgraphic player\heofonfir_lucelia_layer1_7.png 160A 806 806b 807 806b .L034 ;; incgraphic player\heofonfir_lucelia_layer1_8.png 160A 808 806b 809 806b .L035 ;; incgraphic player\heofonfir_lucelia_layer_2nofire_1.png 160A 810 806b 811 806b .L036 ;; incgraphic player\heofonfir_lucelia_layer_2nofire_2.png 160A 812 806b 813 806b .L037 ;; incgraphic player\heofonfir_lucelia_layer_2nofire_3.png 160A 814 806b 815 806b .L038 ;; incgraphic player\heofonfir_lucelia_layer_2nofire_4.png 160A 816 806b 817 806b .L039 ;; incgraphic player\heofonfir_lucelia_layer_2nofire_5.png 160A 818 806b 819 806b .L040 ;; incgraphic player\heofonfir_lucelia_layer_2nofire_6.png 160A 820 806b 821 806b .L041 ;; incgraphic player\heofonfir_lucelia_layer_2nofire_7.png 160A 822 806b 823 806b .L042 ;; incgraphic player\heofonfir_lucelia_layer_2nofire_8.png 160A 824 806b 825 806b . 826 806b ;; 827 806b 828 806b . 829 806b ;; 830 806b 831 806b .L043 ;; playerX = 80 : playerY = 144 : player_l1_AniFrame = 0 : player_l2_AniFrame = 0 : frameCounter = 0 832 806b 833 806b a9 50 LDA #80 834 806d 8d 41 01 STA playerX 835 8070 a9 90 LDA #144 836 8072 8d 42 01 STA playerY 837 8075 a9 00 LDA #0 838 8077 8d 44 01 STA player_l1_AniFrame 839 807a 8d 49 01 STA player_l2_AniFrame 840 807d 8d 40 01 STA frameCounter 841 8080 .L044 ;; joyposleft = 0 : joyposright = 0 : joyposup = 0 : joyposdown = 0 842 8080 843 8080 a9 00 LDA #0 844 8082 8d 47 01 STA joyposleft 845 8085 8d 48 01 STA joyposright 846 8088 8d 46 01 STA joyposup 847 808b 8d 45 01 STA joyposdown 848 808e . 849 808e ;; 850 808e 851 808e ._main 852 808e ;; _main 853 808e 854 808e .L045 ;; clearscreen 855 808e 856 808e 20 7f f0 jsr clearscreen 857 8091 . 858 8091 ;; 859 8091 860 8091 .L046 ;; frameCounter = frameCounter + 1 861 8091 862 8091 ad 40 01 LDA frameCounter 863 8094 18 CLC 864 8095 69 01 ADC #1 865 8097 8d 40 01 STA frameCounter 866 809a .L047 ;; if switchreset then reboot 867 809a 868 809a 20 16 f4 jsr checkresetswitch 869 809d d0 03 BNE .skipL047 870 809f .condpart0 871 809f 4c 03 f5 JMP START 872 80a2 .skipL047 873 80a2 ._mainloop 874 80a2 ;; _mainloop 875 80a2 876 80a2 . 877 80a2 ;; 878 80a2 879 80a2 .L048 ;; if joy0up then playerY = playerY - 1 : joyposup = 1 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 880 80a2 881 80a2 a9 10 lda #$10 882 80a4 2c 80 02 bit SWCHA 883 80a7 d0 19 BNE .skipL048 884 80a9 .condpart1 885 80a9 ad 42 01 LDA playerY 886 80ac 38 SEC 887 80ad e9 01 SBC #1 888 80af 8d 42 01 STA playerY 889 80b2 a9 01 LDA #1 890 80b4 8d 46 01 STA joyposup 891 80b7 a9 00 LDA #0 892 80b9 8d 45 01 STA joyposdown 893 80bc 8d 47 01 STA joyposleft 894 80bf 8d 48 01 STA joyposright 895 80c2 .skipL048 896 80c2 .L049 ;; if joy0down then playerY = playerY + 1 : joyposup = 0 : joyposdown = 1 : joyposleft = 0 : joyposright = 0 897 80c2 898 80c2 a9 20 lda #$20 899 80c4 2c 80 02 bit SWCHA 900 80c7 d0 1b BNE .skipL049 901 80c9 .condpart2 902 80c9 ad 42 01 LDA playerY 903 80cc 18 CLC 904 80cd 69 01 ADC #1 905 80cf 8d 42 01 STA playerY 906 80d2 a9 00 LDA #0 907 80d4 8d 46 01 STA joyposup 908 80d7 a9 01 LDA #1 909 80d9 8d 45 01 STA joyposdown 910 80dc a9 00 LDA #0 911 80de 8d 47 01 STA joyposleft 912 80e1 8d 48 01 STA joyposright 913 80e4 .skipL049 914 80e4 .L050 ;; if joy0left then playerX = playerX - 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 1 : joyposright = 0 915 80e4 916 80e4 2c 80 02 bit SWCHA 917 80e7 70 1b BVS .skipL050 918 80e9 .condpart3 919 80e9 ad 41 01 LDA playerX 920 80ec 38 SEC 921 80ed e9 01 SBC #1 922 80ef 8d 41 01 STA playerX 923 80f2 a9 00 LDA #0 924 80f4 8d 46 01 STA joyposup 925 80f7 8d 45 01 STA joyposdown 926 80fa a9 01 LDA #1 927 80fc 8d 47 01 STA joyposleft 928 80ff a9 00 LDA #0 929 8101 8d 48 01 STA joyposright 930 8104 .skipL050 931 8104 .L051 ;; if joy0right then playerX = playerX + 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 1 932 8104 933 8104 2c 80 02 bit SWCHA 934 8107 30 19 BMI .skipL051 935 8109 .condpart4 936 8109 ad 41 01 LDA playerX 937 810c 18 CLC 938 810d 69 01 ADC #1 939 810f 8d 41 01 STA playerX 940 8112 a9 00 LDA #0 941 8114 8d 46 01 STA joyposup 942 8117 8d 45 01 STA joyposdown 943 811a 8d 47 01 STA joyposleft 944 811d a9 01 LDA #1 945 811f 8d 48 01 STA joyposright 946 8122 .skipL051 947 8122 . 948 8122 ;; 949 8122 950 8122 .L052 ;; if playerX > 152 then playerX = playerX - 1 951 8122 952 8122 a9 98 LDA #152 953 8124 cd 41 01 CMP playerX 954 8127 b0 09 BCS .skipL052 955 8129 .condpart5 956 8129 ad 41 01 LDA playerX 957 812c 38 SEC 958 812d e9 01 SBC #1 959 812f 8d 41 01 STA playerX 960 8132 .skipL052 961 8132 .L053 ;; if playerX < 1 then playerX = playerX + 1 962 8132 963 8132 ad 41 01 LDA playerX 964 8135 c9 01 CMP #1 965 8137 b0 09 BCS .skipL053 966 8139 .condpart6 967 8139 ad 41 01 LDA playerX 968 813c 18 CLC 969 813d 69 01 ADC #1 970 813f 8d 41 01 STA playerX 971 8142 .skipL053 972 8142 .L054 ;; if playerY > 177 then playerY = playerY - 1 973 8142 974 8142 a9 b1 LDA #177 975 8144 cd 42 01 CMP playerY 976 8147 b0 09 BCS .skipL054 977 8149 .condpart7 978 8149 ad 42 01 LDA playerY 979 814c 38 SEC 980 814d e9 01 SBC #1 981 814f 8d 42 01 STA playerY 982 8152 .skipL054 983 8152 .L055 ;; if playerY < 1 then playerY = playerY + 1 984 8152 985 8152 ad 42 01 LDA playerY 986 8155 c9 01 CMP #1 987 8157 b0 09 BCS .skipL055 988 8159 .condpart8 989 8159 ad 42 01 LDA playerY 990 815c 18 CLC 991 815d 69 01 ADC #1 992 815f 8d 42 01 STA playerY 993 8162 .skipL055 994 8162 . 995 8162 ;; 996 8162 997 8162 .L056 ;; restorescreen 998 8162 999 8162 20 91 f0 jsr restorescreen 1000 8165 .L057 ;; goto draw_sprites 1001 8165 1002 8165 4c 6e 81 jmp .draw_sprites 1003 8168 1004 8168 .L058 ;; drawscreen 1005 8168 1006 8168 20 b3 f0 jsr drawscreen 1007 816b .L059 ;; goto _mainloop 1008 816b 1009 816b 4c a2 80 jmp ._mainloop 1010 816e 1011 816e . 1012 816e ;; 1013 816e 1014 816e .draw_sprites 1015 816e ;; draw_sprites 1016 816e 1017 816e .L060 ;; plotsprite heofonfir_lucelia_layer1_1 0 playerX playerY player_l1_AniFrame 1018 816e 1019 816e a9 00 lda #heofonfir_lucelia_layer1_1 1031 817f 85 43 sta temp2 1032 8181 1033 8181 a9 1d lda #(0|heofonfir_lucelia_layer1_1_width_twoscompliment) 1034 8183 85 44 sta temp3 1035 8185 1036 8185 ad 41 01 lda playerX 1037 8188 85 45 sta temp4 1038 818a 1039 818a ad 42 01 lda playerY 1040 818d 85 46 sta temp5 1041 818f 1042 818f a9 40 lda #(heofonfir_lucelia_layer1_1_mode|%01000000) 1043 8191 85 47 sta temp6 1044 8193 1045 8193 20 93 f2 jsr plotsprite 1046 8196 ; +tall sprite replot 1047 8196 18 clc 1048 8197 a5 42 lda temp1 1049 8199 69 03 adc #heofonfir_lucelia_layer1_1_width 1050 819b 85 42 sta temp1 1051 819d a5 46 lda temp5 1052 819f 69 08 adc #WZONEHEIGHT 1053 81a1 85 46 sta temp5 1054 81a3 20 93 f2 jsr plotsprite 1055 81a6 ; +tall sprite replot 1056 81a6 18 clc 1057 81a7 a5 42 lda temp1 1058 81a9 69 03 adc #heofonfir_lucelia_layer1_1_width 1059 81ab 85 42 sta temp1 1060 81ad a5 46 lda temp5 1061 81af 69 08 adc #WZONEHEIGHT 1062 81b1 85 46 sta temp5 1063 81b3 20 93 f2 jsr plotsprite 1064 81b6 .L061 ;; plotsprite heofonfir_lucelia_layer_2nofire_1 1 playerX playerY player_l2_AniFrame 1065 81b6 1066 81b6 a9 48 lda #heofonfir_lucelia_layer_2nofire_1 1078 81c7 85 43 sta temp2 1079 81c9 1080 81c9 a9 3d lda #(32|heofonfir_lucelia_layer_2nofire_1_width_twoscompliment) 1081 81cb 85 44 sta temp3 1082 81cd 1083 81cd ad 41 01 lda playerX 1084 81d0 85 45 sta temp4 1085 81d2 1086 81d2 ad 42 01 lda playerY 1087 81d5 85 46 sta temp5 1088 81d7 1089 81d7 a9 40 lda #(heofonfir_lucelia_layer_2nofire_1_mode|%01000000) 1090 81d9 85 47 sta temp6 1091 81db 1092 81db 20 93 f2 jsr plotsprite 1093 81de ; +tall sprite replot 1094 81de 18 clc 1095 81df a5 42 lda temp1 1096 81e1 69 03 adc #heofonfir_lucelia_layer_2nofire_1_width 1097 81e3 85 42 sta temp1 1098 81e5 a5 46 lda temp5 1099 81e7 69 08 adc #WZONEHEIGHT 1100 81e9 85 46 sta temp5 1101 81eb 20 93 f2 jsr plotsprite 1102 81ee ; +tall sprite replot 1103 81ee 18 clc 1104 81ef a5 42 lda temp1 1105 81f1 69 03 adc #heofonfir_lucelia_layer_2nofire_1_width 1106 81f3 85 42 sta temp1 1107 81f5 a5 46 lda temp5 1108 81f7 69 08 adc #WZONEHEIGHT 1109 81f9 85 46 sta temp5 1110 81fb 20 93 f2 jsr plotsprite 1111 81fe .L062 ;; return 1112 81fe ba tsx 1113 81ff bd 02 01 lda $102,x 1114 8202 f0 01 beq bankswitchret3 1115 8204 60 RTS 1116 8205 bankswitchret3 1117 8205 4c 03 f4 JMP BS_return 1118 8205 DMAHOLEEND0 SET . 1119 8208 gameend 1120 8208 DMAHOLEEND0 SET . 11768 bytes of ROM space left in the main area of bank 1. 1121 8208 echo " ",[($B000 - .)]d , "bytes of ROM space left in the main area of bank 1." 1122 8208 - if ($B000 - .) < 0 1123 8208 -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 1124 8208 endif 1125 8208 1126 b000 ORG $B000,0 ; ************* 1127 b000 1128 b000 RORG $B000 ; ************* 1129 b000 1130 b000 heofonfir_lucelia_layer1_1 1131 b000 10 ab 04 HEX 10ab04 1132 b003 heofonfir_lucelia_layer1_1_tallsprite_00 1133 b003 00 6c 00 HEX 006c00 1134 b006 heofonfir_lucelia_layer1_1_tallsprite_01 1135 b006 00 00 00 HEX 000000 1136 b009 heofonfir_lucelia_layer1_2 1137 b009 80 5f 02 HEX 805f02 1138 b00c heofonfir_lucelia_layer1_2_tallsprite_00 1139 b00c 00 aa 00 HEX 00aa00 1140 b00f heofonfir_lucelia_layer1_2_tallsprite_01 1141 b00f 00 00 00 HEX 000000 1142 b012 heofonfir_lucelia_layer1_3 1143 b012 00 57 00 HEX 005700 1144 b015 heofonfir_lucelia_layer1_3_tallsprite_00 1145 b015 00 00 00 HEX 000000 1146 b018 heofonfir_lucelia_layer1_3_tallsprite_01 1147 b018 00 00 00 HEX 000000 1148 b01b heofonfir_lucelia_layer1_4 1149 b01b 00 1c 00 HEX 001c00 1150 b01e heofonfir_lucelia_layer1_4_tallsprite_00 1151 b01e 20 00 08 HEX 200008 1152 b021 heofonfir_lucelia_layer1_4_tallsprite_01 1153 b021 00 00 00 HEX 000000 1154 b024 heofonfir_lucelia_layer1_5 1155 b024 02 96 80 HEX 029680 1156 b027 heofonfir_lucelia_layer1_5_tallsprite_00 1157 b027 00 00 00 HEX 000000 1158 b02a heofonfir_lucelia_layer1_5_tallsprite_01 1159 b02a 00 00 00 HEX 000000 1160 b02d heofonfir_lucelia_layer1_6 1161 b02d 04 ab 10 HEX 04ab10 1162 b030 heofonfir_lucelia_layer1_6_tallsprite_00 1163 b030 00 82 00 HEX 008200 1164 b033 heofonfir_lucelia_layer1_6_tallsprite_01 1165 b033 00 00 00 HEX 000000 1166 b036 heofonfir_lucelia_layer1_7 1167 b036 40 69 01 HEX 406901 1168 b039 heofonfir_lucelia_layer1_7_tallsprite_00 1169 b039 00 00 00 HEX 000000 1170 b03c heofonfir_lucelia_layer1_7_tallsprite_01 1171 b03c 00 00 00 HEX 000000 1172 b03f heofonfir_lucelia_layer1_8 1173 b03f 01 ab 40 HEX 01ab40 1174 b042 heofonfir_lucelia_layer1_8_tallsprite_00 1175 b042 00 00 00 HEX 000000 1176 b045 heofonfir_lucelia_layer1_8_tallsprite_01 1177 b045 00 00 00 HEX 000000 1178 b048 heofonfir_lucelia_layer_2nofire_1 1179 b048 00 00 00 HEX 000000 1180 b04b heofonfir_lucelia_layer_2nofire_1_tallsprite_00 1181 b04b 04 02 10 HEX 040210 1182 b04e heofonfir_lucelia_layer_2nofire_1_tallsprite_01 1183 b04e 00 00 00 HEX 000000 1184 b051 heofonfir_lucelia_layer_2nofire_2 1185 b051 00 00 00 HEX 000000 1186 b054 heofonfir_lucelia_layer_2nofire_2_tallsprite_00 1187 b054 00 00 00 HEX 000000 1188 b057 heofonfir_lucelia_layer_2nofire_2_tallsprite_01 1189 b057 00 00 00 HEX 000000 1190 b05a heofonfir_lucelia_layer_2nofire_3 1191 b05a 00 00 00 HEX 000000 1192 b05d heofonfir_lucelia_layer_2nofire_3_tallsprite_00 1193 b05d 00 41 00 HEX 004100 1194 b060 heofonfir_lucelia_layer_2nofire_3_tallsprite_01 1195 b060 00 00 00 HEX 000000 1196 b063 heofonfir_lucelia_layer_2nofire_4 1197 b063 00 00 00 HEX 000000 1198 b066 heofonfir_lucelia_layer_2nofire_4_tallsprite_00 1199 b066 00 41 00 HEX 004100 1200 b069 heofonfir_lucelia_layer_2nofire_4_tallsprite_01 1201 b069 00 00 00 HEX 000000 1202 b06c heofonfir_lucelia_layer_2nofire_5 1203 b06c 00 00 00 HEX 000000 1204 b06f heofonfir_lucelia_layer_2nofire_5_tallsprite_00 1205 b06f 00 41 00 HEX 004100 1206 b072 heofonfir_lucelia_layer_2nofire_5_tallsprite_01 1207 b072 00 00 00 HEX 000000 1208 b075 heofonfir_lucelia_layer_2nofire_6 1209 b075 01 00 40 HEX 010040 1210 b078 heofonfir_lucelia_layer_2nofire_6_tallsprite_00 1211 b078 00 00 00 HEX 000000 1212 b07b heofonfir_lucelia_layer_2nofire_6_tallsprite_01 1213 b07b 00 00 00 HEX 000000 1214 b07e heofonfir_lucelia_layer_2nofire_7 1215 b07e 00 00 00 HEX 000000 1216 b081 heofonfir_lucelia_layer_2nofire_7_tallsprite_00 1217 b081 00 41 00 HEX 004100 1218 b084 heofonfir_lucelia_layer_2nofire_7_tallsprite_01 1219 b084 00 00 00 HEX 000000 1220 b087 heofonfir_lucelia_layer_2nofire_8 1221 b087 00 00 00 HEX 000000 1222 b08a heofonfir_lucelia_layer_2nofire_8_tallsprite_00 1223 b08a 00 41 00 HEX 004100 1224 b08d heofonfir_lucelia_layer_2nofire_8_tallsprite_01 1225 b08d 00 00 00 HEX 000000 1226 b090 1227 b100 ORG $B100,0 ; ************* 1228 b100 1229 b100 RORG $B100 ; ************* 1230 b100 1231 b100 ;heofonfir_lucelia_layer1_1 1232 b100 10 28 04 HEX 102804 1233 b103 ;heofonfir_lucelia_layer1_1_tallsprite_00 1234 b103 00 6c 00 HEX 006c00 1235 b106 ;heofonfir_lucelia_layer1_1_tallsprite_01 1236 b106 00 00 00 HEX 000000 1237 b109 ;heofonfir_lucelia_layer1_2 1238 b109 80 57 02 HEX 805702 1239 b10c ;heofonfir_lucelia_layer1_2_tallsprite_00 1240 b10c 00 9c 00 HEX 009c00 1241 b10f ;heofonfir_lucelia_layer1_2_tallsprite_01 1242 b10f 00 00 00 HEX 000000 1243 b112 ;heofonfir_lucelia_layer1_3 1244 b112 00 5f 00 HEX 005f00 1245 b115 ;heofonfir_lucelia_layer1_3_tallsprite_00 1246 b115 00 aa 00 HEX 00aa00 1247 b118 ;heofonfir_lucelia_layer1_3_tallsprite_01 1248 b118 00 00 00 HEX 000000 1249 b11b ;heofonfir_lucelia_layer1_4 1250 b11b 00 57 00 HEX 005700 1251 b11e ;heofonfir_lucelia_layer1_4_tallsprite_00 1252 b11e 20 00 08 HEX 200008 1253 b121 ;heofonfir_lucelia_layer1_4_tallsprite_01 1254 b121 00 00 00 HEX 000000 1255 b124 ;heofonfir_lucelia_layer1_5 1256 b124 00 1c 00 HEX 001c00 1257 b127 ;heofonfir_lucelia_layer1_5_tallsprite_00 1258 b127 00 00 00 HEX 000000 1259 b12a ;heofonfir_lucelia_layer1_5_tallsprite_01 1260 b12a 00 00 00 HEX 000000 1261 b12d ;heofonfir_lucelia_layer1_6 1262 b12d 04 69 10 HEX 046910 1263 b130 ;heofonfir_lucelia_layer1_6_tallsprite_00 1264 b130 00 00 00 HEX 000000 1265 b133 ;heofonfir_lucelia_layer1_6_tallsprite_01 1266 b133 00 00 00 HEX 000000 1267 b136 ;heofonfir_lucelia_layer1_7 1268 b136 41 2c 41 HEX 412c41 1269 b139 ;heofonfir_lucelia_layer1_7_tallsprite_00 1270 b139 00 00 00 HEX 000000 1271 b13c ;heofonfir_lucelia_layer1_7_tallsprite_01 1272 b13c 00 00 00 HEX 000000 1273 b13f ;heofonfir_lucelia_layer1_8 1274 b13f 41 af 41 HEX 41af41 1275 b142 ;heofonfir_lucelia_layer1_8_tallsprite_00 1276 b142 00 55 00 HEX 005500 1277 b145 ;heofonfir_lucelia_layer1_8_tallsprite_01 1278 b145 00 00 00 HEX 000000 1279 b148 ;heofonfir_lucelia_layer_2nofire_1 1280 b148 00 00 00 HEX 000000 1281 b14b ;heofonfir_lucelia_layer_2nofire_1_tallsprite_00 1282 b14b 04 02 10 HEX 040210 1283 b14e ;heofonfir_lucelia_layer_2nofire_1_tallsprite_01 1284 b14e 00 c3 00 HEX 00c300 1285 b151 ;heofonfir_lucelia_layer_2nofire_2 1286 b151 00 00 00 HEX 000000 1287 b154 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_00 1288 b154 04 02 10 HEX 040210 1289 b157 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_01 1290 b157 00 00 00 HEX 000000 1291 b15a ;heofonfir_lucelia_layer_2nofire_3 1292 b15a 00 00 00 HEX 000000 1293 b15d ;heofonfir_lucelia_layer_2nofire_3_tallsprite_00 1294 b15d 00 00 00 HEX 000000 1295 b160 ;heofonfir_lucelia_layer_2nofire_3_tallsprite_01 1296 b160 00 00 00 HEX 000000 1297 b163 ;heofonfir_lucelia_layer_2nofire_4 1298 b163 00 00 00 HEX 000000 1299 b166 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_00 1300 b166 00 41 00 HEX 004100 1301 b169 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_01 1302 b169 00 00 00 HEX 000000 1303 b16c ;heofonfir_lucelia_layer_2nofire_5 1304 b16c 00 00 00 HEX 000000 1305 b16f ;heofonfir_lucelia_layer_2nofire_5_tallsprite_00 1306 b16f 00 41 00 HEX 004100 1307 b172 ;heofonfir_lucelia_layer_2nofire_5_tallsprite_01 1308 b172 00 00 00 HEX 000000 1309 b175 ;heofonfir_lucelia_layer_2nofire_6 1310 b175 00 00 00 HEX 000000 1311 b178 ;heofonfir_lucelia_layer_2nofire_6_tallsprite_00 1312 b178 00 41 00 HEX 004100 1313 b17b ;heofonfir_lucelia_layer_2nofire_6_tallsprite_01 1314 b17b 00 00 00 HEX 000000 1315 b17e ;heofonfir_lucelia_layer_2nofire_7 1316 b17e 00 00 00 HEX 000000 1317 b181 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_00 1318 b181 00 41 00 HEX 004100 1319 b184 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_01 1320 b184 00 00 00 HEX 000000 1321 b187 ;heofonfir_lucelia_layer_2nofire_8 1322 b187 00 00 00 HEX 000000 1323 b18a ;heofonfir_lucelia_layer_2nofire_8_tallsprite_00 1324 b18a 00 00 00 HEX 000000 1325 b18d ;heofonfir_lucelia_layer_2nofire_8_tallsprite_01 1326 b18d 00 00 00 HEX 000000 1327 b190 1328 b200 ORG $B200,0 ; ************* 1329 b200 1330 b200 RORG $B200 ; ************* 1331 b200 1332 b200 ;heofonfir_lucelia_layer1_1 1333 b200 10 00 04 HEX 100004 1334 b203 ;heofonfir_lucelia_layer1_1_tallsprite_00 1335 b203 00 2c 00 HEX 002c00 1336 b206 ;heofonfir_lucelia_layer1_1_tallsprite_01 1337 b206 00 82 00 HEX 008200 1338 b209 ;heofonfir_lucelia_layer1_2 1339 b209 80 14 02 HEX 801402 1340 b20c ;heofonfir_lucelia_layer1_2_tallsprite_00 1341 b20c 00 9c 00 HEX 009c00 1342 b20f ;heofonfir_lucelia_layer1_2_tallsprite_01 1343 b20f 00 00 00 HEX 000000 1344 b212 ;heofonfir_lucelia_layer1_3 1345 b212 00 57 00 HEX 005700 1346 b215 ;heofonfir_lucelia_layer1_3_tallsprite_00 1347 b215 80 9c 02 HEX 809c02 1348 b218 ;heofonfir_lucelia_layer1_3_tallsprite_01 1349 b218 00 00 00 HEX 000000 1350 b21b ;heofonfir_lucelia_layer1_4 1351 b21b 00 5f 00 HEX 005f00 1352 b21e ;heofonfir_lucelia_layer1_4_tallsprite_00 1353 b21e 20 aa 08 HEX 20aa08 1354 b221 ;heofonfir_lucelia_layer1_4_tallsprite_01 1355 b221 00 00 00 HEX 000000 1356 b224 ;heofonfir_lucelia_layer1_5 1357 b224 00 57 00 HEX 005700 1358 b227 ;heofonfir_lucelia_layer1_5_tallsprite_00 1359 b227 00 00 00 HEX 000000 1360 b22a ;heofonfir_lucelia_layer1_5_tallsprite_01 1361 b22a 00 00 00 HEX 000000 1362 b22d ;heofonfir_lucelia_layer1_6 1363 b22d 01 2c 40 HEX 012c40 1364 b230 ;heofonfir_lucelia_layer1_6_tallsprite_00 1365 b230 40 00 01 HEX 400001 1366 b233 ;heofonfir_lucelia_layer1_6_tallsprite_01 1367 b233 00 00 00 HEX 000000 1368 b236 ;heofonfir_lucelia_layer1_7 1369 b236 11 ab 44 HEX 11ab44 1370 b239 ;heofonfir_lucelia_layer1_7_tallsprite_00 1371 b239 00 00 00 HEX 000000 1372 b23c ;heofonfir_lucelia_layer1_7_tallsprite_01 1373 b23c 00 00 00 HEX 000000 1374 b23f ;heofonfir_lucelia_layer1_8 1375 b23f 44 ab 11 HEX 44ab11 1376 b242 ;heofonfir_lucelia_layer1_8_tallsprite_00 1377 b242 00 6c 00 HEX 006c00 1378 b245 ;heofonfir_lucelia_layer1_8_tallsprite_01 1379 b245 00 00 00 HEX 000000 1380 b248 ;heofonfir_lucelia_layer_2nofire_1 1381 b248 00 00 00 HEX 000000 1382 b24b ;heofonfir_lucelia_layer_2nofire_1_tallsprite_00 1383 b24b 01 00 40 HEX 010040 1384 b24e ;heofonfir_lucelia_layer_2nofire_1_tallsprite_01 1385 b24e 00 00 00 HEX 000000 1386 b251 ;heofonfir_lucelia_layer_2nofire_2 1387 b251 00 00 00 HEX 000000 1388 b254 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_00 1389 b254 04 02 10 HEX 040210 1390 b257 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_01 1391 b257 00 c3 00 HEX 00c300 1392 b25a ;heofonfir_lucelia_layer_2nofire_3 1393 b25a 00 00 00 HEX 000000 1394 b25d ;heofonfir_lucelia_layer_2nofire_3_tallsprite_00 1395 b25d 04 02 10 HEX 040210 1396 b260 ;heofonfir_lucelia_layer_2nofire_3_tallsprite_01 1397 b260 00 00 00 HEX 000000 1398 b263 ;heofonfir_lucelia_layer_2nofire_4 1399 b263 00 00 00 HEX 000000 1400 b266 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_00 1401 b266 00 00 00 HEX 000000 1402 b269 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_01 1403 b269 00 00 00 HEX 000000 1404 b26c ;heofonfir_lucelia_layer_2nofire_5 1405 b26c 00 00 00 HEX 000000 1406 b26f ;heofonfir_lucelia_layer_2nofire_5_tallsprite_00 1407 b26f 00 41 00 HEX 004100 1408 b272 ;heofonfir_lucelia_layer_2nofire_5_tallsprite_01 1409 b272 00 00 00 HEX 000000 1410 b275 ;heofonfir_lucelia_layer_2nofire_6 1411 b275 00 00 00 HEX 000000 1412 b278 ;heofonfir_lucelia_layer_2nofire_6_tallsprite_00 1413 b278 00 41 00 HEX 004100 1414 b27b ;heofonfir_lucelia_layer_2nofire_6_tallsprite_01 1415 b27b 00 00 00 HEX 000000 1416 b27e ;heofonfir_lucelia_layer_2nofire_7 1417 b27e 00 00 00 HEX 000000 1418 b281 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_00 1419 b281 00 41 00 HEX 004100 1420 b284 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_01 1421 b284 00 00 00 HEX 000000 1422 b287 ;heofonfir_lucelia_layer_2nofire_8 1423 b287 00 00 00 HEX 000000 1424 b28a ;heofonfir_lucelia_layer_2nofire_8_tallsprite_00 1425 b28a 04 02 10 HEX 040210 1426 b28d ;heofonfir_lucelia_layer_2nofire_8_tallsprite_01 1427 b28d 00 00 00 HEX 000000 1428 b290 1429 b300 ORG $B300,0 ; ************* 1430 b300 1431 b300 RORG $B300 ; ************* 1432 b300 1433 b300 ;heofonfir_lucelia_layer1_1 1434 b300 40 00 01 HEX 400001 1435 b303 ;heofonfir_lucelia_layer1_1_tallsprite_00 1436 b303 00 ab 00 HEX 00ab00 1437 b306 ;heofonfir_lucelia_layer1_1_tallsprite_01 1438 b306 00 82 00 HEX 008200 1439 b309 ;heofonfir_lucelia_layer1_2 1440 b309 00 00 00 HEX 000000 1441 b30c ;heofonfir_lucelia_layer1_2_tallsprite_00 1442 b30c 00 1c 00 HEX 001c00 1443 b30f ;heofonfir_lucelia_layer1_2_tallsprite_01 1444 b30f 00 41 00 HEX 004100 1445 b312 ;heofonfir_lucelia_layer1_3 1446 b312 00 14 00 HEX 001400 1447 b315 ;heofonfir_lucelia_layer1_3_tallsprite_00 1448 b315 80 9c 02 HEX 809c02 1449 b318 ;heofonfir_lucelia_layer1_3_tallsprite_01 1450 b318 00 00 00 HEX 000000 1451 b31b ;heofonfir_lucelia_layer1_4 1452 b31b 00 57 00 HEX 005700 1453 b31e ;heofonfir_lucelia_layer1_4_tallsprite_00 1454 b31e 20 9c 08 HEX 209c08 1455 b321 ;heofonfir_lucelia_layer1_4_tallsprite_01 1456 b321 00 00 00 HEX 000000 1457 b324 ;heofonfir_lucelia_layer1_5 1458 b324 00 5f 00 HEX 005f00 1459 b327 ;heofonfir_lucelia_layer1_5_tallsprite_00 1460 b327 00 aa 00 HEX 00aa00 1461 b32a ;heofonfir_lucelia_layer1_5_tallsprite_01 1462 b32a 00 00 00 HEX 000000 1463 b32d ;heofonfir_lucelia_layer1_6 1464 b32d 00 ab 00 HEX 00ab00 1465 b330 ;heofonfir_lucelia_layer1_6_tallsprite_00 1466 b330 40 00 01 HEX 400001 1467 b333 ;heofonfir_lucelia_layer1_6_tallsprite_01 1468 b333 00 00 00 HEX 000000 1469 b336 ;heofonfir_lucelia_layer1_7 1470 b336 04 af 10 HEX 04af10 1471 b339 ;heofonfir_lucelia_layer1_7_tallsprite_00 1472 b339 00 55 00 HEX 005500 1473 b33c ;heofonfir_lucelia_layer1_7_tallsprite_01 1474 b33c 00 00 00 HEX 000000 1475 b33f ;heofonfir_lucelia_layer1_8 1476 b33f 44 28 11 HEX 442811 1477 b342 ;heofonfir_lucelia_layer1_8_tallsprite_00 1478 b342 00 6c 00 HEX 006c00 1479 b345 ;heofonfir_lucelia_layer1_8_tallsprite_01 1480 b345 00 00 00 HEX 000000 1481 b348 ;heofonfir_lucelia_layer_2nofire_1 1482 b348 00 00 00 HEX 000000 1483 b34b ;heofonfir_lucelia_layer_2nofire_1_tallsprite_00 1484 b34b 01 00 40 HEX 010040 1485 b34e ;heofonfir_lucelia_layer_2nofire_1_tallsprite_01 1486 b34e 00 00 00 HEX 000000 1487 b351 ;heofonfir_lucelia_layer_2nofire_2 1488 b351 00 00 00 HEX 000000 1489 b354 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_00 1490 b354 01 00 40 HEX 010040 1491 b357 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_01 1492 b357 00 00 00 HEX 000000 1493 b35a ;heofonfir_lucelia_layer_2nofire_3 1494 b35a 00 00 00 HEX 000000 1495 b35d ;heofonfir_lucelia_layer_2nofire_3_tallsprite_00 1496 b35d 04 02 10 HEX 040210 1497 b360 ;heofonfir_lucelia_layer_2nofire_3_tallsprite_01 1498 b360 00 c3 00 HEX 00c300 1499 b363 ;heofonfir_lucelia_layer_2nofire_4 1500 b363 00 00 00 HEX 000000 1501 b366 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_00 1502 b366 04 02 10 HEX 040210 1503 b369 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_01 1504 b369 00 00 00 HEX 000000 1505 b36c ;heofonfir_lucelia_layer_2nofire_5 1506 b36c 00 00 00 HEX 000000 1507 b36f ;heofonfir_lucelia_layer_2nofire_5_tallsprite_00 1508 b36f 00 00 00 HEX 000000 1509 b372 ;heofonfir_lucelia_layer_2nofire_5_tallsprite_01 1510 b372 00 00 00 HEX 000000 1511 b375 ;heofonfir_lucelia_layer_2nofire_6 1512 b375 00 00 00 HEX 000000 1513 b378 ;heofonfir_lucelia_layer_2nofire_6_tallsprite_00 1514 b378 00 41 00 HEX 004100 1515 b37b ;heofonfir_lucelia_layer_2nofire_6_tallsprite_01 1516 b37b 00 00 00 HEX 000000 1517 b37e ;heofonfir_lucelia_layer_2nofire_7 1518 b37e 00 00 00 HEX 000000 1519 b381 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_00 1520 b381 00 00 00 HEX 000000 1521 b384 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_01 1522 b384 00 00 00 HEX 000000 1523 b387 ;heofonfir_lucelia_layer_2nofire_8 1524 b387 00 00 00 HEX 000000 1525 b38a ;heofonfir_lucelia_layer_2nofire_8_tallsprite_00 1526 b38a 04 02 10 HEX 040210 1527 b38d ;heofonfir_lucelia_layer_2nofire_8_tallsprite_01 1528 b38d 00 c3 00 HEX 00c300 1529 b390 1530 b400 ORG $B400,0 ; ************* 1531 b400 1532 b400 RORG $B400 ; ************* 1533 b400 1534 b400 ;heofonfir_lucelia_layer1_1 1535 b400 40 00 01 HEX 400001 1536 b403 ;heofonfir_lucelia_layer1_1_tallsprite_00 1537 b403 00 69 00 HEX 006900 1538 b406 ;heofonfir_lucelia_layer1_1_tallsprite_01 1539 b406 00 00 00 HEX 000000 1540 b409 ;heofonfir_lucelia_layer1_2 1541 b409 00 00 00 HEX 000000 1542 b40c ;heofonfir_lucelia_layer1_2_tallsprite_00 1543 b40c 00 57 00 HEX 005700 1544 b40f ;heofonfir_lucelia_layer1_2_tallsprite_01 1545 b40f 00 41 00 HEX 004100 1546 b412 ;heofonfir_lucelia_layer1_3 1547 b412 00 00 00 HEX 000000 1548 b415 ;heofonfir_lucelia_layer1_3_tallsprite_00 1549 b415 80 1c 02 HEX 801c02 1550 b418 ;heofonfir_lucelia_layer1_3_tallsprite_01 1551 b418 00 41 00 HEX 004100 1552 b41b ;heofonfir_lucelia_layer1_4 1553 b41b 00 14 00 HEX 001400 1554 b41e ;heofonfir_lucelia_layer1_4_tallsprite_00 1555 b41e 08 9c 20 HEX 089c20 1556 b421 ;heofonfir_lucelia_layer1_4_tallsprite_01 1557 b421 00 00 00 HEX 000000 1558 b424 ;heofonfir_lucelia_layer1_5 1559 b424 00 57 00 HEX 005700 1560 b427 ;heofonfir_lucelia_layer1_5_tallsprite_00 1561 b427 80 9c 02 HEX 809c02 1562 b42a ;heofonfir_lucelia_layer1_5_tallsprite_01 1563 b42a 00 00 00 HEX 000000 1564 b42d ;heofonfir_lucelia_layer1_6 1565 b42d 00 af 00 HEX 00af00 1566 b430 ;heofonfir_lucelia_layer1_6_tallsprite_00 1567 b430 40 55 01 HEX 405501 1568 b433 ;heofonfir_lucelia_layer1_6_tallsprite_01 1569 b433 00 00 00 HEX 000000 1570 b436 ;heofonfir_lucelia_layer1_7 1571 b436 00 ab 00 HEX 00ab00 1572 b439 ;heofonfir_lucelia_layer1_7_tallsprite_00 1573 b439 00 6c 00 HEX 006c00 1574 b43c ;heofonfir_lucelia_layer1_7_tallsprite_01 1575 b43c 00 00 00 HEX 000000 1576 b43f ;heofonfir_lucelia_layer1_8 1577 b43f 10 00 04 HEX 100004 1578 b442 ;heofonfir_lucelia_layer1_8_tallsprite_00 1579 b442 00 2c 00 HEX 002c00 1580 b445 ;heofonfir_lucelia_layer1_8_tallsprite_01 1581 b445 00 82 00 HEX 008200 1582 b448 ;heofonfir_lucelia_layer_2nofire_1 1583 b448 00 00 00 HEX 000000 1584 b44b ;heofonfir_lucelia_layer_2nofire_1_tallsprite_00 1585 b44b 00 00 00 HEX 000000 1586 b44e ;heofonfir_lucelia_layer_2nofire_1_tallsprite_01 1587 b44e 00 41 00 HEX 004100 1588 b451 ;heofonfir_lucelia_layer_2nofire_2 1589 b451 00 00 00 HEX 000000 1590 b454 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_00 1591 b454 01 00 40 HEX 010040 1592 b457 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_01 1593 b457 00 00 00 HEX 000000 1594 b45a ;heofonfir_lucelia_layer_2nofire_3 1595 b45a 00 00 00 HEX 000000 1596 b45d ;heofonfir_lucelia_layer_2nofire_3_tallsprite_00 1597 b45d 01 00 40 HEX 010040 1598 b460 ;heofonfir_lucelia_layer_2nofire_3_tallsprite_01 1599 b460 00 00 00 HEX 000000 1600 b463 ;heofonfir_lucelia_layer_2nofire_4 1601 b463 00 00 00 HEX 000000 1602 b466 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_00 1603 b466 04 02 10 HEX 040210 1604 b469 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_01 1605 b469 00 c3 00 HEX 00c300 1606 b46c ;heofonfir_lucelia_layer_2nofire_5 1607 b46c 00 00 00 HEX 000000 1608 b46f ;heofonfir_lucelia_layer_2nofire_5_tallsprite_00 1609 b46f 04 02 10 HEX 040210 1610 b472 ;heofonfir_lucelia_layer_2nofire_5_tallsprite_01 1611 b472 00 00 00 HEX 000000 1612 b475 ;heofonfir_lucelia_layer_2nofire_6 1613 b475 00 00 00 HEX 000000 1614 b478 ;heofonfir_lucelia_layer_2nofire_6_tallsprite_00 1615 b478 00 00 00 HEX 000000 1616 b47b ;heofonfir_lucelia_layer_2nofire_6_tallsprite_01 1617 b47b 00 00 00 HEX 000000 1618 b47e ;heofonfir_lucelia_layer_2nofire_7 1619 b47e 00 00 00 HEX 000000 1620 b481 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_00 1621 b481 04 02 10 HEX 040210 1622 b484 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_01 1623 b484 00 00 00 HEX 000000 1624 b487 ;heofonfir_lucelia_layer_2nofire_8 1625 b487 00 00 00 HEX 000000 1626 b48a ;heofonfir_lucelia_layer_2nofire_8_tallsprite_00 1627 b48a 01 00 40 HEX 010040 1628 b48d ;heofonfir_lucelia_layer_2nofire_8_tallsprite_01 1629 b48d 00 00 00 HEX 000000 1630 b490 1631 b500 ORG $B500,0 ; ************* 1632 b500 1633 b500 RORG $B500 ; ************* 1634 b500 1635 b500 ;heofonfir_lucelia_layer1_1 1636 b500 40 00 01 HEX 400001 1637 b503 ;heofonfir_lucelia_layer1_1_tallsprite_00 1638 b503 01 2c 40 HEX 012c40 1639 b506 ;heofonfir_lucelia_layer1_1_tallsprite_01 1640 b506 00 00 00 HEX 000000 1641 b509 ;heofonfir_lucelia_layer1_2 1642 b509 00 00 00 HEX 000000 1643 b50c ;heofonfir_lucelia_layer1_2_tallsprite_00 1644 b50c 00 96 00 HEX 009600 1645 b50f ;heofonfir_lucelia_layer1_2_tallsprite_01 1646 b50f 00 00 00 HEX 000000 1647 b512 ;heofonfir_lucelia_layer1_3 1648 b512 00 00 00 HEX 000000 1649 b515 ;heofonfir_lucelia_layer1_3_tallsprite_00 1650 b515 28 57 28 HEX 285728 1651 b518 ;heofonfir_lucelia_layer1_3_tallsprite_01 1652 b518 00 41 00 HEX 004100 1653 b51b ;heofonfir_lucelia_layer1_4 1654 b51b 00 00 00 HEX 000000 1655 b51e ;heofonfir_lucelia_layer1_4_tallsprite_00 1656 b51e 08 1c 20 HEX 081c20 1657 b521 ;heofonfir_lucelia_layer1_4_tallsprite_01 1658 b521 00 41 00 HEX 004100 1659 b524 ;heofonfir_lucelia_layer1_5 1660 b524 00 14 00 HEX 001400 1661 b527 ;heofonfir_lucelia_layer1_5_tallsprite_00 1662 b527 80 9c 02 HEX 809c02 1663 b52a ;heofonfir_lucelia_layer1_5_tallsprite_01 1664 b52a 00 00 00 HEX 000000 1665 b52d ;heofonfir_lucelia_layer1_6 1666 b52d 00 ab 00 HEX 00ab00 1667 b530 ;heofonfir_lucelia_layer1_6_tallsprite_00 1668 b530 10 6c 04 HEX 106c04 1669 b533 ;heofonfir_lucelia_layer1_6_tallsprite_01 1670 b533 00 00 00 HEX 000000 1671 b536 ;heofonfir_lucelia_layer1_7 1672 b536 00 28 00 HEX 002800 1673 b539 ;heofonfir_lucelia_layer1_7_tallsprite_00 1674 b539 00 6c 00 HEX 006c00 1675 b53c ;heofonfir_lucelia_layer1_7_tallsprite_01 1676 b53c 00 00 00 HEX 000000 1677 b53f ;heofonfir_lucelia_layer1_8 1678 b53f 00 00 00 HEX 000000 1679 b542 ;heofonfir_lucelia_layer1_8_tallsprite_00 1680 b542 00 ab 00 HEX 00ab00 1681 b545 ;heofonfir_lucelia_layer1_8_tallsprite_01 1682 b545 00 82 00 HEX 008200 1683 b548 ;heofonfir_lucelia_layer_2nofire_1 1684 b548 00 00 00 HEX 000000 1685 b54b ;heofonfir_lucelia_layer_2nofire_1_tallsprite_00 1686 b54b 00 00 00 HEX 000000 1687 b54e ;heofonfir_lucelia_layer_2nofire_1_tallsprite_01 1688 b54e 00 41 00 HEX 004100 1689 b551 ;heofonfir_lucelia_layer_2nofire_2 1690 b551 00 00 00 HEX 000000 1691 b554 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_00 1692 b554 00 00 00 HEX 000000 1693 b557 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_01 1694 b557 00 41 00 HEX 004100 1695 b55a ;heofonfir_lucelia_layer_2nofire_3 1696 b55a 00 00 00 HEX 000000 1697 b55d ;heofonfir_lucelia_layer_2nofire_3_tallsprite_00 1698 b55d 01 00 40 HEX 010040 1699 b560 ;heofonfir_lucelia_layer_2nofire_3_tallsprite_01 1700 b560 00 00 00 HEX 000000 1701 b563 ;heofonfir_lucelia_layer_2nofire_4 1702 b563 00 00 00 HEX 000000 1703 b566 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_00 1704 b566 01 00 40 HEX 010040 1705 b569 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_01 1706 b569 00 00 00 HEX 000000 1707 b56c ;heofonfir_lucelia_layer_2nofire_5 1708 b56c 00 00 00 HEX 000000 1709 b56f ;heofonfir_lucelia_layer_2nofire_5_tallsprite_00 1710 b56f 04 02 10 HEX 040210 1711 b572 ;heofonfir_lucelia_layer_2nofire_5_tallsprite_01 1712 b572 00 c3 00 HEX 00c300 1713 b575 ;heofonfir_lucelia_layer_2nofire_6 1714 b575 00 00 00 HEX 000000 1715 b578 ;heofonfir_lucelia_layer_2nofire_6_tallsprite_00 1716 b578 04 02 10 HEX 040210 1717 b57b ;heofonfir_lucelia_layer_2nofire_6_tallsprite_01 1718 b57b 00 00 00 HEX 000000 1719 b57e ;heofonfir_lucelia_layer_2nofire_7 1720 b57e 00 00 00 HEX 000000 1721 b581 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_00 1722 b581 04 02 10 HEX 040210 1723 b584 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_01 1724 b584 00 c3 00 HEX 00c300 1725 b587 ;heofonfir_lucelia_layer_2nofire_8 1726 b587 00 00 00 HEX 000000 1727 b58a ;heofonfir_lucelia_layer_2nofire_8_tallsprite_00 1728 b58a 01 00 40 HEX 010040 1729 b58d ;heofonfir_lucelia_layer_2nofire_8_tallsprite_01 1730 b58d 00 00 00 HEX 000000 1731 b590 1732 b600 ORG $B600,0 ; ************* 1733 b600 1734 b600 RORG $B600 ; ************* 1735 b600 1736 b600 ;heofonfir_lucelia_layer1_1 1737 b600 00 00 00 HEX 000000 1738 b603 ;heofonfir_lucelia_layer1_1_tallsprite_00 1739 b603 04 ab 10 HEX 04ab10 1740 b606 ;heofonfir_lucelia_layer1_1_tallsprite_01 1741 b606 00 00 00 HEX 000000 1742 b609 ;heofonfir_lucelia_layer1_2 1743 b609 00 00 00 HEX 000000 1744 b60c ;heofonfir_lucelia_layer1_2_tallsprite_00 1745 b60c 0a 1c a0 HEX 0a1ca0 1746 b60f ;heofonfir_lucelia_layer1_2_tallsprite_01 1747 b60f 00 00 00 HEX 000000 1748 b612 ;heofonfir_lucelia_layer1_3 1749 b612 00 00 00 HEX 000000 1750 b615 ;heofonfir_lucelia_layer1_3_tallsprite_00 1751 b615 02 96 80 HEX 029680 1752 b618 ;heofonfir_lucelia_layer1_3_tallsprite_01 1753 b618 00 00 00 HEX 000000 1754 b61b ;heofonfir_lucelia_layer1_4 1755 b61b 00 00 00 HEX 000000 1756 b61e ;heofonfir_lucelia_layer1_4_tallsprite_00 1757 b61e 02 57 80 HEX 025780 1758 b621 ;heofonfir_lucelia_layer1_4_tallsprite_01 1759 b621 00 41 00 HEX 004100 1760 b624 ;heofonfir_lucelia_layer1_5 1761 b624 00 00 00 HEX 000000 1762 b627 ;heofonfir_lucelia_layer1_5_tallsprite_00 1763 b627 80 1c 02 HEX 801c02 1764 b62a ;heofonfir_lucelia_layer1_5_tallsprite_01 1765 b62a 00 41 00 HEX 004100 1766 b62d ;heofonfir_lucelia_layer1_6 1767 b62d 00 28 00 HEX 002800 1768 b630 ;heofonfir_lucelia_layer1_6_tallsprite_00 1769 b630 10 6c 04 HEX 106c04 1770 b633 ;heofonfir_lucelia_layer1_6_tallsprite_01 1771 b633 00 00 00 HEX 000000 1772 b636 ;heofonfir_lucelia_layer1_7 1773 b636 00 00 00 HEX 000000 1774 b639 ;heofonfir_lucelia_layer1_7_tallsprite_00 1775 b639 40 2c 01 HEX 402c01 1776 b63c ;heofonfir_lucelia_layer1_7_tallsprite_01 1777 b63c 00 82 00 HEX 008200 1778 b63f ;heofonfir_lucelia_layer1_8 1779 b63f 00 00 00 HEX 000000 1780 b642 ;heofonfir_lucelia_layer1_8_tallsprite_00 1781 b642 00 69 00 HEX 006900 1782 b645 ;heofonfir_lucelia_layer1_8_tallsprite_01 1783 b645 00 00 00 HEX 000000 1784 b648 ;heofonfir_lucelia_layer_2nofire_1 1785 b648 00 00 00 HEX 000000 1786 b64b ;heofonfir_lucelia_layer_2nofire_1_tallsprite_00 1787 b64b 00 00 00 HEX 000000 1788 b64e ;heofonfir_lucelia_layer_2nofire_1_tallsprite_01 1789 b64e 00 41 00 HEX 004100 1790 b651 ;heofonfir_lucelia_layer_2nofire_2 1791 b651 00 00 00 HEX 000000 1792 b654 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_00 1793 b654 00 00 00 HEX 000000 1794 b657 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_01 1795 b657 00 41 00 HEX 004100 1796 b65a ;heofonfir_lucelia_layer_2nofire_3 1797 b65a 00 00 00 HEX 000000 1798 b65d ;heofonfir_lucelia_layer_2nofire_3_tallsprite_00 1799 b65d 00 00 00 HEX 000000 1800 b660 ;heofonfir_lucelia_layer_2nofire_3_tallsprite_01 1801 b660 00 41 00 HEX 004100 1802 b663 ;heofonfir_lucelia_layer_2nofire_4 1803 b663 00 00 00 HEX 000000 1804 b666 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_00 1805 b666 01 00 40 HEX 010040 1806 b669 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_01 1807 b669 00 00 00 HEX 000000 1808 b66c ;heofonfir_lucelia_layer_2nofire_5 1809 b66c 00 00 00 HEX 000000 1810 b66f ;heofonfir_lucelia_layer_2nofire_5_tallsprite_00 1811 b66f 01 00 40 HEX 010040 1812 b672 ;heofonfir_lucelia_layer_2nofire_5_tallsprite_01 1813 b672 00 00 00 HEX 000000 1814 b675 ;heofonfir_lucelia_layer_2nofire_6 1815 b675 00 00 00 HEX 000000 1816 b678 ;heofonfir_lucelia_layer_2nofire_6_tallsprite_00 1817 b678 04 02 10 HEX 040210 1818 b67b ;heofonfir_lucelia_layer_2nofire_6_tallsprite_01 1819 b67b 00 c3 00 HEX 00c300 1820 b67e ;heofonfir_lucelia_layer_2nofire_7 1821 b67e 00 00 00 HEX 000000 1822 b681 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_00 1823 b681 01 00 40 HEX 010040 1824 b684 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_01 1825 b684 00 00 00 HEX 000000 1826 b687 ;heofonfir_lucelia_layer_2nofire_8 1827 b687 00 00 00 HEX 000000 1828 b68a ;heofonfir_lucelia_layer_2nofire_8_tallsprite_00 1829 b68a 00 00 00 HEX 000000 1830 b68d ;heofonfir_lucelia_layer_2nofire_8_tallsprite_01 1831 b68d 00 41 00 HEX 004100 1832 b690 1833 b700 ORG $B700,0 ; ************* 1834 b700 1835 b700 RORG $B700 ; ************* 1836 b700 1837 b700 ;heofonfir_lucelia_layer1_1 1838 b700 00 00 00 HEX 000000 1839 b703 ;heofonfir_lucelia_layer1_1_tallsprite_00 1840 b703 04 af 10 HEX 04af10 1841 b706 ;heofonfir_lucelia_layer1_1_tallsprite_01 1842 b706 00 55 00 HEX 005500 1843 b709 ;heofonfir_lucelia_layer1_2 1844 b709 00 00 00 HEX 000000 1845 b70c ;heofonfir_lucelia_layer1_2_tallsprite_00 1846 b70c 20 57 08 HEX 205708 1847 b70f ;heofonfir_lucelia_layer1_2_tallsprite_01 1848 b70f 00 00 00 HEX 000000 1849 b712 ;heofonfir_lucelia_layer1_3 1850 b712 00 00 00 HEX 000000 1851 b715 ;heofonfir_lucelia_layer1_3_tallsprite_00 1852 b715 00 1c 00 HEX 001c00 1853 b718 ;heofonfir_lucelia_layer1_3_tallsprite_01 1854 b718 00 00 00 HEX 000000 1855 b71b ;heofonfir_lucelia_layer1_4 1856 b71b 00 00 00 HEX 000000 1857 b71e ;heofonfir_lucelia_layer1_4_tallsprite_00 1858 b71e 00 96 00 HEX 009600 1859 b721 ;heofonfir_lucelia_layer1_4_tallsprite_01 1860 b721 00 00 00 HEX 000000 1861 b724 ;heofonfir_lucelia_layer1_5 1862 b724 00 00 00 HEX 000000 1863 b727 ;heofonfir_lucelia_layer1_5_tallsprite_00 1864 b727 28 57 28 HEX 285728 1865 b72a ;heofonfir_lucelia_layer1_5_tallsprite_01 1866 b72a 00 41 00 HEX 004100 1867 b72d ;heofonfir_lucelia_layer1_6 1868 b72d 00 00 00 HEX 000000 1869 b730 ;heofonfir_lucelia_layer1_6_tallsprite_00 1870 b730 10 2c 04 HEX 102c04 1871 b733 ;heofonfir_lucelia_layer1_6_tallsprite_01 1872 b733 00 82 00 HEX 008200 1873 b736 ;heofonfir_lucelia_layer1_7 1874 b736 00 00 00 HEX 000000 1875 b739 ;heofonfir_lucelia_layer1_7_tallsprite_00 1876 b739 40 ab 01 HEX 40ab01 1877 b73c ;heofonfir_lucelia_layer1_7_tallsprite_01 1878 b73c 00 82 00 HEX 008200 1879 b73f ;heofonfir_lucelia_layer1_8 1880 b73f 00 00 00 HEX 000000 1881 b742 ;heofonfir_lucelia_layer1_8_tallsprite_00 1882 b742 01 2c 40 HEX 012c40 1883 b745 ;heofonfir_lucelia_layer1_8_tallsprite_01 1884 b745 00 00 00 HEX 000000 1885 b748 ;heofonfir_lucelia_layer_2nofire_1 1886 b748 00 00 00 HEX 000000 1887 b74b ;heofonfir_lucelia_layer_2nofire_1_tallsprite_00 1888 b74b 00 00 00 HEX 000000 1889 b74e ;heofonfir_lucelia_layer_2nofire_1_tallsprite_01 1890 b74e 00 00 00 HEX 000000 1891 b751 ;heofonfir_lucelia_layer_2nofire_2 1892 b751 00 00 00 HEX 000000 1893 b754 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_00 1894 b754 00 00 00 HEX 000000 1895 b757 ;heofonfir_lucelia_layer_2nofire_2_tallsprite_01 1896 b757 00 41 00 HEX 004100 1897 b75a ;heofonfir_lucelia_layer_2nofire_3 1898 b75a 00 00 00 HEX 000000 1899 b75d ;heofonfir_lucelia_layer_2nofire_3_tallsprite_00 1900 b75d 00 00 00 HEX 000000 1901 b760 ;heofonfir_lucelia_layer_2nofire_3_tallsprite_01 1902 b760 00 41 00 HEX 004100 1903 b763 ;heofonfir_lucelia_layer_2nofire_4 1904 b763 00 00 00 HEX 000000 1905 b766 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_00 1906 b766 00 00 00 HEX 000000 1907 b769 ;heofonfir_lucelia_layer_2nofire_4_tallsprite_01 1908 b769 00 41 00 HEX 004100 1909 b76c ;heofonfir_lucelia_layer_2nofire_5 1910 b76c 00 00 00 HEX 000000 1911 b76f ;heofonfir_lucelia_layer_2nofire_5_tallsprite_00 1912 b76f 01 00 40 HEX 010040 1913 b772 ;heofonfir_lucelia_layer_2nofire_5_tallsprite_01 1914 b772 00 00 00 HEX 000000 1915 b775 ;heofonfir_lucelia_layer_2nofire_6 1916 b775 00 00 00 HEX 000000 1917 b778 ;heofonfir_lucelia_layer_2nofire_6_tallsprite_00 1918 b778 01 00 40 HEX 010040 1919 b77b ;heofonfir_lucelia_layer_2nofire_6_tallsprite_01 1920 b77b 00 00 00 HEX 000000 1921 b77e ;heofonfir_lucelia_layer_2nofire_7 1922 b77e 00 00 00 HEX 000000 1923 b781 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_00 1924 b781 01 00 40 HEX 010040 1925 b784 ;heofonfir_lucelia_layer_2nofire_7_tallsprite_01 1926 b784 00 00 00 HEX 000000 1927 b787 ;heofonfir_lucelia_layer_2nofire_8 1928 b787 00 00 00 HEX 000000 1929 b78a ;heofonfir_lucelia_layer_2nofire_8_tallsprite_00 1930 b78a 00 00 00 HEX 000000 1931 b78d ;heofonfir_lucelia_layer_2nofire_8_tallsprite_01 1932 b78d 00 41 00 HEX 004100 1933 b790 1934 b800 ORG $B800,0 ; ************* 1935 b800 1936 b800 RORG $B800 ; ************* 1937 b800 - if SPACEOVERFLOW > 0 1938 b800 - echo "" 1939 b800 - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 1940 b800 - echo "######## look above for areas with negative ROM space left." 1941 b800 - echo "######## Aborting assembly." 1942 b800 - ERR 1943 b800 endif 1944 b800 1945 b800 1946 b800 ; Provided under the CC0 license. See the included LICENSE.txt for details. 1947 b800 1948 b800 - ifnconst bankswitchmode 1949 b800 - if ( * < $f000 ) 1950 b800 - ORG $F000 1951 b800 - endif 1952 b800 else 1953 b800 ifconst ROM128K 1954 b800 if ( * < $f000 ) 1955 27000 ORG $27000 1956 27000 RORG $F000 1957 27000 endif 1958 27000 endif 1959 27000 - ifconst ROM144K 1960 27000 - if ( * < $f000 ) 1961 27000 - ORG $27000 1962 27000 - RORG $F000 1963 27000 - endif 1964 27000 endif 1965 27000 - ifconst ROM256K 1966 27000 - if ( * < $f000 ) 1967 27000 - ORG $47000 1968 27000 - RORG $F000 1969 27000 - endif 1970 27000 endif 1971 27000 - ifconst ROM272K 1972 27000 - if ( * < $f000 ) 1973 27000 - ORG $47000 1974 27000 - RORG $F000 1975 27000 - endif 1976 27000 endif 1977 27000 - ifconst ROM512K 1978 27000 - if ( * < $f000 ) 1979 27000 - ORG $87000 1980 27000 - RORG $F000 1981 27000 - endif 1982 27000 endif 1983 27000 - ifconst ROM528K 1984 27000 - if ( * < $f000 ) 1985 27000 - ORG $87000 1986 27000 - RORG $F000 1987 27000 - endif 1988 27000 endif 1989 27000 endif 1990 27000 1991 27000 ; all of these "modules" have conditional clauses in them, so even though 1992 27000 ; they're always included here, they don't take up rom unless the user 1993 27000 ; explicitly enables support for the feature. 1994 27000 1995 27000 ifnconst included.7800vox.asm ------- FILE 7800vox.asm LEVEL 2 PASS 3 0 27000 include 7800vox.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 ; AtariVox 7800basic wrapper 4 27000 5 27000 ; to be called with 6 27000 ; A=# of bytes 7 27000 ; 8 27000 9 27000 - ifconst HSSUPPORT 10 27000 - 11 27000 -AVoxReadBytes 12 27000 - sta temp8 13 27000 - jsr i2c_startwrite 14 27000 - bcs eeprom_error 15 27000 - 16 27000 - lda HSVoxHi 17 27000 - jsr i2c_txbyte 18 27000 - lda HSVoxLo 19 27000 - jsr i2c_txbyte 20 27000 - jsr i2c_stopwrite 21 27000 - 22 27000 - jsr i2c_startread 23 27000 - 24 27000 - ldx #0 25 27000 -AVoxReadBytesLoop 26 27000 - jsr i2c_rxbyte 27 27000 - sta eeprombuffer,x 28 27000 - inx 29 27000 - cpx temp8 30 27000 - bne AVoxReadBytesLoop 31 27000 - jsr i2c_stopread 32 27000 - lda #0 33 27000 - rts 34 27000 - 35 27000 - ; to be called with 36 27000 - ; A=# of bytes 37 27000 - ; 38 27000 - 39 27000 -AVoxWriteBytes 40 27000 - sta temp8 41 27000 - jsr i2c_startwrite 42 27000 - bcs eeprom_error 43 27000 - 44 27000 - lda HSVoxHi 45 27000 - jsr i2c_txbyte 46 27000 - lda HSVoxLo 47 27000 - jsr i2c_txbyte 48 27000 - 49 27000 - ldx #$00 50 27000 -AVoxWriteBytesLoop 51 27000 - lda eeprombuffer,x 52 27000 - jsr i2c_txbyte 53 27000 - inx 54 27000 - cpx temp8 55 27000 - bne AVoxWriteBytesLoop 56 27000 - jsr i2c_stopwrite 57 27000 - 58 27000 - lda #0 59 27000 - rts 60 27000 - 61 27000 -eeprom_error 62 27000 - lda #$ff 63 27000 - rts 64 27000 - 65 27000 -AVoxDetect 66 27000 - 67 27000 - jsr i2c_startwrite 68 27000 - bcs eeprom_error 69 27000 - lda #$30 70 27000 - jsr i2c_txbyte 71 27000 - lda #$00 72 27000 - jsr i2c_txbyte 73 27000 - jsr i2c_stopwrite 74 27000 - rts 75 27000 - 76 27000 - include "i2c7800.inc" 77 27000 - I2C_SUBS temp9 78 27000 - 79 27000 endif 80 27000 ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Lucelia_Movement_demo.bas.asm 1997 27000 endif 1998 27000 ifnconst included.pokeysound.asm ------- FILE pokeysound.asm LEVEL 2 PASS 3 0 27000 include pokeysound.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 4 27000 - ifconst pokeysupport 5 27000 - 6 27000 -pokeysoundmodulestart 7 27000 - 8 27000 -mutepokey 9 27000 - lda #0 10 27000 - ldy #7 11 27000 -mutepokeyloop 12 27000 - sta pokey1pointlo,y 13 27000 - sta (pokeybaselo),y 14 27000 - dey 15 27000 - bpl mutepokeyloop 16 27000 - rts 17 27000 - 18 27000 -checkpokeyplaying 19 27000 - ldx #6 20 27000 -checkpokeyplayingloop 21 27000 - lda pokey1pointlo,x 22 27000 - ora pokey1pointhi,x 23 27000 - beq pokeychannelinactive 24 27000 - jsr playpokeysfxA ; x=channel*2 25 27000 -pokeychannelinactive 26 27000 - dex 27 27000 - dex 28 27000 - bpl checkpokeyplayingloop 29 27000 - rts 30 27000 - 31 27000 -playpokeysfxA 32 27000 - txa 33 27000 - tay 34 27000 - lda pokey1tick,x 35 27000 - beq playpokeysfxAcont 36 27000 - sec 37 27000 - sbc #1 38 27000 - sta pokey1tick,x ; sound resolution is >1 frame, and we're mid-tock... 39 27000 - rts 40 27000 - 41 27000 -playpokeysfxAcont 42 27000 - lda pokey1frames,x ; set the frame countdown for this sound chunk 43 27000 - sta pokey1tick,x 44 27000 - 45 27000 - lda pokey1priority,x ; decrease the sound's priority if its non-zero 46 27000 - beq playpokeysfxAcont2 47 27000 - sec 48 27000 - sbc #1 49 27000 - sta pokey1priority,x 50 27000 -playpokeysfxAcont2 51 27000 - 52 27000 - ; *** FREQUENCY 53 27000 - lda (pokey1pointlo,x) 54 27000 - sta inttemp1 55 27000 - clc 56 27000 - adc pokey1offset,x ; take into account any pitch modification 57 27000 - sta (pokeybaselo),y ; PAUDF0,0 58 27000 - 59 27000 - ;advance the data pointer +1 60 27000 - inc pokey1pointlo,x 61 27000 - bne skippokeyhiinc1 62 27000 - inc pokey1pointhi,x 63 27000 -skippokeyhiinc1 64 27000 - 65 27000 - ; *** WAVE 66 27000 - lda (pokey1pointlo,x) 67 27000 - asl 68 27000 - asl 69 27000 - asl 70 27000 - asl ; x16 71 27000 - 72 27000 - ;advance the data pointer +1 73 27000 - inc pokey1pointlo,x 74 27000 - bne skippokeyhiinc2 75 27000 - inc pokey1pointhi,x 76 27000 -skippokeyhiinc2 77 27000 - 78 27000 - ora (pokey1pointlo,x) 79 27000 - iny 80 27000 - sta (pokeybaselo),y 81 27000 - 82 27000 - ora inttemp1 ; check if F|C|V=0 83 27000 - beq zeropokeypoint ; if so, we're at the end of the sound. 84 27000 - 85 27000 - ; advance the pointer +1, on to the next sound chunk 86 27000 - inc pokey1pointlo,x 87 27000 - bne skippokeyhiinc3 88 27000 - inc pokey1pointhi,x 89 27000 -skippokeyhiinc3 90 27000 - rts 91 27000 - 92 27000 -zeropokeypoint 93 27000 - sta pokey1pointlo,x 94 27000 - sta pokey1pointhi,x 95 27000 - sta pokey1priority,x 96 27000 - rts 97 27000 - 98 27000 -schedulepokeysfx 99 27000 - ldx #6 100 27000 -schedulepokeysfxloop 101 27000 - lda pokey1pointlo,x 102 27000 - ora pokey1pointhi,x 103 27000 - bne schedulespokeysearch 104 27000 - jmp schedulepokeyX ; we found an unused channel, so use it... 105 27000 -schedulespokeysearch 106 27000 - dex 107 27000 - dex 108 27000 - bpl schedulepokeysfxloop 109 27000 - 110 27000 - ; if we're here, all 4 channels are presently playing a sound... 111 27000 - ldy #1 112 27000 - lda (sfxinstrumentlo),y ; peek at the priority of this sfx... 113 27000 - bne schedulepokeysfxcont1 114 27000 - rts ; ...and skip it if it's 0 priority 115 27000 -schedulepokeysfxcont1 116 27000 - 117 27000 - ; figure out which current sound has the lowest priority... 118 27000 - lda #0 119 27000 - sta temp8 120 27000 - lda pokey1priority 121 27000 - sta temp9 122 27000 - ldx #6 123 27000 -findlowprioritypokeyloop 124 27000 - lda pokey1priority,x 125 27000 - cmp temp9 126 27000 - bcs findlowprioritypokeyloopcontinue 127 27000 - sta temp9 128 27000 - stx temp8 129 27000 -findlowprioritypokeyloopcontinue 130 27000 - dex 131 27000 - dex 132 27000 - bne findlowprioritypokeyloop 133 27000 - ldx temp8 ; the low priority channel we'll interrupt 134 27000 - 135 27000 -schedulepokeyX 136 27000 - ;called with X=2*pokey channel to play on... 137 27000 - ldy #1 ; get priority and sound-resolution (in frames) 138 27000 - lda (sfxinstrumentlo),y 139 27000 - sta pokey1priority,x 140 27000 - iny 141 27000 - lda (sfxinstrumentlo),y 142 27000 - sta pokey1frames,x 143 27000 - 144 27000 - lda sfxinstrumentlo 145 27000 - clc 146 27000 - adc #3 147 27000 - sta pokey1pointlo,x 148 27000 - lda sfxinstrumenthi 149 27000 - adc #0 150 27000 - sta pokey1pointhi,x 151 27000 - lda temp3 152 27000 - sta pokey1offset,x 153 27000 - lda #0 154 27000 - sta pokey1tick,x 155 27000 - rts 156 27000 - 157 27000 - ; pokey detection routine. we check for pokey in the XBOARD/XM location, 158 27000 - ; and the standard $4000 location. 159 27000 - ; if pokey the pokey is present, this routine will reset it. 160 27000 - 161 27000 -detectpokeylocation 162 27000 - ;XBoard/XM... 163 27000 - ldx #2 164 27000 -detectpokeyloop 165 27000 - lda XCTRL1s 166 27000 - ora #%00010100 167 27000 - and POKEYXMMASK,x 168 27000 - sta XCTRL1s 169 27000 - sta XCTRL1 170 27000 - 171 27000 - lda POKEYCHECKLO,x 172 27000 - sta pokeybaselo 173 27000 - lda POKEYCHECKHI,x 174 27000 - sta pokeybasehi 175 27000 - jsr checkforpokey 176 27000 - lda pokeydetected 177 27000 - beq foundpokeychip 178 27000 - dex 179 27000 - bpl detectpokeyloop 180 27000 -foundpokeychip 181 27000 - eor #$ff ; invert state for 7800basic if...then test 182 27000 - sta pokeydetected 183 27000 - rts 184 27000 - 185 27000 -POKEYXMMASK 186 27000 - ; XM POKEY on XM POKEY off XM POKEY off 187 27000 - .byte %11111111, %11101111, %11101111 188 27000 - 189 27000 -POKEYCHECKLO 190 27000 - .byte <$0450, <$0450, <$4000 191 27000 -POKEYCHECKHI 192 27000 - .byte >$0450, >$0450, >$4000 193 27000 - 194 27000 -checkforpokey 195 27000 - ldy #$0f 196 27000 - lda #$00 197 27000 - sta pokeydetected ; start off by assuming pokey will be detected 198 27000 -resetpokeyregistersloop 199 27000 - sta (pokeybase),y 200 27000 - dey 201 27000 - bpl resetpokeyregistersloop 202 27000 - 203 27000 - ldy #PAUDCTL 204 27000 - sta (pokeybase),y 205 27000 - ldy #PSKCTL 206 27000 - sta (pokeybase),y 207 27000 - 208 27000 - ; let the dust settle... 209 27000 - nop 210 27000 - nop 211 27000 - nop 212 27000 - 213 27000 - lda #4 214 27000 - sta temp9 215 27000 -pokeycheckloop1 216 27000 - ; we're in reset, so the RANDOM register should read $ff... 217 27000 - ldy #PRANDOM 218 27000 - lda (pokeybase),y 219 27000 - cmp #$ff 220 27000 - bne nopokeydetected 221 27000 - dec temp9 222 27000 - bne pokeycheckloop1 223 27000 - 224 27000 - ; take pokey out of reset... 225 27000 - ldy #PSKCTL 226 27000 - lda #3 227 27000 - sta (pokeybase),y 228 27000 - ldy #PAUDCTL 229 27000 - lda #0 230 27000 - sta (pokeybase),y 231 27000 - 232 27000 - ; let the dust settle again... 233 27000 - nop 234 27000 - nop 235 27000 - nop 236 27000 - 237 27000 - lda #4 238 27000 - sta temp9 239 27000 -pokeycheckloop2 240 27000 - ; we're out of reset, so RANDOM should read non-$ff... 241 27000 - ldy #PRANDOM 242 27000 - lda (pokeybase),y 243 27000 - cmp #$ff 244 27000 - beq skippokeycheckreturn 245 27000 - rts 246 27000 -skippokeycheckreturn 247 27000 - dec temp9 248 27000 - bne pokeycheckloop2 249 27000 -nopokeydetected 250 27000 - dec pokeydetected ; pokeydetected=#$ff 251 27000 - rts 252 27000 - 253 27000 -pokeysoundmoduleend 254 27000 - 255 27000 - echo " pokeysound assembly: ",[(pokeysoundmoduleend-pokeysoundmodulestart)]d," bytes" 256 27000 - 257 27000 endif ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Lucelia_Movement_demo.bas.asm 2000 27000 endif 2001 27000 ifnconst included.tracker.asm ------- FILE tracker.asm LEVEL 2 PASS 3 0 27000 include tracker.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 4 27000 - ifconst MUSICTRACKER 5 27000 - ; ** songtempo lists how many 256ths of a frame a 16th note lasts 6 27000 - ; ** the player operates on a 16th note grid. 7 27000 - 8 27000 -servicesongover 9 27000 - rts 10 27000 -servicesong 11 27000 - lda songtempo 12 27000 - beq servicesongover ; ** if song is off/paused then return 13 27000 -servicesongcontinue 14 27000 - lda sfxschedulelock 15 27000 - sta sfxschedulemissed 16 27000 - bne servicesongover 17 27000 - lda songtempo 18 27000 - clc 19 27000 - adc songtick ; add songtempo to songtick until it rolls over 20 27000 - sta songtick ; this is how we break away from 50/60Hz timing. 21 27000 - bcc servicesongover 22 27000 - ; ** if we're here a new 16th note has passed 23 27000 - ; ** check if a new note is due on any of the 4 channels 24 27000 -servicesongredo 25 27000 - ldx #3 26 27000 -checkchannelloop 27 27000 - dec songchannel1busywait,x 28 27000 - bpl carryoncheckingchannel 29 27000 - txa 30 27000 - pha ; save X for the loop 31 27000 - jsr processsongdata 32 27000 - pla ; restore X for the loop 33 27000 - tax 34 27000 -carryoncheckingchannel 35 27000 - dex 36 27000 - bpl checkchannelloop 37 27000 - lda inactivechannelcount 38 27000 - cmp #15 39 27000 - bne skipstopsong 40 27000 - lda songloops 41 27000 - bne doasongloop 42 27000 - ;lda #0 43 27000 - sta songtempo ; all channels are done. stop the song 44 27000 - rts 45 27000 -doasongloop 46 27000 - bmi skipsongloopadjust 47 27000 - dec songloops 48 27000 -skipsongloopadjust 49 27000 - jsr setsongchannels 50 27000 - jmp servicesongredo 51 27000 -skipstopsong 52 27000 - rts 53 27000 - 54 27000 -processsongdata 55 27000 - ; channel needs processing 56 27000 - ; X=channel # 57 27000 - 58 27000 - txa 59 27000 - clc 60 27000 - adc songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 61 27000 - tay 62 27000 - 63 27000 - 64 27000 - ; ** indirect x is cumbersome with mult-byte commands. 65 27000 - ; ** setup a pointer to the song data for indirect y addressing. 66 27000 - lda songchannel1layer1lo,y 67 27000 - sta songdatalo 68 27000 - lda songchannel1layer1hi,y 69 27000 - sta songdatahi 70 27000 - ora songdatalo 71 27000 - bne channelhasdata 72 27000 - ;channel data is pointing at $0000 73 27000 - lda #$7F 74 27000 - sta songchannel1busywait,x ; skip a bunch of notes 75 27000 -setchannelcountbits 76 27000 - lda channel2bits,x 77 27000 - ora inactivechannelcount 78 27000 - sta inactivechannelcount 79 27000 - rts 80 27000 -channelhasdata 81 27000 - 82 27000 - sty songstackindex 83 27000 - ldy #0 84 27000 - lda (songdatalo),y ; ** load in the next byte of song data, so we can decode it 85 27000 - cmp #$ff 86 27000 - bne carryoncheckingdatatype ; ** $ff=pattern end marker 87 27000 - jmp handlechannelEOD 88 27000 - 89 27000 -carryoncheckingdatatype 90 27000 - and #$F0 91 27000 - cmp #$C0 92 27000 - beq handlechannelrest ; 0000XXXX=rest 93 27000 - cmp #$F0 94 27000 - beq handlemultibytecommand 95 27000 - cmp #$D0 96 27000 - beq handlesemiup 97 27000 - cmp #$E0 98 27000 - beq handlesemidown 99 27000 -handlenotedata 100 27000 - ; ** TODO: note playing is a terrible choice for fall-through 101 27000 - 102 27000 - ; ** its simple note data, prepare arguments for schedulesfx 103 27000 - 104 27000 - ; ** set the note length 105 27000 - lda (songdatalo),y 106 27000 - and #$0F 107 27000 - sta songchannel1busywait,x 108 27000 - 109 27000 - ; ** load the instrument 110 27000 - lda songchannel1instrumentlo,x 111 27000 - sta sfxinstrumentlo 112 27000 - lda songchannel1instrumenthi,x 113 27000 - sta sfxinstrumenthi 114 27000 - 115 27000 - ; ** get the note, and transpose 116 27000 - lda (songdatalo),y 117 27000 - lsr 118 27000 - lsr 119 27000 - lsr 120 27000 - lsr 121 27000 - clc 122 27000 - adc songchannel1transpose,x ; ** add it to the transpose index 123 27000 - ; ** its up the respective SFX scheduler to handle and save the note data 124 27000 - sta sfxnoteindex 125 27000 - 126 27000 - lda #0 127 27000 - sta sfxpitchoffset 128 27000 - 129 27000 - jsr schedulesfx 130 27000 - 131 27000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 132 27000 - 133 27000 -handlechannelrest 134 27000 - ; ** set the note length 135 27000 - lda (songdatalo),y 136 27000 - and #$0F 137 27000 - sta songchannel1busywait,x 138 27000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 139 27000 - 140 27000 -handlesemiup 141 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 142 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 143 27000 - clc 144 27000 -handlesemidownentry 145 27000 - adc songchannel1transpose,x ; ** add it to the transpose index 146 27000 - sta songchannel1transpose,x 147 27000 - jsr advancethesongpointer1byte 148 27000 - jmp processsongdata ; semi doesn't have note length, so process the next data byte... 149 27000 - 150 27000 -handlesemidown 151 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 152 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 153 27000 - eor #$ff ; ** its easier if we negate it, and then add it instead. 154 27000 - sec 155 27000 - jmp handlesemidownentry 156 27000 - 157 27000 -handlemultibytecommand 158 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 159 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 160 27000 - cmp #$08 ; ** load new instrument? 161 27000 - bne nothandleinstrumentchange 162 27000 -handleinstrumentchange 163 27000 - iny 164 27000 - lda (songdatalo),y 165 27000 - sta songchannel1instrumentlo,x 166 27000 - iny 167 27000 - lda (songdatalo),y 168 27000 - sta songchannel1instrumenthi,x 169 27000 - lda #3 170 27000 - jsr advancethesongpointerNbytes ; advance 3 bytes 171 27000 - jmp processsongdata 172 27000 - 173 27000 -nothandleinstrumentchange 174 27000 - cmp #$09 ; ** absolute tempo change? 175 27000 - bne nothandletempochange 176 27000 - lda #0 177 27000 - sta songtempo 178 27000 -handlerelativetempochange 179 27000 - iny 180 27000 - lda (songdatalo),y 181 27000 - clc 182 27000 - adc songtempo 183 27000 - sta songtempo 184 27000 - lda #2 185 27000 - jsr advancethesongpointerNbytes ; advance 2 bytes 186 27000 - jmp processsongdata 187 27000 - 188 27000 -nothandletempochange 189 27000 - cmp #$0A ; ** relative tempo change?: 190 27000 - beq handlerelativetempochange 191 27000 - cmp #$0B ; ** octave/semi change? 192 27000 - beq handleoctavesemichange 193 27000 -handlepatterndata 194 27000 - ; ** if we're here its a pattern/loop "subroutine" 195 27000 - ; ** move the channel's "stack" pointer and populate the new stack level 196 27000 - 197 27000 - lda #4 198 27000 - clc 199 27000 - adc songchannel1stackdepth,x 200 27000 - sta songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 201 27000 - 202 27000 - stx inttemp6 ; about to invalidate x. save it. 203 27000 - lda songstackindex 204 27000 - adc #4 205 27000 - tax 206 27000 - 207 27000 - lda (songdatalo),y 208 27000 - and #$7 209 27000 - sta songchannel1layer1loops,x 210 27000 - iny 211 27000 - lda (songdatalo),y 212 27000 - sta songchannel1layer1lo,x 213 27000 - iny 214 27000 - lda (songdatalo),y 215 27000 - sta songchannel1layer1hi,x 216 27000 - 217 27000 - ldx inttemp6 ; restore x with the channel # 218 27000 - 219 27000 - ; ** advance will operate on the old stack level, since we didn't store the updated songstackindex... 220 27000 - lda #3 221 27000 - jsr advancethesongpointerNbytes ; advance 3 bytes 222 27000 - 223 27000 - ; ** ...but the new stack level will be correctly picked up when we process the next byte. 224 27000 - jmp processsongdata 225 27000 - 226 27000 -handlechannelEOD 227 27000 - ; ** check if there are loops remaining on the pattern 228 27000 - stx inttemp6 229 27000 - ldx songstackindex 230 27000 - dec songchannel1layer1loops,x 231 27000 - bmi handlechannelEODnoloop 232 27000 - ; ** loops are remaining. set the pattern pointer to the pattern start, which is contained after the EOD 233 27000 - iny 234 27000 - lda (songdatalo),y 235 27000 - sta songchannel1layer1lo,x 236 27000 - iny 237 27000 - lda (songdatalo),y 238 27000 - sta songchannel1layer1hi,x 239 27000 - ldx inttemp6 240 27000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 241 27000 - 242 27000 -handlechannelEODnoloop 243 27000 - ; this pattern/loop is done playing. "pop" the stack 244 27000 - ldx inttemp6 245 27000 - lda songchannel1stackdepth,x 246 27000 - beq handlerootchannelEOD 247 27000 - sec 248 27000 - sbc #4 249 27000 - sta songchannel1stackdepth,x 250 27000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 251 27000 - 252 27000 -handlerootchannelEOD 253 27000 - ; this channel is done. point it to $ff data so we no longer process this channel. 254 27000 - lda #0 255 27000 - sta songchannel1layer1lo,x 256 27000 - sta songchannel1layer1hi,x 257 27000 - sta songchannel1busywait,x 258 27000 - jmp setchannelcountbits 259 27000 - rts 260 27000 - 261 27000 -nothandlepatternchange 262 27000 -handleoctavesemichange 263 27000 - iny 264 27000 - lda (songdatalo),y 265 27000 - sta songchannel1transpose,x 266 27000 - lda #2 267 27000 - jsr advancethesongpointerNbytes ; advance 2 bytes 268 27000 - jmp processsongdata 269 27000 - 270 27000 -advancethesongpointer1byte 271 27000 - txa 272 27000 - ldx songstackindex 273 27000 - inc songchannel1layer1lo,x 274 27000 - bne skiphiadvancethesongpointer1byte 275 27000 - inc songchannel1layer1hi,x 276 27000 -skiphiadvancethesongpointer1byte 277 27000 - tax 278 27000 - rts 279 27000 - 280 27000 -advancethesongpointerNbytes 281 27000 - ; entered with A=# of byte to advance 282 27000 - stx inttemp6 283 27000 - ldx songstackindex 284 27000 - clc 285 27000 - adc songchannel1layer1lo,x 286 27000 - sta songchannel1layer1lo,x 287 27000 - lda #0 288 27000 - adc songchannel1layer1hi,x 289 27000 - sta songchannel1layer1hi,x 290 27000 - ldx inttemp6 291 27000 - rts 292 27000 - 293 27000 -clearsongmemory 294 27000 - lda #0 295 27000 - ldx #(songchannel4instrumenthi-songchannel1layer1lo) 296 27000 -clearsongmemoryloop1 297 27000 - sta songchannel1layer1lo,x 298 27000 - dex 299 27000 - bpl clearsongmemoryloop1 300 27000 - 301 27000 - ldx #(songchannel4stackdepth-songchannel1layer1loops) 302 27000 -clearsongmemoryloop2 303 27000 - sta songchannel1layer1loops,x 304 27000 - dex 305 27000 - bpl clearsongmemoryloop2 306 27000 - 307 27000 - lda #$ff 308 27000 - ldx #3 309 27000 -clearsongmemoryloop3 310 27000 - sta songchannel1busywait,x 311 27000 - dex 312 27000 - bpl clearsongmemoryloop3 313 27000 - rts 314 27000 - 315 27000 -setsongchannels 316 27000 - jsr clearsongmemory 317 27000 - ldy #7 318 27000 - ldx #3 319 27000 -setsongchannelsloop 320 27000 - lda (songpointerlo),y 321 27000 - sta songchannel1layer1hi,x 322 27000 - dey 323 27000 - lda (songpointerlo),y 324 27000 - sta songchannel1layer1lo,x 325 27000 - dex 326 27000 - dey 327 27000 - bpl setsongchannelsloop 328 27000 - rts 329 27000 - 330 27000 -channel2bits 331 27000 - .byte 1,2,4,8 332 27000 - 333 27000 -tiatrackeroctavenotes 334 27000 - ifconst BUZZBASS 335 27000 -LOWC = 15 336 27000 - else 337 27000 -LOWC = 14 338 27000 - endif 339 27000 - ; ****** ELECTRONIC (0 to 11) 340 27000 - .byte LOWC,20 ; c0 16.1Hz 341 27000 - .byte LOWC,18 ; c#0 342 27000 - .byte LOWC,17 ; d0 343 27000 - .byte LOWC,16 ; d#0 344 27000 - .byte LOWC,15 ; e0 345 27000 - .byte LOWC,14 ; f0 (very off) 346 27000 - .byte LOWC,14 ; f#0 347 27000 - .byte LOWC,13 ; g0 348 27000 - .byte LOWC,12 ; g#0 349 27000 - .byte LOWC,11 ; a0 350 27000 - .byte LOWC,11 ; a#0 (very off) 351 27000 - .byte LOWC,10 ; b0 30.7Hz 352 27000 - 353 27000 - ; ****** SLIGHTLY BUZZY (12 to 23) 354 27000 - .byte 6,30 ; c1 32.7Hz 355 27000 - .byte 6,28 ; c#1 356 27000 - .byte 6,27 ; d1 357 27000 - .byte 6,25 ; d#1 358 27000 - .byte 6,24 ; e1 359 27000 - .byte 6,22 ; f1 360 27000 - .byte 6,21 ; f#1 361 27000 - .byte 6,20 ; g1 362 27000 - .byte 6,18 ; g#1 363 27000 - .byte 6,17 ; a1 364 27000 - .byte 6,16 ; a#1 365 27000 - .byte 6,15 ; b1 63.4Hz 366 27000 - 367 27000 - ; ****** BUZZY (24 to 39) 368 27000 - .byte 1,31 ; c2 65.5 369 27000 - .byte 1,30 ; c#2 67.6 370 27000 - .byte 1,27 ; d2 72.3 371 27000 - .byte 1,26 ; d#2 77.6 372 27000 - .byte 1,24 ; e2 373 27000 - .byte 1,23 ; f2 374 27000 - .byte 1,22 ; f#2 375 27000 - .byte 1,20 ; g2 376 27000 - .byte 1,19 ; g#2 377 27000 - .byte 1,18 ; a2 378 27000 - .byte 1,17 ; a#2 379 27000 - .byte 1,16 ; b2 380 27000 - .byte 1,15 ; c3 126.8Hz 381 27000 - .byte 1,14 ; c#3 382 27000 - .byte 1,13 ; d3 149.7Hz 383 27000 - .byte 1,12 ; d#3 161.2Hz (very off) 384 27000 - ; ****** PURE (40 to 71) - best key is A3 Major 385 27000 - .byte 12,31 ; e3 163.8Hz 386 27000 - .byte 12,29 ; f3 387 27000 - .byte 12,28 ; f#3 388 27000 - .byte 12,26 ; g3 389 27000 - .byte 12,24 ; g#3 390 27000 - .byte 12,23 ; a3 songs in key of A benefit from Perceptual Tuning 391 27000 - .byte 12,22 ; a#3 392 27000 - .byte 12,20 ; b3 393 27000 - .byte 12,19 ; c4 (middle C) 394 27000 - .byte 12,18 ; c#4 395 27000 - .byte 12,17 ; d4 396 27000 - .byte 12,16 ; d#4 397 27000 - .byte 12,15 ; e4 398 27000 - .byte 12,14 ; f4 399 27000 - .byte 12,13 ; f#4 400 27000 - .byte 12,12 ; g4 (very off) 401 27000 - .byte 12,12 ; g#4 402 27000 - .byte 12,11 ; a4 403 27000 - .byte 12,10 ; a#4 404 27000 - .byte 4,31 ; b4 405 27000 - .byte 4,29 ; c5 406 27000 - .byte 4,28 ; c#5 407 27000 - .byte 4,26 ; d5 408 27000 - .byte 4,24 ; d#5 409 27000 - .byte 4,23 ; e5 410 27000 - .byte 4,22 ; f5 411 27000 - .byte 4,20 ; f#5 412 27000 - .byte 4,19 ; g5 413 27000 - .byte 4,18 ; g#5 414 27000 - .byte 4,17 ; a5 415 27000 - .byte 4,16 ; a#5 416 27000 - .byte 4,15 ; b5 417 27000 - 418 27000 - ; ****** TUNED WIND (72 to 83) 419 27000 - .byte 8,30 ; c 420 27000 - .byte 8,28 ; c# 421 27000 - .byte 8,27 ; d 422 27000 - .byte 8,25 ; d# 423 27000 - .byte 8,24 ; e 424 27000 - .byte 8,22 ; f 425 27000 - .byte 8,21 ; f# 426 27000 - .byte 8,20 ; g 427 27000 - .byte 8,18 ; g# 428 27000 - .byte 8,17 ; a 429 27000 - .byte 8,16 ; a# 430 27000 - .byte 8,15 ; b 431 27000 - 432 27000 - include "tiadrumkit.asm" 433 27000 - 434 27000 endif ;MUSICTRACKER ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Lucelia_Movement_demo.bas.asm 2003 27000 endif 2004 27000 ifnconst included.hiscore.asm ------- FILE hiscore.asm LEVEL 2 PASS 3 0 27000 include hiscore.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 - ifconst HSSUPPORT 4 27000 -detectatarivoxeeprom 5 27000 -hiscoremodulestart 6 27000 - ; do a test to see if atarivox eeprom can be accessed, and save results 7 27000 - jsr AVoxDetect 8 27000 - eor #$ff ; invert for easy 7800basic if...then logic 9 27000 - sta avoxdetected 10 27000 - lda #$0 11 27000 - sta SWACNT 12 27000 - lda avoxdetected 13 27000 - rts 14 27000 - 15 27000 -detecthsc 16 27000 - ; check for the HSC ROM signature... 17 27000 - lda XCTRL1s 18 27000 - ora #%00001100 19 27000 - sta XCTRL1s 20 27000 - sta XCTRL1 21 27000 - lda $3900 22 27000 - eor #$C6 23 27000 - bne detecthscfail 24 27000 - lda $3904 25 27000 - eor #$FE 26 27000 - bne detecthscfail 27 27000 - ; check if it's initialized... 28 27000 - ldy #0 29 27000 - lda #$ff 30 27000 -checkhscinit 31 27000 - and $1000,y 32 27000 - dey 33 27000 - bpl checkhscinit 34 27000 - cmp #$ff 35 27000 - bne hscisalreadyinit 36 27000 - ; if we're here, we need to do a minimal HSC init... 37 27000 - ldy #$28 38 27000 -hscinitloop1 39 27000 - lda hscheader,y 40 27000 - sta $1000,y 41 27000 - dey 42 27000 - bpl hscinitloop1 43 27000 - ldy #$89 44 27000 - lda #$7F 45 27000 -hscinitloop2 46 27000 - sta $10B3,y 47 27000 - dey 48 27000 - cpy #$ff 49 27000 - bne hscinitloop2 50 27000 -hscisalreadyinit 51 27000 - lda #$ff 52 27000 - rts 53 27000 -hscheader 54 27000 - .byte $00,$00,$68,$83,$AA,$55,$9C,$FF,$07,$12,$02,$1F,$00,$00,$00,$00 55 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 56 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$03 57 27000 -detecthscfail 58 27000 - lda XCTRL1s 59 27000 - and #%11110111 60 27000 - sta XCTRL1s 61 27000 - lda #0 62 27000 - rts 63 27000 endif ; HSSUPPORT 64 27000 65 27000 - ifconst HSSUPPORT 66 27000 - ifnconst hiscorefont 67 27000 - echo "" 68 27000 - echo "WARNING: High score support is enabled, but the hiscorefont.png was" 69 27000 - echo " NOT imported with incgraphic. The high score display code" 70 27000 - echo " has been omitted from this build." 71 27000 - echo "" 72 27000 - else 73 27000 -hscdrawscreen 74 27000 - 75 27000 - ; we use 20 lines on a 24 line display 76 27000 - ; HSSCOREY to dynamically centers based on 77 27000 - ;HSSCOREY = 0 78 27000 -HSSCOREY = ((WZONECOUNT*WZONEHEIGHT/8)-22)/2 79 27000 -HSCURSORY = ((HSSCOREY/(WZONEHEIGHT/8))*WZONEHEIGHT) 80 27000 - 81 27000 - ifconst HSSCORESIZE 82 27000 -SCORESIZE = HSSCORESIZE 83 27000 - else 84 27000 -SCORESIZE = 6 85 27000 - endif 86 27000 - 87 27000 - ;save shadow registers for later return... 88 27000 - lda sCTRL 89 27000 - sta ssCTRL 90 27000 - lda sCHARBASE 91 27000 - sta ssCHARBASE 92 27000 - lda #$60 93 27000 - sta charactermode 94 27000 - jsr drawwait 95 27000 - jsr blacken320colors 96 27000 - jsr clearscreen 97 27000 - 98 27000 - ;set the character base to the HSC font 99 27000 - lda #>hiscorefont 100 27000 - sta CHARBASE 101 27000 - sta sCHARBASE 102 27000 - lda #%01000011 ;Enable DMA, mode=320A 103 27000 - sta CTRL 104 27000 - sta sCTRL 105 27000 - 106 27000 - lda #60 107 27000 - sta hsjoydebounce 108 27000 - 109 27000 - lda #0 110 27000 - sta hscursorx 111 27000 - sta framecounter 112 27000 - ifnconst HSCOLORCHASESTART 113 27000 - lda #$8D ; default is blue. why not? 114 27000 - else 115 27000 - lda #HSCOLORCHASESTART 116 27000 - endif 117 27000 - sta hscolorchaseindex 118 27000 - 119 27000 - lda #$0F 120 27000 - sta P0C2 ; base text is white 121 27000 - 122 27000 - jsr hschasecolors 123 27000 - ; ** plot all of the initials 124 27000 - lda #HSRAMInitials 127 27000 - sta temp2 ; charmaphi 128 27000 - lda #32+29 ; palette=0-29 | 32-(width=3) 129 27000 - sta temp3 ; palette/width 130 27000 - lda #104 131 27000 - sta temp4 ; X 132 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 133 27000 - sta temp5 ; Y 134 27000 -plothsinitialsloop 135 27000 - jsr plotcharacters 136 27000 - clc 137 27000 - lda temp3 138 27000 - adc #32 139 27000 - sta temp3 140 27000 - inc temp5 141 27000 - if WZONEHEIGHT = 8 142 27000 - inc temp5 143 27000 - endif 144 27000 - clc 145 27000 - lda #3 146 27000 - adc temp1 147 27000 - sta temp1 148 27000 - cmp #(<(HSRAMInitials+15)) 149 27000 - bcc plothsinitialsloop 150 27000 - 151 27000 - ifconst HSGAMENAMELEN 152 27000 - ;plot the game name... 153 27000 - lda #HSGAMENAMEtable 156 27000 - sta temp2 ; charmaphi 157 27000 - lda #(32-HSGAMENAMELEN) ; palette=0*29 | 32-(width=3) 158 27000 - sta temp3 ; palette/width 159 27000 - lda #(80-(HSGAMENAMELEN*2)) 160 27000 - sta temp4 ; X 161 27000 - lda #((HSSCOREY+0)/(WZONEHEIGHT/8)) 162 27000 - sta temp5 ; Y 163 27000 - jsr plotcharacters 164 27000 - endif ; HSGAMENAMELEN 165 27000 - 166 27000 - ;plot "difficulty"... 167 27000 - ldy gamedifficulty 168 27000 - ifnconst HSNOLEVELNAMES 169 27000 - lda highscoredifficultytextlo,y 170 27000 - sta temp1 171 27000 - lda highscoredifficultytexthi,y 172 27000 - sta temp2 173 27000 - sec 174 27000 - lda #32 175 27000 - sbc highscoredifficultytextlen,y 176 27000 - sta temp3 ; palette/width 177 27000 - sec 178 27000 - lda #40 179 27000 - sbc highscoredifficultytextlen,y 180 27000 - asl 181 27000 - sta temp4 ; X 182 27000 - else 183 27000 - lda #HSHIGHSCOREStext 186 27000 - sta temp2 ; charmaphi 187 27000 - lda #(32-11) ; palette=0*29 | 32-(width=3) 188 27000 - sta temp3 ; palette/width 189 27000 - lda #(80-(11*2)) 190 27000 - sta temp4 ; X 191 27000 - endif ; HSNOLEVELNAMES 192 27000 - 193 27000 - lda #((HSSCOREY+2)/(WZONEHEIGHT/8)) 194 27000 - sta temp5 ; Y 195 27000 - jsr plotcharacters 196 27000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 197 27000 - bne carronwithscoreevaluation 198 27000 - jmp donoscoreevaluation 199 27000 -carronwithscoreevaluation 200 27000 - dey 201 27000 - lda highscorelabeltextlo,y 202 27000 - sta temp1 203 27000 - lda highscorelabeltexthi,y 204 27000 - sta temp2 205 27000 - sec 206 27000 - lda #(32-15) ; palette=0*29 | 32-(width=3) 207 27000 - sta temp3 ; palette/width 208 27000 - lda highscorelabeladjust1,y 209 27000 - sta temp4 ; X 210 27000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 211 27000 - sta temp5 ; Y 212 27000 - jsr plotcharacters 213 27000 - 214 27000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 215 27000 - dey 216 27000 - ;plot the current player score... 217 27000 - lda #(32-SCORESIZE) ; palette=0*32 218 27000 - sta temp3 ; palette/width 219 27000 - lda highscorelabeladjust2,y 220 27000 - sta temp4 ; X 221 27000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 222 27000 - sta temp5 ; Y 223 27000 - 224 27000 - lda scorevarlo,y 225 27000 - sta temp7 ; score variable lo 226 27000 - lda scorevarhi,y 227 27000 - sta temp8 ; score variable hi 228 27000 - 229 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 230 27000 - sta temp9 231 27000 - 232 27000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 233 27000 - sta temp1 ; charmaplo 234 27000 - lda #>(hiscorefont+33) 235 27000 - sta temp2 ; charmaphi 236 27000 - lda #SCORESIZE 237 27000 - sta temp6 238 27000 - ifnconst DOUBLEWIDE 239 27000 - jsr plotvalue 240 27000 - else 241 27000 - jsr plotvaluedw 242 27000 - endif 243 27000 - 244 27000 -USED_PLOTVALUE = 1 ; ensure that plotvalue gets compiled in 245 27000 - 246 27000 - ifconst HSGAMERANKS 247 27000 - 248 27000 - ldx #$ff ; start at 0 after the inx... 249 27000 -comparescore2rankloop 250 27000 - inx 251 27000 - ldy #0 252 27000 - lda rankvalue_0,x 253 27000 - cmp (temp7),y 254 27000 - bcc score2rankloopdone 255 27000 - bne comparescore2rankloop 256 27000 - iny 257 27000 - lda rankvalue_1,x 258 27000 - cmp (temp7),y 259 27000 - bcc score2rankloopdone 260 27000 - bne comparescore2rankloop 261 27000 - iny 262 27000 - lda (temp7),y 263 27000 - cmp rankvalue_2,x 264 27000 - bcs score2rankloopdone 265 27000 - jmp comparescore2rankloop 266 27000 -score2rankloopdone 267 27000 - stx hsnewscorerank 268 27000 - 269 27000 - lda ranklabello,x 270 27000 - sta temp1 271 27000 - lda ranklabelhi,x 272 27000 - sta temp2 273 27000 - sec 274 27000 - lda #32 ; palette=0*29 | 32-(width=3) 275 27000 - sbc ranklabellengths,x 276 27000 - sta temp3 ; palette/width 277 27000 - sec 278 27000 - lda #(40+6) 279 27000 - sbc ranklabellengths,x 280 27000 - asl 281 27000 - sta temp4 ; X 282 27000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 283 27000 - sta temp5 ; Y 284 27000 - jsr plotcharacters 285 27000 - 286 27000 - ldx hsnewscorerank 287 27000 - 288 27000 - lda #highscoreranklabel 291 27000 - sta temp2 292 27000 - 293 27000 - lda #(32-5) ; palette=0*29 | 32-(width=3) 294 27000 - sta temp3 ; palette/width 295 27000 - lda #(40-6) 296 27000 - sec 297 27000 - sbc ranklabellengths,x 298 27000 - asl 299 27000 - sta temp4 ; X 300 27000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 301 27000 - sta temp5 ; Y 302 27000 - jsr plotcharacters 303 27000 - endif 304 27000 - 305 27000 - 306 27000 - ; ** which line did this player beat? 307 27000 - lda #$ff 308 27000 - sta hsnewscoreline 309 27000 - ldx #$fd 310 27000 -comparescoreadd2x 311 27000 - inx 312 27000 -comparescoreadd1x 313 27000 - inx 314 27000 -comparescore2lineloop 315 27000 - inc hsnewscoreline 316 27000 - inx ; initialrun, x=0 317 27000 - cpx #15 318 27000 - beq nohighscoreforyou 319 27000 - ldy #0 320 27000 - lda HSRAMScores,x 321 27000 - cmp (temp7),y ; first score digit 322 27000 - bcc score2lineloopdonedel1x 323 27000 - bne comparescoreadd2x 324 27000 - iny 325 27000 - inx 326 27000 - lda HSRAMScores,x 327 27000 - cmp (temp7),y 328 27000 - bcc score2lineloopdonedel2x 329 27000 - bne comparescoreadd1x 330 27000 - iny 331 27000 - inx 332 27000 - lda (temp7),y 333 27000 - cmp HSRAMScores,x 334 27000 - bcs score2lineloopdonedel3x 335 27000 - jmp comparescore2lineloop 336 27000 -nohighscoreforyou 337 27000 - lda #$ff 338 27000 - sta hsnewscoreline 339 27000 - sta countdownseconds 340 27000 - jmp donoscoreevaluation 341 27000 -score2lineloopdonedel3x 342 27000 - dex 343 27000 -score2lineloopdonedel2x 344 27000 - dex 345 27000 -score2lineloopdonedel1x 346 27000 - dex 347 27000 - 348 27000 - ; 0 1 2 349 27000 - ; 3 4 5 350 27000 - ; 6 7 8 351 27000 - ; 9 0 1 352 27000 - ; 2 3 4 353 27000 - 354 27000 - stx temp9 355 27000 - cpx #11 356 27000 - beq postsortscoresuploop 357 27000 - ldx #11 358 27000 -sortscoresuploop 359 27000 - lda HSRAMScores,x 360 27000 - sta HSRAMScores+3,x 361 27000 - lda HSRAMInitials,x 362 27000 - sta HSRAMInitials+3,x 363 27000 - dex 364 27000 - cpx temp9 365 27000 - bne sortscoresuploop 366 27000 -postsortscoresuploop 367 27000 - 368 27000 - ;stick the score and cleared initials in the slot... 369 27000 - inx 370 27000 - ldy #0 371 27000 - sty hsinitialhold 372 27000 - lda (temp7),y 373 27000 - sta HSRAMScores,x 374 27000 - iny 375 27000 - lda (temp7),y 376 27000 - sta HSRAMScores+1,x 377 27000 - iny 378 27000 - lda (temp7),y 379 27000 - sta HSRAMScores+2,x 380 27000 - lda #0 381 27000 - sta HSRAMInitials,x 382 27000 - lda #29 383 27000 - sta HSRAMInitials+1,x 384 27000 - sta HSRAMInitials+2,x 385 27000 - 386 27000 - stx hsinitialpos 387 27000 - 388 27000 - ifconst vox_highscore 389 27000 - lda <#vox_highscore 390 27000 - sta speech_addr 391 27000 - lda >#vox_highscore 392 27000 - sta speech_addr+1 393 27000 - endif 394 27000 - ifconst sfx_highscore 395 27000 - lda <#sfx_highscore 396 27000 - sta temp1 397 27000 - lda >#sfx_highscore 398 27000 - sta temp2 399 27000 - lda #0 400 27000 - sta temp3 401 27000 - jsr schedulesfx 402 27000 - endif 403 27000 - ifconst songdatastart_song_highscore 404 27000 - lda #songchanneltable_song_highscore 407 27000 - sta songpointerhi 408 27000 - lda #73 409 27000 - sta songtempo 410 27000 - jsr setsongchannels 411 27000 - endif 412 27000 - 413 27000 - 414 27000 -donoscoreevaluation 415 27000 - 416 27000 - lda #(32+(32-SCORESIZE)) ; palette=0*32 | 32-(width=6) 417 27000 - sta temp3 ; palette/width 418 27000 - lda #(72+(4*(6-SCORESIZE))) 419 27000 - sta temp4 ; X 420 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 421 27000 - sta temp5 ; Y 422 27000 - lda #HSRAMScores 425 27000 - sta temp8 ; score variable hi 426 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 427 27000 - sta temp9 428 27000 -plothsscoresloop 429 27000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 430 27000 - sta temp1 ; charmaplo 431 27000 - lda #>(hiscorefont+33) 432 27000 - sta temp2 ; charmaphi 433 27000 - lda #6 434 27000 - sta temp6 435 27000 - ifnconst DOUBLEWIDE 436 27000 - jsr plotvalue 437 27000 - else 438 27000 - jsr plotvaluedw 439 27000 - endif 440 27000 - clc 441 27000 - lda temp3 442 27000 - adc #32 443 27000 - sta temp3 444 27000 - inc temp5 445 27000 - if WZONEHEIGHT = 8 446 27000 - inc temp5 447 27000 - endif 448 27000 - clc 449 27000 - lda #3 450 27000 - adc temp7 451 27000 - sta temp7 452 27000 - cmp #(<(HSRAMScores+15)) 453 27000 - bcc plothsscoresloop 454 27000 -plothsindex 455 27000 - lda #32+31 ; palette=0*32 | 32-(width=1) 456 27000 - sta temp3 ; palette/width 457 27000 - lda #44 458 27000 - sta temp4 ; X 459 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 460 27000 - sta temp5 ; Y 461 27000 - lda #hsgameslotnumbers 464 27000 - sta temp8 ; score variable hi 465 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 466 27000 - sta temp9 467 27000 -plothsindexloop 468 27000 - lda #<(hiscorefont+33) 469 27000 - sta temp1 ; charmaplo 470 27000 - lda #>(hiscorefont+33) 471 27000 - sta temp2 ; charmaphi 472 27000 - lda #1 473 27000 - sta temp6 ; number of characters 474 27000 - ifnconst DOUBLEWIDE 475 27000 - jsr plotvalue 476 27000 - else 477 27000 - jsr plotvaluedw 478 27000 - endif 479 27000 - clc 480 27000 - lda temp3 481 27000 - adc #32 482 27000 - sta temp3 483 27000 - inc temp5 484 27000 - if WZONEHEIGHT = 8 485 27000 - inc temp5 486 27000 - endif 487 27000 - inc temp7 488 27000 - lda temp7 489 27000 - cmp #(<(hsgameslotnumbers+5)) 490 27000 - bcc plothsindexloop 491 27000 - 492 27000 - jsr savescreen 493 27000 - ifnconst HSSECONDS 494 27000 - lda #6 495 27000 - else 496 27000 - lda #HSSECONDS 497 27000 - endif 498 27000 - 499 27000 - sta countdownseconds 500 27000 - 501 27000 -keepdisplayinghs 502 27000 - jsr restorescreen 503 27000 - 504 27000 - jsr setuphsinpt1 505 27000 - 506 27000 - lda hsnewscoreline 507 27000 - bpl carryonkeepdisplayinghs 508 27000 - jmp skipenterscorecontrol 509 27000 -carryonkeepdisplayinghs 510 27000 - 511 27000 - 512 27000 - ifnconst HSSECONDS 513 27000 - lda #6 514 27000 - else 515 27000 - lda #HSSECONDS 516 27000 - endif 517 27000 - 518 27000 - sta countdownseconds 519 27000 - 520 27000 - ;plot the "cursor" initial sprite... 521 27000 - lda hsinitialhold 522 27000 - 523 27000 - sta temp1 524 27000 - lda #>(hiscorefont+32) 525 27000 - sta temp2 526 27000 - lda #31 ; palette=0*32 | 32-(width=1) 527 27000 - sta temp3 ; palette/width 528 27000 - lda hscursorx 529 27000 - asl 530 27000 - asl 531 27000 - clc 532 27000 - adc #104 533 27000 - sta temp4 ; X 534 27000 - lda hsnewscoreline 535 27000 - asl 536 27000 - asl 537 27000 - asl 538 27000 - asl 539 27000 - adc #((3*16)+HSCURSORY) 540 27000 - sta temp5 ; Y 541 27000 - lda #%01000000 542 27000 - sta temp6 543 27000 - jsr plotsprite 544 27000 - 545 27000 - ldx hscursorx 546 27000 - ldy hsdisplaymode 547 27000 - lda SWCHA 548 27000 - cpy #3 549 27000 - bne hsskipadjustjoystick1 550 27000 - asl 551 27000 - asl 552 27000 - asl 553 27000 - asl 554 27000 -hsskipadjustjoystick1 555 27000 - sta hsswcha 556 27000 - lda SWCHB 557 27000 - and #%00000010 558 27000 - bne hsskipselectswitch 559 27000 - lda #%00010000 560 27000 - sta hsswcha 561 27000 - bne hsdodebouncecheck 562 27000 -hsskipselectswitch 563 27000 - lda hsswcha 564 27000 - and #%00110000 565 27000 - cmp #%00110000 566 27000 - beq hsjoystickskipped 567 27000 -hsdodebouncecheck 568 27000 - lda hsjoydebounce 569 27000 - beq hsdontdebounce 570 27000 - jmp hspostjoystick 571 27000 -hsdontdebounce 572 27000 - ldx #1 ; small tick sound 573 27000 - jsr playhssfx 574 27000 - lda hsswcha 575 27000 - and #%00110000 576 27000 - ldx hscursorx 577 27000 - cmp #%00100000 ; check down 578 27000 - bne hsjoycheckup 579 27000 - ldy hsinitialhold 580 27000 - cpx #0 581 27000 - bne skipavoid31_1 582 27000 - cpy #0 ; if we're about to change to the <- char (#31) then double-decrement to skip over it 583 27000 - bne skipavoid31_1 584 27000 - dey 585 27000 -skipavoid31_1 586 27000 - dey 587 27000 - jmp hssetdebounce 588 27000 -hsjoycheckup 589 27000 - cmp #%00010000 ; check up 590 27000 - bne hsjoystickskipped 591 27000 - ldy hsinitialhold 592 27000 - cpx #0 593 27000 - bne skipavoid31_2 594 27000 - cpy #30 ; if we're about to change to the <- char (#31) then double-increment to skip over it 595 27000 - bne skipavoid31_2 596 27000 - iny 597 27000 -skipavoid31_2 598 27000 - iny 599 27000 -hssetdebounce 600 27000 - tya 601 27000 - and #31 602 27000 - sta hsinitialhold 603 27000 - lda #15 604 27000 - sta hsjoydebounce 605 27000 - bne hspostjoystick 606 27000 -hsjoystickskipped 607 27000 - ; check the fire button only when the stick isn't engaged 608 27000 - lda hsinpt1 609 27000 - bpl hsbuttonskipped 610 27000 - lda hsjoydebounce 611 27000 - beq hsfiredontdebounce 612 27000 - bne hspostjoystick 613 27000 -hsfiredontdebounce 614 27000 - lda hsinitialhold 615 27000 - cmp #31 616 27000 - beq hsmovecursorback 617 27000 - inc hscursorx 618 27000 - inc hsinitialpos 619 27000 - lda hscursorx 620 27000 - cmp #3 621 27000 - bne skiphsentryisdone 622 27000 - lda #0 623 27000 - sta framecounter 624 27000 - lda #$ff 625 27000 - sta hsnewscoreline 626 27000 - dec hsinitialpos 627 27000 - bne skiphsentryisdone 628 27000 -hsmovecursorback 629 27000 - lda hscursorx 630 27000 - beq skiphsmovecursorback 631 27000 - lda #29 632 27000 - ldx hsinitialpos 633 27000 - sta HSRAMInitials,x 634 27000 - dec hsinitialpos 635 27000 - dec hscursorx 636 27000 - dex 637 27000 - lda HSRAMInitials,x 638 27000 - sta hsinitialhold 639 27000 -skiphsmovecursorback 640 27000 -skiphsentryisdone 641 27000 - ldx #0 642 27000 - jsr playhssfx 643 27000 - lda #20 644 27000 - sta hsjoydebounce 645 27000 - bne hspostjoystick 646 27000 - 647 27000 -hsbuttonskipped 648 27000 - lda #0 649 27000 - sta hsjoydebounce 650 27000 -hspostjoystick 651 27000 - 652 27000 - ldx hsinitialpos 653 27000 - lda hsinitialhold 654 27000 - sta HSRAMInitials,x 655 27000 - 656 27000 - jmp skiphschasecolors 657 27000 - 658 27000 -skipenterscorecontrol 659 27000 - jsr hschasecolors 660 27000 - jsr setuphsinpt1 661 27000 - lda hsjoydebounce 662 27000 - bne skiphschasecolors 663 27000 - lda hsinpt1 664 27000 - bmi returnfromhs 665 27000 -skiphschasecolors 666 27000 - 667 27000 - jsr drawscreen 668 27000 - 669 27000 - lda countdownseconds 670 27000 - beq returnfromhs 671 27000 - jmp keepdisplayinghs 672 27000 -returnfromhs 673 27000 - 674 27000 - ifconst songdatastart_song_highscore 675 27000 - lda hsdisplaymode 676 27000 - beq skipclearHSCsong 677 27000 - lda #0 678 27000 - sta songtempo 679 27000 -skipclearHSCsong 680 27000 - endif 681 27000 - jsr drawwait 682 27000 - jsr clearscreen 683 27000 - lda #0 684 27000 - ldy #7 685 27000 - jsr blacken320colors 686 27000 - lda ssCTRL 687 27000 - sta sCTRL 688 27000 - lda ssCHARBASE 689 27000 - sta sCHARBASE 690 27000 - rts 691 27000 - 692 27000 -setuphsinpt1 693 27000 - lda #$ff 694 27000 - sta hsinpt1 695 27000 - lda hsjoydebounce 696 27000 - beq skipdebounceadjust 697 27000 - dec hsjoydebounce 698 27000 - bne skipstorefirebuttonstatus 699 27000 -skipdebounceadjust 700 27000 - lda SWCHB 701 27000 - and #%00000001 702 27000 - bne hscheckresetover 703 27000 - lda #$ff 704 27000 - sta hsinpt1 705 27000 - rts 706 27000 -hscheckresetover 707 27000 - ldx hsdisplaymode 708 27000 - cpx #3 709 27000 - bne hsskipadjustjoyfire1 710 27000 - lda sINPT3 711 27000 - jmp hsskipadjustjoyfire1done 712 27000 -hsskipadjustjoyfire1 713 27000 - lda sINPT1 714 27000 -hsskipadjustjoyfire1done 715 27000 - sta hsinpt1 716 27000 -skipstorefirebuttonstatus 717 27000 - rts 718 27000 - 719 27000 -blacken320colors 720 27000 - ldy #7 721 27000 -blacken320colorsloop 722 27000 - sta P0C2,y 723 27000 - dey 724 27000 - bpl blacken320colorsloop 725 27000 - rts 726 27000 - 727 27000 -hschasecolors 728 27000 - lda framecounter 729 27000 - and #3 730 27000 - bne hschasecolorsreturn 731 27000 - inc hscolorchaseindex 732 27000 - lda hscolorchaseindex 733 27000 - 734 27000 - sta P5C2 735 27000 - sbc #$02 736 27000 - sta P4C2 737 27000 - sbc #$02 738 27000 - sta P3C2 739 27000 - sbc #$02 740 27000 - sta P2C2 741 27000 - sbc #$02 742 27000 - sta P1C2 743 27000 -hschasecolorsreturn 744 27000 - rts 745 27000 - 746 27000 -playhssfx 747 27000 - lda hssfx_lo,x 748 27000 - sta temp1 749 27000 - lda hssfx_hi,x 750 27000 - sta temp2 751 27000 - lda #0 752 27000 - sta temp3 753 27000 - jmp schedulesfx 754 27000 - 755 27000 -hssfx_lo 756 27000 - .byte sfx_hsletterpositionchange, >sfx_hslettertick 759 27000 - 760 27000 -sfx_hsletterpositionchange 761 27000 - .byte $10,$18,$00 762 27000 - .byte $02,$06,$08 763 27000 - .byte $02,$06,$04 764 27000 - .byte $00,$00,$00 765 27000 -sfx_hslettertick 766 27000 - .byte $10,$18,$00 767 27000 - .byte $00,$00,$0a 768 27000 - .byte $00,$00,$00 769 27000 - 770 27000 -highscorelabeladjust1 771 27000 - .byte (80-(14*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)) 772 27000 -highscorelabeladjust2 773 27000 - .byte (80+(14*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)) 774 27000 - 775 27000 -scorevarlo 776 27000 - .byte <(score0+((6-SCORESIZE)/2)),<(score0+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)) 777 27000 -scorevarhi 778 27000 - .byte >(score0+((6-SCORESIZE)/2)),>(score0+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)) 779 27000 - 780 27000 - ifnconst HSNOLEVELNAMES 781 27000 -highscoredifficultytextlo 782 27000 - .byte easylevelname, >mediumlevelname, >hardlevelname, >expertlevelname 785 27000 - ifnconst HSCUSTOMLEVELNAMES 786 27000 -highscoredifficultytextlen 787 27000 - .byte 22, 30, 26, 24 788 27000 - 789 27000 -easylevelname 790 27000 - .byte $04,$00,$12,$18,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 791 27000 -mediumlevelname 792 27000 - .byte $08,$0d,$13,$04,$11,$0c,$04,$03,$08,$00,$13,$04,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 793 27000 -hardlevelname 794 27000 - .byte $00,$03,$15,$00,$0d,$02,$04,$03,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 795 27000 -expertlevelname 796 27000 - .byte $04,$17,$0f,$04,$11,$13,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 797 27000 - else 798 27000 - include "7800hsgamediffnames.asm" 799 27000 - endif ; HSCUSTOMLEVELNAMES 800 27000 - else 801 27000 -HSHIGHSCOREStext 802 27000 - .byte $07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 803 27000 - endif ; HSNOLEVELNAMES 804 27000 - 805 27000 -highscorelabeltextlo 806 27000 - .byte player0label, >player1label, >player2label, >player2label 809 27000 - 810 27000 -player0label 811 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$12,$02,$0e,$11,$04,$1a,$1d,$1d 812 27000 - 813 27000 -player1label 814 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$22,$1d,$12,$02,$0e,$11,$04,$1a 815 27000 - 816 27000 -player2label 817 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$23,$1d,$12,$02,$0e,$11,$04,$1a 818 27000 - 819 27000 - 820 27000 - ifconst HSGAMENAMELEN 821 27000 -HSGAMENAMEtable 822 27000 - include "7800hsgamename.asm" 823 27000 - endif 824 27000 - ifconst HSGAMERANKS 825 27000 - include "7800hsgameranks.asm" 826 27000 -highscoreranklabel 827 27000 - .byte $11,$00,$0d,$0a,$1a 828 27000 - endif 829 27000 - 830 27000 - ;ensure our table doesn't wrap a page... 831 27000 - if ((<*)>251) 832 27000 - align 256 833 27000 - endif 834 27000 -hsgameslotnumbers 835 27000 - .byte 33,34,35,36,37 836 27000 - endif 837 27000 - 838 27000 -loaddifficultytable 839 27000 - lda gamedifficulty 840 27000 - and #$03 ; ensure the user hasn't selected an invalid difficulty 841 27000 - sta gamedifficulty 842 27000 - cmp hsdifficulty ; check game difficulty is the same as RAM table 843 27000 - bne loaddifficultytablecontinue1 844 27000 - rts ; this high score difficulty table is already loaded 845 27000 -loaddifficultytablecontinue1 846 27000 - lda gamedifficulty 847 27000 - sta hsdifficulty 848 27000 - ;we need to check the device for the table 849 27000 - lda hsdevice 850 27000 - bne loaddifficultytablecontinue2 851 27000 - ; there's no save device. clear out this table. 852 27000 - jmp cleardifficultytablemem 853 27000 -loaddifficultytablecontinue2 854 27000 - lda hsdevice 855 27000 - and #1 856 27000 - beq memdeviceisntHSC 857 27000 - jmp loaddifficultytableHSC 858 27000 -memdeviceisntHSC 859 27000 - jmp loaddifficultytableAVOX 860 27000 - 861 27000 -savedifficultytable 862 27000 - ;*** we need to check wich device we should use... 863 27000 - lda hsdevice 864 27000 - bne savedifficultytablerealdevice 865 27000 - rts ; its a ram device 866 27000 -savedifficultytablerealdevice 867 27000 - and #1 868 27000 - beq savememdeviceisntHSC 869 27000 - jmp savedifficultytableHSC 870 27000 -savememdeviceisntHSC 871 27000 - jmp savedifficultytableAVOX 872 27000 - 873 27000 -savedifficultytableAVOX 874 27000 - ; the load call already setup the memory structure and atarivox memory location 875 27000 - jsr savealoadedHSCtablecontinue 876 27000 -savedifficultytableAVOXskipconvert 877 27000 - lda #HSIDHI 878 27000 - sta eeprombuffer 879 27000 - lda #HSIDLO 880 27000 - sta eeprombuffer+1 881 27000 - lda hsdifficulty 882 27000 - sta eeprombuffer+2 883 27000 - lda #32 884 27000 - jsr AVoxWriteBytes 885 27000 - rts 886 27000 - 887 27000 -savedifficultytableHSC 888 27000 - ;we always load a table before reaching here, so the 889 27000 - ;memory structures from the load should be intact... 890 27000 - ldy hsgameslot 891 27000 - bpl savealoadedHSCtable 892 27000 - rts 893 27000 -savealoadedHSCtable 894 27000 - lda HSCGameDifficulty,y 895 27000 - cmp #$7F 896 27000 - bne savealoadedHSCtablecontinue 897 27000 - jsr initializeHSCtableentry 898 27000 -savealoadedHSCtablecontinue 899 27000 - ;convert our RAM table to HSC format and write it out... 900 27000 - ldy #0 901 27000 - ldx #0 902 27000 -savedifficultytableScores 903 27000 - 904 27000 - lda HSRAMInitials,x 905 27000 - sta temp3 906 27000 - lda HSRAMInitials+1,x 907 27000 - sta temp4 908 27000 - lda HSRAMInitials+2,x 909 27000 - sta temp5 910 27000 - jsr encodeHSCInitials ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 911 27000 - 912 27000 - lda temp1 913 27000 - sta (HSGameTableLo),y 914 27000 - iny 915 27000 - lda temp2 916 27000 - sta (HSGameTableLo),y 917 27000 - iny 918 27000 - 919 27000 - lda HSRAMScores,x 920 27000 - sta (HSGameTableLo),y 921 27000 - iny 922 27000 - lda HSRAMScores+1,x 923 27000 - sta (HSGameTableLo),y 924 27000 - iny 925 27000 - lda HSRAMScores+2,x 926 27000 - sta (HSGameTableLo),y 927 27000 - iny 928 27000 - inx 929 27000 - inx 930 27000 - inx ; +3 931 27000 - cpx #15 932 27000 - bne savedifficultytableScores 933 27000 - rts 934 27000 - 935 27000 -loaddifficultytableHSC 936 27000 - ; routine responsible for loading the difficulty table from HSC 937 27000 - jsr findindexHSC 938 27000 - ldy hsgameslot 939 27000 - lda HSCGameDifficulty,y 940 27000 - cmp #$7F 941 27000 - bne loaddifficultytableHSCcontinue 942 27000 - ;there was an error. use a new RAM table instead... 943 27000 - jsr initializeHSCtableentry 944 27000 - jmp cleardifficultytablemem 945 27000 -loaddifficultytableHSCcontinue 946 27000 - ; parse the data into the HS memory... 947 27000 - ldy #0 948 27000 - ldx #0 949 27000 -loaddifficultytableScores 950 27000 - lda (HSGameTableLo),y 951 27000 - sta temp1 952 27000 - iny 953 27000 - lda (HSGameTableLo),y 954 27000 - sta temp2 955 27000 - jsr decodeHSCInitials ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 956 27000 - iny 957 27000 - lda (HSGameTableLo),y 958 27000 - sta HSRAMScores,x 959 27000 - lda temp3 960 27000 - sta HSRAMInitials,x 961 27000 - inx 962 27000 - iny 963 27000 - lda (HSGameTableLo),y 964 27000 - sta HSRAMScores,x 965 27000 - lda temp4 966 27000 - sta HSRAMInitials,x 967 27000 - inx 968 27000 - iny 969 27000 - lda (HSGameTableLo),y 970 27000 - sta HSRAMScores,x 971 27000 - lda temp5 972 27000 - sta HSRAMInitials,x 973 27000 - inx 974 27000 - iny 975 27000 - cpx #15 976 27000 - bne loaddifficultytableScores 977 27000 - rts 978 27000 - 979 27000 -decodeHSCInitials 980 27000 - ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 981 27000 - ; 2 bytes are packed in the form: 22211111 22_33333 982 27000 - lda #0 983 27000 - sta temp4 984 27000 - lda temp1 985 27000 - and #%00011111 986 27000 - sta temp3 987 27000 - 988 27000 - lda temp2 989 27000 - and #%00011111 990 27000 - sta temp5 991 27000 - 992 27000 - lda temp1 993 27000 - asl 994 27000 - rol temp4 995 27000 - asl 996 27000 - rol temp4 997 27000 - asl 998 27000 - rol temp4 999 27000 - lda temp2 1000 27000 - asl 1001 27000 - rol temp4 1002 27000 - asl 1003 27000 - rol temp4 1004 27000 - rts 1005 27000 -encodeHSCInitials 1006 27000 - ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 1007 27000 - ; 2 bytes are packed in the form: 22211111 22_33333 1008 27000 - ; start with packing temp1... 1009 27000 - lda temp4 1010 27000 - and #%00011100 1011 27000 - sta temp1 1012 27000 - asl temp1 1013 27000 - asl temp1 1014 27000 - asl temp1 1015 27000 - lda temp3 1016 27000 - and #%00011111 1017 27000 - ora temp1 1018 27000 - sta temp1 1019 27000 - ; ...temp1 is now packed, on to temp2... 1020 27000 - lda temp5 1021 27000 - asl 1022 27000 - asl 1023 27000 - ror temp4 1024 27000 - ror 1025 27000 - ror temp4 1026 27000 - ror 1027 27000 - sta temp2 1028 27000 - rts 1029 27000 - 1030 27000 -findindexHSCerror 1031 27000 - ;the HSC is stuffed. return the bad slot flag 1032 27000 - ldy #$ff 1033 27000 - sty hsgameslot 1034 27000 - rts 1035 27000 - 1036 27000 -findindexHSC 1037 27000 -HSCGameID1 = $1029 1038 27000 -HSCGameID2 = $106E 1039 27000 -HSCGameDifficulty = $10B3 1040 27000 -HSCGameIndex = $10F8 1041 27000 - ; routine responsible for finding the game index from HSC 1042 27000 - ; call with x=0 to create a new table if none exist, call with x=$ff to avoid creating new tables 1043 27000 - ; the HS loading routine will use x=$ff, the HS saving routine will use x=0 1044 27000 - ldy #69 ; start +1 to account for the dey 1045 27000 -findindexHSCloop 1046 27000 - dey 1047 27000 - bmi findindexHSCerror 1048 27000 - lda HSCGameDifficulty,y 1049 27000 - cmp #$7F 1050 27000 - beq findourindexHSC 1051 27000 - cmp gamedifficulty 1052 27000 - bne findindexHSCloop 1053 27000 - lda HSCGameID1,y 1054 27000 - cmp #HSIDHI 1055 27000 - bne findindexHSCloop 1056 27000 - lda HSCGameID2,y 1057 27000 - cmp #HSIDLO 1058 27000 - bne findindexHSCloop 1059 27000 -findourindexHSC 1060 27000 - ; if we're here we found our index in the table 1061 27000 - ; or we found the first empty one 1062 27000 - sty hsgameslot 1063 27000 - jsr setupHSCGamepointer ; setup the pointer to the HS Table for this game... 1064 27000 - rts 1065 27000 - 1066 27000 - 1067 27000 -initializeHSCtableentry 1068 27000 - ldy hsgameslot 1069 27000 - ; we need to make a new entry... 1070 27000 - lda #HSIDHI 1071 27000 - sta HSCGameID1,y 1072 27000 - lda #HSIDLO 1073 27000 - sta HSCGameID2,y 1074 27000 - lda gamedifficulty 1075 27000 - sta HSCGameDifficulty,y 1076 27000 - ldx #0 1077 27000 -fixHSDGameDifficultylistLoop 1078 27000 - inx 1079 27000 - txa 1080 27000 - sta HSCGameIndex,y 1081 27000 - iny 1082 27000 - cpy #69 1083 27000 - bne fixHSDGameDifficultylistLoop 1084 27000 - rts 1085 27000 - 1086 27000 -setupHSCGamepointer 1087 27000 - ; this routines sets (HSGameTableLo) pointing to the game's HS table 1088 27000 - lda #$17 1089 27000 - sta HSGameTableHi 1090 27000 - lda #$FA 1091 27000 - sta HSGameTableLo 1092 27000 -setupHSCGamepointerLoop 1093 27000 - lda HSGameTableLo 1094 27000 - sec 1095 27000 - sbc #25 1096 27000 - sta HSGameTableLo 1097 27000 - lda HSGameTableHi 1098 27000 - sbc #0 1099 27000 - sta HSGameTableHi 1100 27000 - iny 1101 27000 - cpy #69 1102 27000 - bne setupHSCGamepointerLoop 1103 27000 - rts 1104 27000 - 1105 27000 -loaddifficultytableAVOX 1106 27000 - ; routine responsible for loading the difficulty table from Avox 1107 27000 - ; we reuse HSC routines to format data to/from our Avox RAM buffer... 1108 27000 - lda #>(eeprombuffer+3) 1109 27000 - sta HSGameTableHi 1110 27000 - lda #<(eeprombuffer+3) 1111 27000 - sta HSGameTableLo 1112 27000 - 1113 27000 - ; the start location in EEPROM, subtract 32... 1114 27000 - lda #$5F 1115 27000 - sta HSVoxHi 1116 27000 - lda #$E0 1117 27000 - sta HSVoxLo 1118 27000 - lda #0 1119 27000 - sta temp1 1120 27000 -loaddifficultytableAVOXloop 1121 27000 - inc temp1 1122 27000 - beq loaddifficultytableAVOXfull 1123 27000 - clc 1124 27000 - lda HSVoxLo 1125 27000 - adc #32 1126 27000 - sta HSVoxLo 1127 27000 - lda HSVoxHi 1128 27000 - adc #0 1129 27000 - sta HSVoxHi 1130 27000 - lda #3 1131 27000 - jsr AVoxReadBytes ; read in 3 bytes, ID1,ID2,Difficulty 1132 27000 - lda eeprombuffer 1133 27000 - cmp #$FF 1134 27000 - beq loaddifficultytableAVOXempty 1135 27000 - cmp #HSIDHI 1136 27000 - bne loaddifficultytableAVOXloop 1137 27000 - lda eeprombuffer+1 1138 27000 - cmp #HSIDLO 1139 27000 - bne loaddifficultytableAVOXloop 1140 27000 - lda eeprombuffer+2 1141 27000 - cmp gamedifficulty 1142 27000 - bne loaddifficultytableAVOXloop 1143 27000 -loaddifficultytableAVOXdone 1144 27000 - lda #32 1145 27000 - jsr AVoxReadBytes 1146 27000 - jsr loaddifficultytableHSCcontinue 1147 27000 - rts 1148 27000 -loaddifficultytableAVOXfull 1149 27000 - lda #0 1150 27000 - sta hsdevice ; looks like all 255 entries are taken... disable it. 1151 27000 -loaddifficultytableAVOXempty 1152 27000 - jmp cleardifficultytablemem 1153 27000 - rts 1154 27000 - 1155 27000 -cleardifficultytablemem 1156 27000 - ldy #29 1157 27000 - lda #0 1158 27000 -cleardifficultytablememloop 1159 27000 - sta HSRAMTable,y 1160 27000 - dey 1161 27000 - bpl cleardifficultytablememloop 1162 27000 - rts 1163 27000 -hiscoremoduleend 1164 27000 - 1165 27000 - echo " hiscore assembly: ",[(hiscoremoduleend-hiscoremodulestart)]d," bytes" 1166 27000 - 1167 27000 - ifconst DOUBLEWIDE 1168 27000 -plotvaluedw 1169 27000 -plotdigitcount = temp6 1170 27000 - lda #0 1171 27000 - tay 1172 27000 - ldx valbufend 1173 27000 - 1174 27000 - lda plotdigitcount 1175 27000 - and #1 1176 27000 - beq pvnibble2chardw 1177 27000 - lda #0 1178 27000 - sta VALBUFFER,x ; just in case we skip this digit 1179 27000 - beq pvnibble2char_skipnibbledw 1180 27000 - 1181 27000 -pvnibble2chardw 1182 27000 - ; high nibble... 1183 27000 - lda (temp7),y 1184 27000 - and #$f0 1185 27000 - lsr 1186 27000 - lsr 1187 27000 - lsr 1188 27000 - lsr 1189 27000 - 1190 27000 - clc 1191 27000 - adc temp1 ; add the offset to character graphics to our value 1192 27000 - sta VALBUFFER,x 1193 27000 - inx 1194 27000 - dec plotdigitcount 1195 27000 -pvnibble2char_skipnibbledw 1196 27000 - ; low nibble... 1197 27000 - lda (temp7),y 1198 27000 - and #$0f 1199 27000 - clc 1200 27000 - adc temp1 ; add the offset to character graphics to our value 1201 27000 - sta VALBUFFER,x 1202 27000 - inx 1203 27000 - iny 1204 27000 - 1205 27000 - dec plotdigitcount 1206 27000 - bne pvnibble2chardw 1207 27000 - ;point to the start of our valuebuffer 1208 27000 - clc 1209 27000 - lda #VALBUFFER 1213 27000 - adc #0 1214 27000 - sta temp2 1215 27000 - 1216 27000 - ;advance valbufend to the end of our value buffer 1217 27000 - stx valbufend 1218 27000 - 1219 27000 - ifnconst plotvalueonscreen 1220 27000 - jmp plotcharacters 1221 27000 - else 1222 27000 - jmp plotcharacterslive 1223 27000 - endif 1224 27000 - endif ; DOUBLEWIDE 1225 27000 - 1226 27000 endif ; HSSUPPORT 1227 27000 ------- FILE c:\Users\Shane\Documents\my7800projects\Heofonfir\Lucelia_Movement_demo.bas.asm 2006 27000 endif 2007 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2008 27000 2009 27000 ;standard routimes needed for pretty much all games 2010 27000 2011 27000 ; some definitions used with "set debug color" 2012 27000 00 91 DEBUGCALC = $91 2013 27000 00 41 DEBUGWASTE = $41 2014 27000 00 c1 DEBUGDRAW = $C1 2015 27000 2016 27000 ;NMI and IRQ handlers 2017 27000 NMI 2018 27000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 2019 27000 48 pha ; save A 2020 27001 d8 cld 2021 27002 a5 4d lda visibleover 2022 27004 49 ff eor #255 2023 27006 85 4d sta visibleover 2024 27008 - ifconst DEBUGINTERRUPT 2025 27008 - and #$93 2026 27008 - sta BACKGRND 2027 27008 endif 2028 27008 8a txa ; save X 2029 27009 48 pha 2030 2700a 98 tya ; save Y 2031 2700b 48 pha 2032 2700c ce b2 01 dec interruptindex 2033 2700f d0 03 bne skipreallyoffvisible 2034 27011 4c 6b f0 jmp reallyoffvisible 2035 27014 skipreallyoffvisible 2036 27014 a5 4d lda visibleover 2037 27016 d0 03 bne carryontopscreenroutine 2038 27018 - ifconst .bottomscreenroutine 2039 27018 - lda interrupthold 2040 27018 - beq skipbottomroutine 2041 27018 - jsr .bottomscreenroutine 2042 27018 -skipbottomroutine 2043 27018 endif 2044 27018 4c 79 f0 jmp NMIexit 2045 2701b carryontopscreenroutine 2046 2701b - ifconst .topscreenroutine 2047 2701b - lda interrupthold 2048 2701b - beq skiptoproutine 2049 2701b - jsr .topscreenroutine 2050 2701b -skiptoproutine 2051 2701b endif 2052 2701b ifnconst CANARYOFF 2053 2701b ad c1 01 lda canary 2054 2701e f0 07 beq skipcanarytriggered 2055 27020 a9 45 lda #$45 2056 27022 85 20 sta BACKGRND 2057 27024 4c 63 f0 jmp skipbrkolorset ; common crash dump routine, if available 2058 27027 skipcanarytriggered 2059 27027 endif 2060 27027 2061 27027 ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 2062 2702a 2063 2702a ; ** Other important routines that need to regularly run, and can run onscreen. 2064 2702a ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 2065 2702a 2066 2702a - ifconst LONGCONTROLLERREAD 2067 2702a -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 2068 2702a - ldy port1control 2069 2702a - lda longreadtype,y 2070 2702a - beq LLRET1 2071 2702a - tay 2072 2702a - lda longreadroutinehiP1,y 2073 2702a - sta inttemp4 2074 2702a - lda longreadroutineloP1,y 2075 2702a - sta inttemp3 2076 2702a - jmp (inttemp3) 2077 2702a -LLRET1 2078 2702a - ldy port0control 2079 2702a - lda longreadtype,y 2080 2702a - beq LLRET0 2081 2702a - tay 2082 2702a - lda longreadroutinehiP0,y 2083 2702a - sta inttemp4 2084 2702a - lda longreadroutineloP0,y 2085 2702a - sta inttemp3 2086 2702a - jmp (inttemp3) 2087 2702a -LLRET0 2088 2702a - 2089 2702a - 2090 2702a - ifconst PADDLERANGE 2091 2702a -TIMEVAL = PADDLERANGE 2092 2702a - else 2093 2702a -TIMEVAL = 160 2094 2702a - endif 2095 2702a -TIMEOFFSET = 10 2096 2702a - 2097 2702a endif ; LONGCONTROLLERREAD 2098 2702a 2099 2702a 2100 2702a 20 d8 f1 jsr servicesfxchannels 2101 2702d - ifconst MUSICTRACKER 2102 2702d - jsr servicesong 2103 2702d endif ; MUSICTRACKER 2104 2702d 2105 2702d ee a4 01 inc framecounter 2106 27030 ad a4 01 lda framecounter 2107 27033 29 3f and #63 2108 27035 d0 08 bne skipcountdownseconds 2109 27037 ad a5 01 lda countdownseconds 2110 2703a f0 03 beq skipcountdownseconds 2111 2703c ce a5 01 dec countdownseconds 2112 2703f skipcountdownseconds 2113 2703f 2114 2703f a2 01 ldx #1 2115 27041 buttonreadloop 2116 27041 8a txa 2117 27042 48 pha 2118 27043 bc b7 01 ldy port0control,x 2119 27046 b9 bb f1 lda buttonhandlerlo,y 2120 27049 85 da sta inttemp3 2121 2704b b9 b0 f1 lda buttonhandlerhi,y 2122 2704e 85 db sta inttemp4 2123 27050 05 da ora inttemp3 2124 27052 f0 03 beq buttonreadloopreturn 2125 27054 6c da 00 jmp (inttemp3) 2126 27057 buttonreadloopreturn 2127 27057 68 pla 2128 27058 aa tax 2129 27059 ca dex 2130 2705a 10 e5 bpl buttonreadloop 2131 2705c 2132 2705c - ifconst KEYPADSUPPORT 2133 2705c - jsr keypadrowselect 2134 2705c endif ; KEYPADSUPPORT 2135 2705c 2136 2705c 2137 2705c - ifconst DOUBLEBUFFER 2138 2705c - lda doublebufferminimumframeindex 2139 2705c - beq skipdoublebufferminimumframeindexadjust 2140 2705c - dec doublebufferminimumframeindex 2141 2705c -skipdoublebufferminimumframeindexadjust 2142 2705c endif 2143 2705c 2144 2705c 4c 79 f0 jmp NMIexit 2145 2705f 2146 2705f IRQ ; the only source of non-nmi interrupt should be the BRK opcode. 2147 2705f ifnconst BREAKPROTECTOFF 2148 2705f a9 1a lda #$1A 2149 27061 85 20 sta BACKGRND 2150 27063 skipbrkolorset 2151 27063 skipbrkdetected 2152 27063 a9 60 lda #$60 2153 27065 8d 07 21 sta sCTRL 2154 27068 85 3c sta CTRL 2155 2706a ifnconst hiscorefont 2156 2706a 02 .byte.b $02 ; KIL/JAM 2157 2706b - else ; hiscorefont is present 2158 2706b - ifconst CRASHDUMP 2159 2706b - bit MSTAT 2160 2706b - bpl skipbrkdetected ; wait for vblank to ensure we're clear of NMI 2161 2706b - 2162 2706b - ifconst dumpbankswitch 2163 2706b - lda dumpbankswitch 2164 2706b - pha 2165 2706b - endif 2166 2706b - 2167 2706b - ; bankswitch if needed, to get to the hiscore font 2168 2706b - ifconst bankswitchmode 2169 2706b - ifconst included.hiscore.asm.bank 2170 2706b - ifconst MCPDEVCART 2171 2706b - lda #($18 | included.hiscore.asm.bank) 2172 2706b - sta $3000 2173 2706b - else 2174 2706b - lda #(included.hiscore.asm.bank) 2175 2706b - sta $8000 2176 2706b - endif 2177 2706b - endif ; included.hiscore.asm.bank 2178 2706b - endif ; bankswitchmode 2179 2706b - 2180 2706b - ifconst DOUBLEBUFFER 2181 2706b - ;turn off double-buffering, if on... 2182 2706b - lda #>DLLMEM 2183 2706b - sta DPPH 2184 2706b - lda #hiscorefont 2228 2706b - sta CHARBASE 2229 2706b - sta sCHARBASE 2230 2706b - lda #%01000011 ;Enable DMA, mode=320A 2231 2706b - sta CTRL 2232 2706b - sta sCTRL 2233 2706b - .byte $02 ; KIL/JAM 2234 2706b -hiscorehexlut 2235 2706b - ; 0 1 2 3 4 5 6 7 8 9 A B C D E F 2236 2706b - .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 2237 2706b -show2700 2238 2706b - ; lo mode hi width=29 x EODL 2239 2706b - .byte $00, %01100000, $27, 3, 20, 0,0,0 2240 2706b - else ; CRASHDUMP 2241 2706b - .byte $02 ; KIL/JAM 2242 2706b - endif ; crashdump 2243 2706b endif ; hiscorefont 2244 2706b - else 2245 2706b - RTI 2246 2706b endif 2247 2706b 2248 2706b - ifconst LONGCONTROLLERREAD 2249 2706b - 2250 2706b -longreadtype 2251 2706b - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 2252 2706b - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 2253 2706b - .byte 3, 3, 0 ; STMOUSE AMOUSE ATARIVOX 2254 2706b - 2255 2706b -longreadroutineloP0 2256 2706b - .byte LLRET0 ; 0 = no routine 2263 2706b - .byte >paddleport0update ; 1 = paddle 2264 2706b - .byte >trakball0update ; 2 = trackball 2265 2706b - .byte >mouse0update ; 3 = mouse 2266 2706b - 2267 2706b -longreadroutineloP1 2268 2706b - .byte LLRET1 ; 0 = no routine 2275 2706b - .byte >paddleport1update ; 1 = paddle 2276 2706b - .byte >trakball1update ; 2 = trackball 2277 2706b - .byte >mouse1update ; 3 = mouse 2278 2706b - 2279 2706b - 2280 2706b -SETTIM64T 2281 2706b - bne skipdefaulttime 2282 2706b - ifnconst PADDLESMOOTHINGOFF 2283 2706b - lda #(TIMEVAL+TIMEOFFSET+1) 2284 2706b - else 2285 2706b - lda #(TIMEVAL+TIMEOFFSET) 2286 2706b - endif 2287 2706b -skipdefaulttime 2288 2706b - tay 2289 2706b - dey 2290 2706b -.setTIM64Tloop 2291 2706b - sta TIM64T 2292 2706b - cpy INTIM 2293 2706b - bne .setTIM64Tloop 2294 2706b - rts 2295 2706b endif ; LONGCONTROLLERREAD 2296 2706b 2297 2706b reallyoffvisible 2298 2706b 85 24 sta WSYNC 2299 2706d 2300 2706d a9 00 lda #0 2301 2706f 85 4d sta visibleover 2302 27071 - ifconst DEBUGINTERRUPT 2303 27071 - sta BACKGRND 2304 27071 endif 2305 27071 2306 27071 a9 03 lda #3 2307 27073 8d b2 01 sta interruptindex 2308 27076 2309 27076 20 52 f1 jsr uninterruptableroutines 2310 27079 2311 27079 - ifconst .userinterrupt 2312 27079 - lda interrupthold 2313 27079 - beq skipuserintroutine 2314 27079 - jsr .userinterrupt 2315 27079 -skipuserintroutine 2316 27079 endif 2317 27079 2318 27079 - ifconst KEYPADSUPPORT 2319 27079 - jsr keypadcolumnread 2320 27079 endif 2321 27079 2322 27079 NMIexit 2323 27079 68 pla 2324 2707a a8 tay 2325 2707b 68 pla 2326 2707c aa tax 2327 2707d 68 pla 2328 2707e 40 RTI 2329 2707f 2330 2707f clearscreen 2331 2707f a2 17 ldx #(WZONECOUNT-1) 2332 27081 a9 00 lda #0 2333 27083 clearscreenloop 2334 27083 95 65 sta dlend,x 2335 27085 ca dex 2336 27086 10 fb bpl clearscreenloop 2337 27088 a9 00 lda #0 2338 2708a 8d ad 01 sta valbufend ; clear the bcd value buffer 2339 2708d 8d ae 01 sta valbufendsave 2340 27090 60 rts 2341 27091 2342 27091 restorescreen 2343 27091 a2 17 ldx #(WZONECOUNT-1) 2344 27093 a9 00 lda #0 2345 27095 restorescreenloop 2346 27095 b5 82 lda dlendsave,x 2347 27097 95 65 sta dlend,x 2348 27099 ca dex 2349 2709a 10 f9 bpl restorescreenloop 2350 2709c ad ae 01 lda valbufendsave 2351 2709f 8d ad 01 sta valbufend 2352 270a2 60 rts 2353 270a3 2354 270a3 savescreen 2355 270a3 a2 17 ldx #(WZONECOUNT-1) 2356 270a5 savescreenloop 2357 270a5 b5 65 lda dlend,x 2358 270a7 95 82 sta dlendsave,x 2359 270a9 ca dex 2360 270aa 10 f9 bpl savescreenloop 2361 270ac ad ad 01 lda valbufend 2362 270af 8d ae 01 sta valbufendsave 2363 270b2 - ifconst DOUBLEBUFFER 2364 270b2 - lda doublebufferstate 2365 270b2 - beq savescreenrts 2366 270b2 - lda #1 2367 270b2 - sta doublebufferbufferdirty 2368 270b2 -savescreenrts 2369 270b2 endif ; DOUBLEBUFFER 2370 270b2 60 rts 2371 270b3 2372 270b3 drawscreen 2373 270b3 2374 270b3 - ifconst interrupthold 2375 270b3 - lda #$FF 2376 270b3 - sta interrupthold ; if the user called drawscreen, we're ready for interrupts 2377 270b3 endif 2378 270b3 2379 270b3 a9 00 lda #0 2380 270b5 85 42 sta temp1 ; not B&W if we're here... 2381 270b7 2382 270b7 drawscreenwait 2383 270b7 a5 4d lda visibleover 2384 270b9 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 2385 270bb 2386 270bb ;restore some registers in case the game changed them mid-screen... 2387 270bb ad 07 21 lda sCTRL 2388 270be 05 42 ora temp1 2389 270c0 85 3c sta CTRL 2390 270c2 ad 0b 21 lda sCHARBASE 2391 270c5 85 34 sta CHARBASE 2392 270c7 2393 270c7 ;ensure all of the display list is terminated... 2394 270c7 20 38 f1 jsr terminatedisplaylist 2395 270ca 2396 270ca ifnconst pauseroutineoff 2397 270ca 20 d5 f0 jsr pauseroutine 2398 270cd endif ; pauseroutineoff 2399 270cd 2400 270cd ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 2401 270cd ; delaying a full frame, but still allowing time for basic calculations. 2402 270cd visiblescreenstartedwait 2403 270cd a5 4d lda visibleover 2404 270cf f0 fc beq visiblescreenstartedwait 2405 270d1 visiblescreenstartedwaitdone 2406 270d1 ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 2407 270d4 60 rts 2408 270d5 2409 270d5 ifnconst pauseroutineoff 2410 270d5 ; check to see if pause was pressed and released 2411 270d5 pauseroutine 2412 270d5 ad b3 01 lda pausedisable 2413 270d8 d0 4e bne leavepauseroutine 2414 270da a9 08 lda #8 2415 270dc 2c 82 02 bit SWCHB 2416 270df f0 29 beq pausepressed 2417 270e1 2418 270e1 ifnconst SOFTRESETASPAUSEOFF 2419 270e1 ifnconst MOUSESUPPORT 2420 270e1 ifnconst TRAKBALLSUPPORT 2421 270e1 ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 2422 270e4 29 70 and #%01110000 ; _LDU 2423 270e6 f0 22 beq pausepressed 2424 270e8 endif 2425 270e8 endif 2426 270e8 endif 2427 270e8 2428 270e8 ;pause isn't pressed 2429 270e8 a9 00 lda #0 2430 270ea 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 2431 270ed 2432 270ed ;check if we're in an already paused state 2433 270ed ad 00 21 lda pausestate 2434 270f0 f0 36 beq leavepauseroutine ; nope, leave 2435 270f2 2436 270f2 c9 01 cmp #1 ; last frame was the start of pausing 2437 270f4 f0 2b beq enterpausestate2 ; move from state 1 to 2 2438 270f6 2439 270f6 c9 02 cmp #2 2440 270f8 f0 34 beq carryonpausing 2441 270fa 2442 270fa ;pausestate must be >2, which means we're ending an unpause 2443 270fa a9 00 lda #0 2444 270fc 8d ac 01 sta pausebuttonflag 2445 270ff 8d 00 21 sta pausestate 2446 27102 ad 07 21 lda sCTRL 2447 27105 85 3c sta CTRL 2448 27107 4c 28 f1 jmp leavepauseroutine 2449 2710a 2450 2710a pausepressed 2451 2710a ;pause is pressed 2452 2710a ad ac 01 lda pausebuttonflag 2453 2710d c9 ff cmp #$ff 2454 2710f f0 1d beq carryonpausing 2455 27111 2456 27111 ;its a new press, increment the state 2457 27111 ee 00 21 inc pausestate 2458 27114 2459 27114 ;silence volume at the start and end of pausing 2460 27114 a9 00 lda #0 2461 27116 85 19 sta AUDV0 2462 27118 85 1a sta AUDV1 2463 2711a 2464 2711a - ifconst pokeysupport 2465 2711a - ldy #7 2466 2711a -pausesilencepokeyaudioloop 2467 2711a - sta (pokeybase),y 2468 2711a - dey 2469 2711a - bpl pausesilencepokeyaudioloop 2470 2711a endif ; pokeysupport 2471 2711a 2472 2711a a9 ff lda #$ff 2473 2711c 8d ac 01 sta pausebuttonflag 2474 2711f d0 0d bne carryonpausing 2475 27121 2476 27121 enterpausestate2 2477 27121 a9 02 lda #2 2478 27123 8d 00 21 sta pausestate 2479 27126 d0 06 bne carryonpausing 2480 27128 leavepauseroutine 2481 27128 ad 07 21 lda sCTRL 2482 2712b 85 3c sta CTRL 2483 2712d 60 rts 2484 2712e carryonpausing 2485 2712e - ifconst .pause 2486 2712e - jsr .pause 2487 2712e endif ; .pause 2488 2712e ad 07 21 lda sCTRL 2489 27131 09 80 ora #%10000000 ; turn off colorburst during pause... 2490 27133 85 3c sta CTRL 2491 27135 4c d5 f0 jmp pauseroutine 2492 27138 endif ; pauseroutineoff 2493 27138 2494 27138 2495 27138 - ifconst DOUBLEBUFFER 2496 27138 -skipterminatedisplaylistreturn 2497 27138 - rts 2498 27138 endif ; DOUBLEBUFFER 2499 27138 terminatedisplaylist 2500 27138 - ifconst DOUBLEBUFFER 2501 27138 - lda doublebufferstate 2502 27138 - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 2503 27138 endif ; DOUBLEBUFFER 2504 27138 terminatedisplaybuffer 2505 27138 ;add DL end entry on each DL 2506 27138 a2 17 ldx #(WZONECOUNT-1) 2507 2713a dlendloop 2508 2713a bd 0c f6 lda DLPOINTL,x 2509 2713d - ifconst DOUBLEBUFFER 2510 2713d - clc 2511 2713d - adc doublebufferdloffset 2512 2713d endif ; DOUBLEBUFFER 2513 2713d 85 63 sta dlpnt 2514 2713f bd f4 f5 lda DLPOINTH,x 2515 27142 - ifconst DOUBLEBUFFER 2516 27142 - adc #0 2517 27142 endif ; DOUBLEBUFFER 2518 27142 85 64 sta dlpnt+1 2519 27144 b4 65 ldy dlend,x 2520 27146 a9 00 lda #$00 2521 27148 dlendmoreloops 2522 27148 c8 iny 2523 27149 91 63 sta (dlpnt),y 2524 2714b - ifconst FRAMESKIPGLITCHFIXWEAK 2525 2714b - cpy #DLLASTOBJ+1 2526 2714b - beq dlendthiszonedone 2527 2714b - iny 2528 2714b - iny 2529 2714b - iny 2530 2714b - iny 2531 2714b - iny 2532 2714b - sta (dlpnt),y 2533 2714b -dlendthiszonedone 2534 2714b endif FRAMESKIPGLITCHFIXWEAK 2535 2714b - ifconst FRAMESKIPGLITCHFIX 2536 2714b - iny 2537 2714b - iny 2538 2714b - iny 2539 2714b - iny 2540 2714b - cpy #DLLASTOBJ-1 2541 2714b - bcc dlendmoreloops 2542 2714b endif ; FRAMESKIPGLITCHFIX 2543 2714b ca dex 2544 2714c 10 ec bpl dlendloop 2545 2714e 2546 2714e ifnconst pauseroutineoff 2547 2714e 20 d5 f0 jsr pauseroutine 2548 27151 endif ; pauseroutineoff 2549 27151 60 rts 2550 27152 2551 27152 uninterruptableroutines 2552 27152 ; this is for routines that must happen off the visible screen, each frame. 2553 27152 2554 27152 - ifconst AVOXVOICE 2555 27152 - jsr serviceatarivoxqueue 2556 27152 endif 2557 27152 2558 27152 a9 00 lda #0 2559 27154 8d b6 01 sta palfastframe 2560 27157 ad 09 21 lda paldetected 2561 2715a f0 10 beq skippalframeadjusting 2562 2715c ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 2563 2715c ae b5 01 ldx palframes 2564 2715f e8 inx 2565 27160 e0 05 cpx #5 2566 27162 d0 05 bne palframeskipdone 2567 27164 ee b6 01 inc palfastframe 2568 27167 a2 00 ldx #0 2569 27169 palframeskipdone 2570 27169 8e b5 01 stx palframes 2571 2716c skippalframeadjusting 2572 2716c 2573 2716c - ifconst MUSICTRACKER 2574 2716c - ; We normally run the servicesong routine from the top-screen interrupt, but if it 2575 2716c - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 2576 2716c - ; If that happens, we try again here. Chances are very small we'll run into the same 2577 2716c - ; problem twice, and if we do, we just drop a musical note or two. 2578 2716c - lda sfxschedulemissed 2579 2716c - beq servicesongwasnotmissed 2580 2716c - jsr servicesong 2581 2716c -servicesongwasnotmissed 2582 2716c endif ; MUSICTRACKER 2583 2716c 2584 2716c 60 rts 2585 2716d 2586 2716d serviceatarivoxqueue 2587 2716d - ifconst AVOXVOICE 2588 2716d - lda voxlock 2589 2716d - bne skipvoxprocessing ; the vox is in the middle of speech address update 2590 2716d -skipvoxqueuesizedec 2591 2716d - jmp processavoxvoice 2592 2716d -skipvoxprocessing 2593 2716d - rts 2594 2716d - 2595 2716d -processavoxvoice 2596 2716d - lda avoxenable 2597 2716d - bne avoxfixport 2598 2716d - SPKOUT tempavox 2599 2716d - rts 2600 2716d -avoxfixport 2601 2716d - lda #0 ; restore the port to all bits as inputs... 2602 2716d - sta CTLSWA 2603 2716d - rts 2604 2716d -silenceavoxvoice 2605 2716d - SPEAK avoxsilentdata 2606 2716d - rts 2607 2716d -avoxsilentdata 2608 2716d - .byte 31,255 2609 2716d else 2610 2716d 60 rts 2611 2716e endif ; AVOXVOICE 2612 2716e 2613 2716e joybuttonhandler 2614 2716e 8a txa 2615 2716f 0a asl 2616 27170 a8 tay 2617 27171 b9 08 00 lda INPT0,y 2618 27174 4a lsr 2619 27175 9d 02 21 sta sINPT1,x 2620 27178 b9 09 00 lda INPT1,y 2621 2717b 29 80 and #%10000000 2622 2717d 1d 02 21 ora sINPT1,x 2623 27180 9d 02 21 sta sINPT1,x 2624 27183 2625 27183 b5 0c lda INPT4,x 2626 27185 30 19 bmi .skip1bjoyfirecheck 2627 27187 ;one button joystick is down 2628 27187 49 80 eor #%10000000 2629 27189 9d 02 21 sta sINPT1,x 2630 2718c 2631 2718c ad b1 01 lda joybuttonmode 2632 2718f 3d a3 f1 and twobuttonmask,x 2633 27192 f0 0c beq .skip1bjoyfirecheck 2634 27194 ad b1 01 lda joybuttonmode 2635 27197 1d a3 f1 ora twobuttonmask,x 2636 2719a 8d b1 01 sta joybuttonmode 2637 2719d 8d 82 02 sta SWCHB 2638 271a0 .skip1bjoyfirecheck 2639 271a0 4c 57 f0 jmp buttonreadloopreturn 2640 271a3 2641 271a3 twobuttonmask 2642 271a3 04 10 .byte.b %00000100,%00010000 2643 271a5 2644 271a5 gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 2645 271a5 - ifconst LIGHTGUNSUPPORT 2646 271a5 - cpx #0 2647 271a5 - bne secondportgunhandler 2648 271a5 -firstportgunhandler 2649 271a5 - lda SWCHA 2650 271a5 - asl 2651 271a5 - asl 2652 271a5 - asl ; shift D4 to D7 2653 271a5 - and #%10000000 2654 271a5 - eor #%10000000 2655 271a5 - sta sINPT1 2656 271a5 - jmp buttonreadloopreturn 2657 271a5 -secondportgunhandler 2658 271a5 - lda SWCHA 2659 271a5 - lsr ; shift D0 into carry 2660 271a5 - lsr ; shift carry into D7 2661 271a5 - and #%10000000 2662 271a5 - eor #%10000000 2663 271a5 - sta sINPT3 2664 271a5 - jmp buttonreadloopreturn 2665 271a5 endif ; LIGHTGUNSUPPORT 2666 271a5 2667 271a5 controlsusing2buttoncode 2668 271a5 00 .byte.b 0 ; 00=no controller plugged in 2669 271a6 01 .byte.b 1 ; 01=proline joystick 2670 271a7 00 .byte.b 0 ; 02=lightgun 2671 271a8 00 .byte.b 0 ; 03=paddle 2672 271a9 01 .byte.b 1 ; 04=trakball 2673 271aa 01 .byte.b 1 ; 05=vcs joystick 2674 271ab 01 .byte.b 1 ; 06=driving control 2675 271ac 00 .byte.b 0 ; 07=keypad control 2676 271ad 00 .byte.b 0 ; 08=st mouse/cx80 2677 271ae 00 .byte.b 0 ; 09=amiga mouse 2678 271af 01 .byte.b 1 ; 10=atarivox 2679 271b0 2680 271b0 buttonhandlerhi 2681 271b0 00 .byte.b 0 ; 00=no controller plugged in 2682 271b1 f1 .byte.b >joybuttonhandler ; 01=proline joystick 2683 271b2 f1 .byte.b >gunbuttonhandler ; 02=lightgun 2684 271b3 f4 .byte.b >paddlebuttonhandler ; 03=paddle 2685 271b4 f1 .byte.b >joybuttonhandler ; 04=trakball 2686 271b5 f1 .byte.b >joybuttonhandler ; 05=vcs joystick 2687 271b6 f1 .byte.b >joybuttonhandler ; 06=driving control 2688 271b7 00 .byte.b 0 ; 07=keypad 2689 271b8 f4 .byte.b >mousebuttonhandler ; 08=st mouse 2690 271b9 f4 .byte.b >mousebuttonhandler ; 09=amiga mouse 2691 271ba f1 .byte.b >joybuttonhandler ; 10=atarivox 2692 271bb buttonhandlerlo 2693 271bb 00 .byte.b 0 ; 00=no controller plugged in 2694 271bc 6e .byte.b $0F means the sound is looped while priority is active 2795 27219 2796 27219 05 d9 ora inttemp2 2797 2721b 05 d8 ora inttemp1 ; check if F|C|V=0 2798 2721d f0 23 beq zerosfx ; if so, we're at the end of the sound. 2799 2721f 2800 2721f advancesfxpointer 2801 2721f ; advance the pointer to the next sound chunk 2802 2721f c8 iny 2803 27220 84 da sty inttemp3 2804 27222 18 clc 2805 27223 b5 4e lda sfx1pointlo,x 2806 27225 65 da adc inttemp3 2807 27227 95 4e sta sfx1pointlo,x 2808 27229 b5 50 lda sfx1pointhi,x 2809 2722b 69 00 adc #0 2810 2722d 95 50 sta sfx1pointhi,x 2811 2722f 4c da f1 jmp servicesfxchannelsloop 2812 27232 2813 27232 sfxsoundloop 2814 27232 48 pha 2815 27233 b5 52 lda sfx1priority,x 2816 27235 d0 04 bne sfxsoundloop_carryon 2817 27237 68 pla ; fix the stack before we go 2818 27238 4c 1f f2 jmp advancesfxpointer 2819 2723b sfxsoundloop_carryon 2820 2723b 68 pla 2821 2723c 29 f0 and #$F0 2822 2723e 4a lsr 2823 2723f 4a lsr 2824 27240 4a lsr 2825 27241 4a lsr 2826 27242 2827 27242 zerosfx 2828 27242 95 4e sta sfx1pointlo,x 2829 27244 95 50 sta sfx1pointhi,x 2830 27246 95 52 sta sfx1priority,x 2831 27248 4c da f1 jmp servicesfxchannelsloop 2832 2724b 2833 2724b 2834 2724b schedulesfx 2835 2724b ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 2836 2724b a0 00 ldy #0 2837 2724d b1 e0 lda (sfxinstrumentlo),y 2838 2724f - ifconst pokeysupport 2839 2724f - cmp #$20 ; POKEY? 2840 2724f - bne scheduletiasfx 2841 2724f - jmp schedulepokeysfx 2842 2724f endif 2843 2724f scheduletiasfx 2844 2724f ;cmp #$10 ; TIA? 2845 2724f ;beq continuescheduletiasfx 2846 2724f ; rts ; unhandled!!! 2847 2724f continuescheduletiasfx 2848 2724f ifnconst TIASFXMONO 2849 2724f a5 4e lda sfx1pointlo 2850 27251 05 50 ora sfx1pointhi 2851 27253 f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 2852 27255 a5 4f lda sfx2pointlo 2853 27257 05 51 ora sfx2pointhi 2854 27259 f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 2855 2725b ; Both channels are scheduled. 2856 2725b a0 01 ldy #1 2857 2725d b1 e0 lda (sfxinstrumentlo),y 2858 2725f d0 01 bne interruptsfx 2859 27261 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 2860 27262 interruptsfx 2861 27262 ;Compare which active sound has a lower priority. We'll interrupt the lower one. 2862 27262 a5 52 lda sfx1priority 2863 27264 c5 53 cmp sfx2priority 2864 27266 b0 04 bcs schedulesfx2 2865 27268 endif ; !TIASFXMONO 2866 27268 2867 27268 schedulesfx1 2868 27268 a2 00 ldx #0 ; channel 1 2869 2726a ifnconst TIASFXMONO 2870 2726a f0 02 beq skipschedulesfx2 2871 2726c schedulesfx2 2872 2726c a2 01 ldx #1 ; channel 2 2873 2726e skipschedulesfx2 2874 2726e endif ; !TIASFXMONO 2875 2726e 2876 2726e - ifconst MUSICTRACKER 2877 2726e - lda sfxnoteindex 2878 2726e - bpl skipdrumkitoverride 2879 2726e - and #$7F ; subtract 128 2880 2726e - sec 2881 2726e - sbc #4 ; drums start at 132, i.e. octave 10 2882 2726e - asl 2883 2726e - tay 2884 2726e - lda tiadrumkitdefinition,y 2885 2726e - sta sfxinstrumentlo 2886 2726e - iny 2887 2726e - lda tiadrumkitdefinition,y 2888 2726e - sta sfxinstrumenthi 2889 2726e - lda #0 2890 2726e - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 2891 2726e -skipdrumkitoverride 2892 2726e endif ; MUSICTRACKER 2893 2726e a0 01 ldy #1 ; get priority and sound-resolution (in frames) 2894 27270 b1 e0 lda (sfxinstrumentlo),y 2895 27272 95 52 sta sfx1priority,x 2896 27274 c8 iny 2897 27275 b1 e0 lda (sfxinstrumentlo),y 2898 27277 95 56 sta sfx1frames,x 2899 27279 a5 e0 lda sfxinstrumentlo 2900 2727b 18 clc 2901 2727c 69 03 adc #3 2902 2727e 95 4e sta sfx1pointlo,x 2903 27280 a5 e1 lda sfxinstrumenthi 2904 27282 69 00 adc #0 2905 27284 95 50 sta sfx1pointhi,x 2906 27286 a5 e2 lda sfxpitchoffset 2907 27288 95 54 sta sfx1poffset,x 2908 2728a a9 00 lda #0 2909 2728c 95 58 sta sfx1tick,x 2910 2728e a5 e3 lda sfxnoteindex 2911 27290 95 cd sta sfx1notedata,x 2912 27292 60 rts 2913 27293 2914 27293 plotsprite 2915 27293 ifnconst NODRAWWAIT 2916 27293 - ifconst DOUBLEBUFFER 2917 27293 - lda doublebufferstate 2918 27293 - bne skipplotspritewait 2919 27293 endif ; DOUBLEBUFFER 2920 27293 - ifconst DEBUGWAITCOLOR 2921 27293 - lda #$41 2922 27293 - sta BACKGRND 2923 27293 endif 2924 27293 plotspritewait 2925 27293 a5 4d lda visibleover 2926 27295 d0 fc bne plotspritewait 2927 27297 skipplotspritewait 2928 27297 - ifconst DEBUGWAITCOLOR 2929 27297 - lda #$0 2930 27297 - sta BACKGRND 2931 27297 endif 2932 27297 endif 2933 27297 2934 27297 ;arguments: 2935 27297 ; temp1=lo graphicdata 2936 27297 ; temp2=hi graphicdata 2937 27297 ; temp3=palette | width byte 2938 27297 ; temp4=x 2939 27297 ; temp5=y 2940 27297 ; temp6=mode 2941 27297 a5 46 lda temp5 ;Y position 2942 27299 4a lsr ; 2 - Divide by 8 or 16 2943 2729a 4a lsr ; 2 2944 2729b 4a lsr ; 2 2945 2729c - if WZONEHEIGHT = 16 2946 2729c - lsr ; 2 2947 2729c endif 2948 2729c 2949 2729c aa tax 2950 2729d 2951 2729d ifnconst NOLIMITCHECKING 2952 2729d 2953 2729d ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 2954 2729d 2955 2729d c9 18 cmp #WZONECOUNT 2956 2729f 2957 2729f 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 2958 272a1 ; otherwise, check to see if the bottom half is in zone 0... 2959 272a1 2960 272a1 - if WZONEHEIGHT = 16 2961 272a1 - cmp #15 2962 272a1 else 2963 272a1 c9 1f cmp #31 2964 272a3 endif 2965 272a3 2966 272a3 d0 05 bne exitplotsprite1 2967 272a5 a2 00 ldx #0 2968 272a7 4c e4 f2 jmp continueplotsprite2 2969 272aa exitplotsprite1 2970 272aa 60 rts 2971 272ab 2972 272ab continueplotsprite1 2973 272ab endif 2974 272ab 2975 272ab bd 0c f6 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 2976 272ae - ifconst DOUBLEBUFFER 2977 272ae - clc 2978 272ae - adc doublebufferdloffset 2979 272ae endif ; DOUBLEBUFFER 2980 272ae 85 63 sta dlpnt 2981 272b0 bd f4 f5 lda DLPOINTH,x 2982 272b3 - ifconst DOUBLEBUFFER 2983 272b3 - adc #0 2984 272b3 endif ; DOUBLEBUFFER 2985 272b3 85 64 sta dlpnt+1 2986 272b5 2987 272b5 ;Create DL entry for upper part of sprite 2988 272b5 2989 272b5 b4 65 ldy dlend,x ;Get the index to the end of this DL 2990 272b7 2991 272b7 ifconst CHECKOVERWRITE 2992 272b7 c0 78 cpy #DLLASTOBJ 2993 272b9 f0 21 beq checkcontinueplotsprite2 2994 272bb continueplotsprite1a 2995 272bb endif 2996 272bb 2997 272bb a5 42 lda temp1 ; graphic data, lo byte 2998 272bd 91 63 sta (dlpnt),y ;Low byte of data address 2999 272bf 3000 272bf ifnconst ATOMICSPRITEUPDATE 3001 272bf c8 iny 3002 272c0 a5 47 lda temp6 3003 272c2 91 63 sta (dlpnt),y 3004 272c4 - else 3005 272c4 - iny 3006 272c4 - sty temp8 3007 272c4 endif 3008 272c4 3009 272c4 c8 iny 3010 272c5 3011 272c5 a5 46 lda temp5 ;Y position 3012 272c7 29 07 and #(WZONEHEIGHT - 1) 3013 272c9 c9 01 cmp #1 ; clear carry if our sprite is just in this zone 3014 272cb 05 43 ora temp2 ; graphic data, hi byte 3015 272cd 91 63 sta (dlpnt),y 3016 272cf 3017 272cf 3018 272cf c8 iny 3019 272d0 a5 44 lda temp3 ;palette|width 3020 272d2 91 63 sta (dlpnt),y 3021 272d4 3022 272d4 c8 iny 3023 272d5 a5 45 lda temp4 ;Horizontal position 3024 272d7 91 63 sta (dlpnt),y 3025 272d9 3026 272d9 c8 iny 3027 272da 94 65 sty dlend,x 3028 272dc 3029 272dc - ifconst ALWAYSTERMINATE 3030 272dc - iny 3031 272dc - lda #0 3032 272dc - sta (dlpnt),y 3033 272dc endif 3034 272dc 3035 272dc - ifconst ATOMICSPRITEUPDATE 3036 272dc - ldy temp8 3037 272dc - lda temp6 3038 272dc - sta (dlpnt),y 3039 272dc endif 3040 272dc 3041 272dc checkcontinueplotsprite2 3042 272dc 3043 272dc 90 38 bcc doneSPDL ;branch if the sprite was fully in the last zone 3044 272de 3045 272de ;Create DL entry for lower part of sprite 3046 272de 3047 272de e8 inx ;Next region 3048 272df 3049 272df ifnconst NOLIMITCHECKING 3050 272df e0 18 cpx #WZONECOUNT 3051 272e1 3052 272e1 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 3053 272e3 60 rts 3054 272e4 continueplotsprite2 3055 272e4 endif 3056 272e4 3057 272e4 bd 0c f6 lda DLPOINTL,x ;Get pointer to next DL 3058 272e7 - ifconst DOUBLEBUFFER 3059 272e7 - clc 3060 272e7 - adc doublebufferdloffset 3061 272e7 endif ; DOUBLEBUFFER 3062 272e7 85 63 sta dlpnt 3063 272e9 bd f4 f5 lda DLPOINTH,x 3064 272ec - ifconst DOUBLEBUFFER 3065 272ec - adc #0 3066 272ec endif ; DOUBLEBUFFER 3067 272ec 85 64 sta dlpnt+1 3068 272ee b4 65 ldy dlend,x ;Get the index to the end of this DL 3069 272f0 3070 272f0 ifconst CHECKOVERWRITE 3071 272f0 c0 78 cpy #DLLASTOBJ 3072 272f2 d0 01 bne continueplotsprite2a 3073 272f4 60 rts 3074 272f5 continueplotsprite2a 3075 272f5 endif 3076 272f5 3077 272f5 a5 42 lda temp1 ; graphic data, lo byte 3078 272f7 91 63 sta (dlpnt),y 3079 272f9 3080 272f9 ifnconst ATOMICSPRITEUPDATE 3081 272f9 c8 iny 3082 272fa a5 47 lda temp6 3083 272fc 91 63 sta (dlpnt),y 3084 272fe - else 3085 272fe - iny 3086 272fe - sty temp8 3087 272fe endif 3088 272fe 3089 272fe c8 iny 3090 272ff 3091 272ff a5 46 lda temp5 ;Y position 3092 27301 0b 07 anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 3093 27303 05 43 ora temp2 ; graphic data, hi byte 3094 27305 e9 07 sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 3095 27307 91 63 sta (dlpnt),y 3096 27309 3097 27309 c8 iny 3098 2730a 3099 2730a a5 44 lda temp3 ;palette|width 3100 2730c 91 63 sta (dlpnt),y 3101 2730e 3102 2730e c8 iny 3103 2730f 3104 2730f a5 45 lda temp4 ;Horizontal position 3105 27311 91 63 sta (dlpnt),y 3106 27313 3107 27313 c8 iny 3108 27314 94 65 sty dlend,x 3109 27316 3110 27316 - ifconst ALWAYSTERMINATE 3111 27316 - iny 3112 27316 - lda #0 3113 27316 - sta (dlpnt),y 3114 27316 endif 3115 27316 3116 27316 - ifconst ATOMICSPRITEUPDATE 3117 27316 - ldy temp8 3118 27316 - lda temp6 3119 27316 - sta (dlpnt),y 3120 27316 endif 3121 27316 3122 27316 doneSPDL 3123 27316 60 rts 3124 27317 3125 27317 3126 27317 lockzonex 3127 27317 - ifconst ZONELOCKS 3128 27317 - ldy dlend,x 3129 27317 - cpy #DLLASTOBJ 3130 27317 - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 3131 27317 - lda DLPOINTL,x 3132 27317 - ifconst DOUBLEBUFFER 3133 27317 - clc 3134 27317 - adc doublebufferdloffset 3135 27317 - endif ; DOUBLEBUFFER 3136 27317 - sta dlpnt 3137 27317 - lda DLPOINTH,x 3138 27317 - ifconst DOUBLEBUFFER 3139 27317 - adc #0 3140 27317 - endif ; DOUBLEBUFFER 3141 27317 - sta dlpnt+1 3142 27317 - iny 3143 27317 - lda #0 3144 27317 - sta (dlpnt),y 3145 27317 - dey 3146 27317 - tya 3147 27317 - ldy #(DLLASTOBJ-1) 3148 27317 - sta (dlpnt),y 3149 27317 - iny 3150 27317 - sty dlend,x 3151 27317 -lockzonexreturn 3152 27317 - rts 3153 27317 endif ; ZONELOCKS 3154 27317 unlockzonex 3155 27317 - ifconst ZONELOCKS 3156 27317 - ldy dlend,x 3157 27317 - cpy #DLLASTOBJ 3158 27317 - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 3159 27317 - lda DLPOINTL,x 3160 27317 - ifconst DOUBLEBUFFER 3161 27317 - clc 3162 27317 - adc doublebufferdloffset 3163 27317 - endif ; DOUBLEBUFFER 3164 27317 - sta dlpnt 3165 27317 - lda DLPOINTH,x 3166 27317 - ifconst DOUBLEBUFFER 3167 27317 - adc #0 3168 27317 - endif ; DOUBLEBUFFER 3169 27317 - sta dlpnt+1 3170 27317 - dey 3171 27317 - ;ldy #(DLLASTOBJ-1) 3172 27317 - lda (dlpnt),y 3173 27317 - tay 3174 27317 - sty dlend,x 3175 27317 -unlockzonexreturn 3176 27317 endif ; ZONELOCKS 3177 27317 60 rts 3178 27318 3179 27318 plotcharloop 3180 27318 ; ** read from a data indirectly pointed to from temp8,temp9 3181 27318 ; ** format is: lo_data, hi_data, palette|width, x, y 3182 27318 ; ** format ends with lo_data | hi_data = 0 3183 27318 3184 27318 - ifconst DOUBLEBUFFER 3185 27318 - lda doublebufferstate 3186 27318 - bne skipplotcharloopwait 3187 27318 endif ; DOUBLEBUFFER 3188 27318 - ifconst DEBUGWAITCOLOR 3189 27318 - lda #$61 3190 27318 - sta BACKGRND 3191 27318 endif 3192 27318 plotcharloopwait 3193 27318 a5 4d lda visibleover 3194 2731a d0 fc bne plotcharloopwait 3195 2731c - ifconst DEBUGWAITCOLOR 3196 2731c - lda #0 3197 2731c - sta BACKGRND 3198 2731c endif 3199 2731c skipplotcharloopwait 3200 2731c plotcharlooploop 3201 2731c a0 00 ldy #0 3202 2731e b1 49 lda (temp8),y 3203 27320 85 42 sta temp1 3204 27322 c8 iny 3205 27323 b1 49 lda (temp8),y 3206 27325 85 43 sta temp2 3207 27327 05 42 ora temp1 3208 27329 d0 01 bne plotcharloopcontinue 3209 2732b ;the pointer=0, so return 3210 2732b 60 rts 3211 2732c plotcharloopcontinue 3212 2732c c8 iny 3213 2732d b1 49 lda (temp8),y 3214 2732f 85 44 sta temp3 3215 27331 c8 iny 3216 27332 b1 49 lda (temp8),y 3217 27334 85 45 sta temp4 3218 27336 c8 iny 3219 27337 b1 49 lda (temp8),y 3220 27339 ;sta temp5 ; not needed with our late entry. 3221 27339 20 52 f3 jsr plotcharactersskipentry 3222 2733c a5 49 lda temp8 3223 2733e 18 clc 3224 2733f 69 05 adc #5 3225 27341 85 49 sta temp8 3226 27343 a5 4a lda temp9 3227 27345 69 00 adc #0 3228 27347 85 4a sta temp9 3229 27349 4c 1c f3 jmp plotcharlooploop 3230 2734c 3231 2734c plotcharacters 3232 2734c - ifconst DOUBLEBUFFER 3233 2734c - lda doublebufferstate 3234 2734c - bne skipplotcharacterswait 3235 2734c endif ; DOUBLEBUFFER 3236 2734c - ifconst DEBUGWAITCOLOR 3237 2734c - lda #$41 3238 2734c - sta BACKGRND 3239 2734c endif 3240 2734c plotcharacterswait 3241 2734c a5 4d lda visibleover 3242 2734e d0 fc bne plotcharacterswait 3243 27350 - ifconst DEBUGWAITCOLOR 3244 27350 - sta BACKGRND 3245 27350 endif 3246 27350 skipplotcharacterswait 3247 27350 ;arguments: 3248 27350 ; temp1=lo charactermap 3249 27350 ; temp2=hi charactermap 3250 27350 ; temp3=palette | width byte 3251 27350 ; temp4=x 3252 27350 ; temp5=y 3253 27350 3254 27350 a5 46 lda temp5 ;Y position 3255 27352 3256 27352 plotcharactersskipentry 3257 27352 3258 27352 ;ifconst ZONEHEIGHT 3259 27352 ; if ZONEHEIGHT = 16 3260 27352 ; and #$0F 3261 27352 ; endif 3262 27352 ; if ZONEHEIGHT = 8 3263 27352 ; and #$1F 3264 27352 ; endif 3265 27352 ;else 3266 27352 ; and #$0F 3267 27352 ;endif 3268 27352 3269 27352 aa tax 3270 27353 bd 0c f6 lda DLPOINTL,x ;Get pointer to DL that the characters are in 3271 27356 - ifconst DOUBLEBUFFER 3272 27356 - clc 3273 27356 - adc doublebufferdloffset 3274 27356 endif ; DOUBLEBUFFER 3275 27356 85 63 sta dlpnt 3276 27358 bd f4 f5 lda DLPOINTH,x 3277 2735b - ifconst DOUBLEBUFFER 3278 2735b - adc #0 3279 2735b endif ; DOUBLEBUFFER 3280 2735b 85 64 sta dlpnt+1 3281 2735d 3282 2735d ;Create DL entry for the characters 3283 2735d 3284 2735d b4 65 ldy dlend,x ;Get the index to the end of this DL 3285 2735f 3286 2735f ifconst CHECKOVERWRITE 3287 2735f c0 78 cpy #DLLASTOBJ 3288 27361 d0 01 bne continueplotcharacters 3289 27363 60 rts 3290 27364 continueplotcharacters 3291 27364 endif 3292 27364 3293 27364 a5 42 lda temp1 ; character map data, lo byte 3294 27366 91 63 sta (dlpnt),y ;(1) store low address 3295 27368 3296 27368 c8 iny 3297 27369 ad 06 21 lda charactermode 3298 2736c 91 63 sta (dlpnt),y ;(2) store mode 3299 2736e 3300 2736e c8 iny 3301 2736f a5 43 lda temp2 ; character map, hi byte 3302 27371 91 63 sta (dlpnt),y ;(3) store high address 3303 27373 3304 27373 c8 iny 3305 27374 a5 44 lda temp3 ;palette|width 3306 27376 91 63 sta (dlpnt),y ;(4) store palette|width 3307 27378 3308 27378 c8 iny 3309 27379 a5 45 lda temp4 ;Horizontal position 3310 2737b 91 63 sta (dlpnt),y ;(5) store horizontal position 3311 2737d 3312 2737d c8 iny 3313 2737e 94 65 sty dlend,x ; save display list end byte 3314 27380 60 rts 3315 27381 3316 27381 3317 27381 - ifconst plotvalueonscreen 3318 27381 -plotcharacterslive 3319 27381 - ; a version of plotcharacters that draws live and minimally disrupts the screen... 3320 27381 - 3321 27381 - ;arguments: 3322 27381 - ; temp1=lo charactermap 3323 27381 - ; temp2=hi charactermap 3324 27381 - ; temp3=palette | width byte 3325 27381 - ; temp4=x 3326 27381 - ; temp5=y 3327 27381 - 3328 27381 - lda temp5 ;Y position 3329 27381 - 3330 27381 - tax 3331 27381 - lda DLPOINTL,x ;Get pointer to DL that the characters are in 3332 27381 - ifconst DOUBLEBUFFER 3333 27381 - clc 3334 27381 - adc doublebufferdloffset 3335 27381 - endif ; DOUBLEBUFFER 3336 27381 - sta dlpnt 3337 27381 - lda DLPOINTH,x 3338 27381 - ifconst DOUBLEBUFFER 3339 27381 - adc #0 3340 27381 - endif ; DOUBLEBUFFER 3341 27381 - sta dlpnt+1 3342 27381 - 3343 27381 - ;Create DL entry for the characters 3344 27381 - 3345 27381 - ldy dlend,x ;Get the index to the end of this DL 3346 27381 - 3347 27381 - ifconst CHECKOVERWRITE 3348 27381 - cpy #DLLASTOBJ 3349 27381 - bne continueplotcharacterslive 3350 27381 - rts 3351 27381 -continueplotcharacterslive 3352 27381 - endif 3353 27381 - 3354 27381 - lda temp1 ; character map data, lo byte 3355 27381 - sta (dlpnt),y ;(1) store low address 3356 27381 - 3357 27381 - iny 3358 27381 - ; we don't add the second byte yet, since the charmap could briefly 3359 27381 - ; render without a proper character map address, width, or position. 3360 27381 - lda charactermode 3361 27381 - sta (dlpnt),y ;(2) store mode 3362 27381 - 3363 27381 - iny 3364 27381 - lda temp2 ; character map, hi byte 3365 27381 - sta (dlpnt),y ;(3) store high address 3366 27381 - 3367 27381 - iny 3368 27381 - lda temp3 ;palette|width 3369 27381 - sta (dlpnt),y ;(4) store palette|width 3370 27381 - 3371 27381 - iny 3372 27381 - lda temp4 ;Horizontal position 3373 27381 - sta (dlpnt),y ;(5) store horizontal position 3374 27381 - 3375 27381 - iny 3376 27381 - sty dlend,x ; save display list end byte 3377 27381 - 3378 27381 - rts 3379 27381 endif ;plotcharacterslive 3380 27381 3381 27381 - ifconst USED_PLOTVALUE 3382 27381 -plotvalue 3383 27381 - ; calling 7800basic command: 3384 27381 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 3385 27381 - ; ...displays the variable as BCD digits 3386 27381 - ; 3387 27381 - ; asm sub arguments: 3388 27381 - ; temp1=lo charactermap 3389 27381 - ; temp2=hi charactermap 3390 27381 - ; temp3=palette | width byte 3391 27381 - ; temp4=x 3392 27381 - ; temp5=y 3393 27381 - ; temp6=number of digits 3394 27381 - ; temp7=lo variable 3395 27381 - ; temp8=hi variable 3396 27381 - ; temp9=character mode 3397 27381 - 3398 27381 -plotdigitcount = temp6 3399 27381 - 3400 27381 - ifconst ZONELOCKS 3401 27381 - ldx temp5 3402 27381 - ldy dlend,x 3403 27381 - cpy #DLLASTOBJ 3404 27381 - bne carryonplotvalue 3405 27381 - rts 3406 27381 -carryonplotvalue 3407 27381 - endif 3408 27381 - 3409 27381 - lda #0 3410 27381 - tay 3411 27381 - ldx valbufend 3412 27381 - 3413 27381 - lda plotdigitcount 3414 27381 - and #1 3415 27381 - beq pvnibble2char 3416 27381 - lda #0 3417 27381 - sta VALBUFFER,x ; just in case we skip this digit 3418 27381 - beq pvnibble2char_skipnibble 3419 27381 - 3420 27381 -pvnibble2char 3421 27381 - ; high nibble... 3422 27381 - lda (temp7),y 3423 27381 - and #$f0 3424 27381 - lsr 3425 27381 - lsr 3426 27381 - lsr 3427 27381 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 3428 27381 - lsr 3429 27381 - endif 3430 27381 - 3431 27381 - clc 3432 27381 - adc temp1 ; add the offset to character graphics to our value 3433 27381 - sta VALBUFFER,x 3434 27381 - inx 3435 27381 - dec plotdigitcount 3436 27381 - 3437 27381 -pvnibble2char_skipnibble 3438 27381 - ; low nibble... 3439 27381 - lda (temp7),y 3440 27381 - and #$0f 3441 27381 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 3442 27381 - asl 3443 27381 - endif 3444 27381 - clc 3445 27381 - adc temp1 ; add the offset to character graphics to our value 3446 27381 - sta VALBUFFER,x 3447 27381 - inx 3448 27381 - iny 3449 27381 - 3450 27381 - dec plotdigitcount 3451 27381 - bne pvnibble2char 3452 27381 - 3453 27381 - ;point to the start of our valuebuffer 3454 27381 - clc 3455 27381 - lda #VALBUFFER 3459 27381 - adc #0 3460 27381 - sta temp2 3461 27381 - 3462 27381 - ;advance valbufend to the end of our value buffer 3463 27381 - stx valbufend 3464 27381 - 3465 27381 - ifnconst plotvalueonscreen 3466 27381 - jmp plotcharacters 3467 27381 - else 3468 27381 - jmp plotcharacterslive 3469 27381 - endif 3470 27381 - 3471 27381 endif ; USED_PLOTVALUE 3472 27381 3473 27381 3474 27381 - ifconst USED_PLOTVALUEEXTRA 3475 27381 -plotdigitcount = temp6 3476 27381 -plotvalueextra 3477 27381 - ; calling 7800basic command: 3478 27381 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 3479 27381 - ; ...displays the variable as BCD digits 3480 27381 - ; 3481 27381 - ; asm sub arguments: 3482 27381 - ; temp1=lo charactermap 3483 27381 - ; temp2=hi charactermap 3484 27381 - ; temp3=palette | width byte 3485 27381 - ; temp4=x 3486 27381 - ; temp5=y 3487 27381 - ; temp6=number of digits 3488 27381 - ; temp7=lo variable 3489 27381 - ; temp8=hi variable 3490 27381 - 3491 27381 - lda #0 3492 27381 - tay 3493 27381 - ldx valbufend 3494 27381 - ifnconst plotvalueonscreen 3495 27381 - sta VALBUFFER,x 3496 27381 - endif 3497 27381 - 3498 27381 - lda plotdigitcount 3499 27381 - and #1 3500 27381 - 3501 27381 - bne pvnibble2char_skipnibbleextra 3502 27381 - 3503 27381 -pvnibble2charextra 3504 27381 - ; high nibble... 3505 27381 - lda (temp7),y 3506 27381 - and #$f0 3507 27381 - lsr 3508 27381 - lsr 3509 27381 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 3510 27381 - lsr 3511 27381 - endif 3512 27381 - clc 3513 27381 - adc temp1 ; add the offset to character graphics to our value 3514 27381 - sta VALBUFFER,x 3515 27381 - inx 3516 27381 - 3517 27381 - ; second half of the digit 3518 27381 - clc 3519 27381 - adc #1 3520 27381 - sta VALBUFFER,x 3521 27381 - inx 3522 27381 - 3523 27381 -pvnibble2char_skipnibbleextra 3524 27381 - ; low nibble... 3525 27381 - lda (temp7),y 3526 27381 - and #$0f 3527 27381 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 3528 27381 - asl 3529 27381 - endif 3530 27381 - asl 3531 27381 - 3532 27381 - clc 3533 27381 - adc temp1 ; add the offset to character graphics to our value 3534 27381 - sta VALBUFFER,x 3535 27381 - inx 3536 27381 - 3537 27381 - clc 3538 27381 - adc #1 3539 27381 - sta VALBUFFER,x 3540 27381 - inx 3541 27381 - iny 3542 27381 - 3543 27381 - dec plotdigitcount 3544 27381 - bne pvnibble2charextra 3545 27381 - 3546 27381 - ;point to the start of our valuebuffer 3547 27381 - clc 3548 27381 - lda #VALBUFFER 3552 27381 - adc #0 3553 27381 - sta temp2 3554 27381 - 3555 27381 - ;advance valbufend to the end of our value buffer 3556 27381 - stx valbufend 3557 27381 - 3558 27381 - ifnconst plotvalueonscreen 3559 27381 - jmp plotcharacters 3560 27381 - else 3561 27381 - jmp plotcharacterslive 3562 27381 - endif 3563 27381 endif ; USED_PLOTVALUEEXTRA 3564 27381 3565 27381 boxcollision 3566 27381 - ifconst BOXCOLLISION 3567 27381 - ; the worst case cycle-time for the code below is 43 cycles. 3568 27381 - ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 3569 27381 - 3570 27381 - ;__boxx1 = accumulator 3571 27381 - ;__boxy1 = y 3572 27381 -__boxw1 = temp3 3573 27381 -__boxh1 = temp4 3574 27381 - 3575 27381 -__boxx2 = temp5 3576 27381 -__boxy2 = temp6 3577 27381 -__boxw2 = temp7 3578 27381 -__boxh2 = temp8 3579 27381 - 3580 27381 -DoXCollisionCheck 3581 27381 - ;lda __boxx1 ; skipped. already in the accumulator 3582 27381 - cmp __boxx2 ;3 3583 27381 - bcs X1isbiggerthanX2 ;2/3 3584 27381 -X2isbiggerthanX1 3585 27381 - ; carry is clear 3586 27381 - adc __boxw1 ;3 3587 27381 - cmp __boxx2 ;3 3588 27381 - bcs DoYCollisionCheck ;3/2 3589 27381 - rts ;6 - carry clear, no collision 3590 27381 -X1isbiggerthanX2 3591 27381 - clc ;2 3592 27381 - sbc __boxw2 ;3 3593 27381 - cmp __boxx2 ;3 3594 27381 - bcs noboxcollision ;3/2 3595 27381 -DoYCollisionCheck 3596 27381 - tya ; 2 ; use to be "lda __boxy1" 3597 27381 - cmp __boxy2 ;3 3598 27381 - bcs Y1isbiggerthanY2 ;3/2 3599 27381 -Y2isbiggerthanY1 3600 27381 - ; carry is clear 3601 27381 - adc __boxh1 ;3 3602 27381 - cmp __boxy2 ;3 3603 27381 - rts ;6 3604 27381 -Y1isbiggerthanY2 3605 27381 - clc ;2 3606 27381 - sbc __boxh2 ;3 3607 27381 - cmp __boxy2 ;3 3608 27381 - bcs noboxcollision ;3/2 3609 27381 -yesboxcollision 3610 27381 - sec ;2 3611 27381 - rts ;6 3612 27381 -noboxcollision 3613 27381 - clc ;2 3614 27381 - rts ;6 3615 27381 endif ; BOXCOLLISION 3616 27381 3617 27381 randomize 3618 27381 a5 40 lda rand 3619 27383 4a lsr 3620 27384 26 41 rol rand16 3621 27386 90 02 bcc noeor 3622 27388 49 b4 eor #$B4 3623 2738a noeor 3624 2738a 85 40 sta rand 3625 2738c 45 41 eor rand16 3626 2738e 60 rts 3627 2738f 3628 2738f ; *** bcd conversion routine courtesy Omegamatrix 3629 2738f ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 3630 2738f converttobcd 3631 2738f ;value to convert is in the accumulator 3632 2738f 85 42 sta temp1 3633 27391 4a lsr 3634 27392 65 42 adc temp1 3635 27394 6a ror 3636 27395 4a lsr 3637 27396 4a lsr 3638 27397 65 42 adc temp1 3639 27399 6a ror 3640 2739a 65 42 adc temp1 3641 2739c 6a ror 3642 2739d 4a lsr 3643 2739e 29 3c and #$3C 3644 273a0 85 43 sta temp2 3645 273a2 4a lsr 3646 273a3 65 43 adc temp2 3647 273a5 65 42 adc temp1 3648 273a7 60 rts ; return the result in the accumulator 3649 273a8 3650 273a8 ; Y and A contain multiplicands, result in A 3651 273a8 mul8 3652 273a8 84 42 sty temp1 3653 273aa 85 43 sta temp2 3654 273ac a9 00 lda #0 3655 273ae reptmul8 3656 273ae 46 43 lsr temp2 3657 273b0 90 03 bcc skipmul8 3658 273b2 18 clc 3659 273b3 65 42 adc temp1 3660 273b5 ;bcs donemul8 might save cycles? 3661 273b5 skipmul8 3662 273b5 ;beq donemul8 might save cycles? 3663 273b5 06 42 asl temp1 3664 273b7 d0 f5 bne reptmul8 3665 273b9 donemul8 3666 273b9 60 rts 3667 273ba 3668 273ba div8 3669 273ba ; A=numerator Y=denominator, result in A 3670 273ba c0 02 cpy #2 3671 273bc 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 3672 273be 84 42 sty temp1 3673 273c0 a0 ff ldy #$ff 3674 273c2 div8loop 3675 273c2 e5 42 sbc temp1 3676 273c4 c8 iny 3677 273c5 b0 fb bcs div8loop 3678 273c7 div8end 3679 273c7 98 tya 3680 273c8 ; result in A 3681 273c8 60 rts 3682 273c9 3683 273c9 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 3684 273c9 mul16 3685 273c9 84 42 sty temp1 3686 273cb 85 43 sta temp2 3687 273cd 3688 273cd a9 00 lda #0 3689 273cf a2 08 ldx #8 3690 273d1 46 42 lsr temp1 3691 273d3 mul16_1 3692 273d3 90 03 bcc mul16_2 3693 273d5 18 clc 3694 273d6 65 43 adc temp2 3695 273d8 mul16_2 3696 273d8 6a ror 3697 273d9 66 42 ror temp1 3698 273db ca dex 3699 273dc d0 f5 bne mul16_1 3700 273de 85 43 sta temp2 3701 273e0 60 rts 3702 273e1 3703 273e1 ; div int/int 3704 273e1 ; numerator in A, denom in temp1 3705 273e1 ; returns with quotient in A, remainder in temp1 3706 273e1 div16 3707 273e1 85 43 sta temp2 3708 273e3 84 42 sty temp1 3709 273e5 a9 00 lda #0 3710 273e7 a2 08 ldx #8 3711 273e9 06 43 asl temp2 3712 273eb div16_1 3713 273eb 2a rol 3714 273ec c5 42 cmp temp1 3715 273ee 90 02 bcc div16_2 3716 273f0 e5 42 sbc temp1 3717 273f2 div16_2 3718 273f2 26 43 rol temp2 3719 273f4 ca dex 3720 273f5 d0 f4 bne div16_1 3721 273f7 85 42 sta temp1 3722 273f9 a5 43 lda temp2 3723 273fb 60 rts 3724 273fc 3725 273fc ifconst bankswitchmode 3726 273fc BS_jsr 3727 273fc - ifconst dumpbankswitch 3728 273fc - sta dumpbankswitch 3729 273fc endif 3730 273fc - ifconst MCPDEVCART 3731 273fc - ora #$18 3732 273fc - sta $3000 3733 273fc else 3734 273fc 8d 00 80 sta $8000 3735 273ff endif 3736 273ff 68 pla 3737 27400 aa tax 3738 27401 68 pla 3739 27402 60 rts 3740 27403 3741 27403 BS_return 3742 27403 68 pla ; bankswitch bank 3743 27404 - ifconst dumpbankswitch 3744 27404 - sta dumpbankswitch 3745 27404 endif 3746 27404 - ifconst BANKRAM 3747 27404 - sta currentbank 3748 27404 - ora currentrambank 3749 27404 endif 3750 27404 - ifconst MCPDEVCART 3751 27404 - ora #$18 3752 27404 - sta $3000 3753 27404 else 3754 27404 8d 00 80 sta $8000 3755 27407 endif 3756 27407 68 pla ; bankswitch $0 flag 3757 27408 60 rts 3758 27409 endif 3759 27409 3760 27409 checkselectswitch 3761 27409 ad 82 02 lda SWCHB ; first check the real select switch... 3762 2740c 29 02 and #%00000010 3763 2740e ifnconst MOUSESUPPORT 3764 2740e f0 05 beq checkselectswitchreturn ; switch is pressed 3765 27410 ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 3766 27413 29 b0 and #%10110000 ; R_DU 3767 27415 endif ; MOUSESUPPORT 3768 27415 checkselectswitchreturn 3769 27415 60 rts 3770 27416 3771 27416 checkresetswitch 3772 27416 ad 82 02 lda SWCHB ; first check the real reset switch... 3773 27419 29 01 and #%00000001 3774 2741b ifnconst MOUSESUPPORT 3775 2741b f0 05 beq checkresetswitchreturn ; switch is pressed 3776 2741d ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 3777 27420 29 70 and #%01110000 ; _LDU 3778 27422 endif ; MOUSESUPPORT 3779 27422 checkresetswitchreturn 3780 27422 60 rts 3781 27423 3782 27423 - ifconst FINESCROLLENABLED 3783 27423 -finescrolldlls 3784 27423 - ldx temp1 ; first DLL index x3 3785 27423 - lda DLLMEM,x 3786 27423 - and #%11110000 3787 27423 - ora finescrolly 3788 27423 - sta DLLMEM,x 3789 27423 - 3790 27423 - ldx temp2 ; last DLL index x3 3791 27423 - lda DLLMEM,x 3792 27423 - and #%11110000 3793 27423 - ora finescrolly 3794 27423 - eor #(WZONEHEIGHT-1) 3795 27423 - sta DLLMEM,x 3796 27423 - rts 3797 27423 endif ; FINESCROLLENABLED 3798 27423 3799 27423 - ifconst USED_ADJUSTVISIBLE 3800 27423 -adjustvisible 3801 27423 - ; called with temp1=first visible zone *3, temp2=last visible zone *3 3802 27423 - jsr waitforvblankstart ; ensure vblank just started 3803 27423 - ldx visibleDLLstart 3804 27423 -findfirstinterrupt 3805 27423 - lda DLLMEM,x 3806 27423 - bmi foundfirstinterrupt 3807 27423 - inx 3808 27423 - inx 3809 27423 - inx 3810 27423 - bne findfirstinterrupt 3811 27423 -foundfirstinterrupt 3812 27423 - and #%01111111 ; clear the interrupt bit 3813 27423 - sta DLLMEM,x 3814 27423 - ifconst DOUBLEBUFFER 3815 27423 - sta DLLMEM+DBOFFSET,x 3816 27423 - endif ; DOUBLEBUFFER 3817 27423 - ldx overscanDLLstart 3818 27423 -findlastinterrupt 3819 27423 - lda DLLMEM,x 3820 27423 - bmi foundlastinterrupt 3821 27423 - dex 3822 27423 - dex 3823 27423 - dex 3824 27423 - bne findlastinterrupt 3825 27423 -foundlastinterrupt 3826 27423 - and #%01111111 ; clear the interrupt bit 3827 27423 - sta DLLMEM,x 3828 27423 - ifconst DOUBLEBUFFER 3829 27423 - sta DLLMEM+DBOFFSET,x 3830 27423 - endif ; DOUBLEBUFFER 3831 27423 - ;now we need to set the new interrupts 3832 27423 - clc 3833 27423 - lda temp1 3834 27423 - adc visibleDLLstart 3835 27423 - tax 3836 27423 - lda DLLMEM,x 3837 27423 - ora #%10000000 3838 27423 - sta DLLMEM,x 3839 27423 - ifconst DOUBLEBUFFER 3840 27423 - sta DLLMEM+DBOFFSET,x 3841 27423 - endif ; DOUBLEBUFFER 3842 27423 - clc 3843 27423 - lda temp2 3844 27423 - adc visibleDLLstart 3845 27423 - tax 3846 27423 - lda DLLMEM,x 3847 27423 - ora #%10000000 3848 27423 - sta DLLMEM,x 3849 27423 - ifconst DOUBLEBUFFER 3850 27423 - sta DLLMEM+DBOFFSET,x 3851 27423 - endif ; DOUBLEBUFFER 3852 27423 - jsr vblankresync 3853 27423 - rts 3854 27423 endif ; USED_ADJUSTVISIBLE 3855 27423 3856 27423 vblankresync 3857 27423 20 c1 f4 jsr waitforvblankstart ; ensure vblank just started 3858 27426 a9 00 lda #0 3859 27428 85 4d sta visibleover 3860 2742a a9 03 lda #3 3861 2742c 8d b2 01 sta interruptindex 3862 2742f 60 rts 3863 27430 3864 27430 createallgamedlls 3865 27430 a2 00 ldx #0 3866 27432 a9 19 lda #NVLINES 3867 27434 ac 09 21 ldy paldetected 3868 27437 f0 03 beq skipcreatePALpadding 3869 27439 18 clc 3870 2743a 69 15 adc #21 3871 2743c skipcreatePALpadding 3872 2743c 20 71 f4 jsr createnonvisibledlls 3873 2743f 8e 3c 21 stx visibleDLLstart 3874 27442 20 a2 f4 jsr createvisiblezones 3875 27445 8e 3d 21 stx overscanDLLstart 3876 27448 createallgamedllscontinue 3877 27448 a9 50 lda #(NVLINES+55) ; extras for PAL 3878 2744a 20 71 f4 jsr createnonvisibledlls 3879 2744d 3880 2744d ae 3c 21 ldx visibleDLLstart 3881 27450 bd 00 18 lda DLLMEM,x 3882 27453 09 80 ora #%10000000 ; NMI 1 - start of visible screen 3883 27455 9d 00 18 sta DLLMEM,x 3884 27458 - ifconst DOUBLEBUFFER 3885 27458 - sta DLLMEM+DBOFFSET,x 3886 27458 endif ; DOUBLEBUFFER 3887 27458 3888 27458 ae 3d 21 ldx overscanDLLstart 3889 2745b bd 00 18 lda DLLMEM,x 3890 2745e 09 83 ora #%10000011 ; NMI 2 - end of visible screen 3891 27460 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 3892 27462 9d 00 18 sta DLLMEM,x 3893 27465 - ifconst DOUBLEBUFFER 3894 27465 - sta DLLMEM+DBOFFSET,x 3895 27465 endif ; DOUBLEBUFFER 3896 27465 3897 27465 e8 inx 3898 27466 e8 inx 3899 27467 e8 inx 3900 27468 3901 27468 bd 00 18 lda DLLMEM,x 3902 2746b 09 80 ora #%10000000 ; NMI 3 - deeper overscan 3903 2746d 9d 00 18 sta DLLMEM,x 3904 27470 - ifconst DOUBLEBUFFER 3905 27470 - sta DLLMEM+DBOFFSET,x 3906 27470 endif ; DOUBLEBUFFER 3907 27470 3908 27470 60 rts 3909 27471 3910 27471 createnonvisibledlls 3911 27471 85 42 sta temp1 3912 27473 4a lsr 3913 27474 4a lsr 3914 27475 4a lsr 3915 27476 4a lsr ; /16 3916 27477 f0 09 beq skipcreatenonvisibledlls1loop 3917 27479 a8 tay 3918 2747a createnonvisibledlls1loop 3919 2747a a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 3920 2747c 20 91 f4 jsr createblankdllentry 3921 2747f 88 dey 3922 27480 d0 f8 bne createnonvisibledlls1loop 3923 27482 skipcreatenonvisibledlls1loop 3924 27482 a5 42 lda temp1 3925 27484 29 0f and #%00001111 3926 27486 f0 08 beq createnonvisibledllsreturn 3927 27488 38 sec 3928 27489 e9 01 sbc #1 3929 2748b 09 40 ora #%01000000 3930 2748d 20 91 f4 jsr createblankdllentry 3931 27490 createnonvisibledllsreturn 3932 27490 60 rts 3933 27491 3934 27491 createblankdllentry 3935 27491 9d 00 18 sta DLLMEM,x 3936 27494 - ifconst DOUBLEBUFFER 3937 27494 - sta DLLMEM+DBOFFSET,x 3938 27494 endif ; DOUBLEBUFFER 3939 27494 e8 inx 3940 27495 a9 21 lda #$21 ; blank 3941 27497 9d 00 18 sta DLLMEM,x 3942 2749a - ifconst DOUBLEBUFFER 3943 2749a - sta DLLMEM+DBOFFSET,x 3944 2749a endif ; DOUBLEBUFFER 3945 2749a e8 inx 3946 2749b a9 00 lda #$00 3947 2749d 9d 00 18 sta DLLMEM,x 3948 274a0 - ifconst DOUBLEBUFFER 3949 274a0 - sta DLLMEM+DBOFFSET,x 3950 274a0 endif ; DOUBLEBUFFER 3951 274a0 e8 inx 3952 274a1 60 rts 3953 274a2 3954 274a2 createvisiblezones 3955 274a2 a0 00 ldy #0 3956 274a4 createvisiblezonesloop 3957 274a4 b9 24 f6 lda.w DLHEIGHT,y 3958 274a7 09 20 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 3959 274a9 9d 00 18 sta DLLMEM,x 3960 274ac - ifconst DOUBLEBUFFER 3961 274ac - sta DLLMEM+DBOFFSET,x 3962 274ac endif ; DOUBLEBUFFER 3963 274ac e8 inx 3964 274ad b9 f4 f5 lda DLPOINTH,y 3965 274b0 9d 00 18 sta DLLMEM,x 3966 274b3 - ifconst DOUBLEBUFFER 3967 274b3 - sta DLLMEM+DBOFFSET,x 3968 274b3 endif ; DOUBLEBUFFER 3969 274b3 e8 inx 3970 274b4 b9 0c f6 lda DLPOINTL,y 3971 274b7 9d 00 18 sta DLLMEM,x 3972 274ba - ifconst DOUBLEBUFFER 3973 274ba - clc 3974 274ba - adc #DOUBLEBUFFEROFFSET 3975 274ba - sta DLLMEM+DBOFFSET,x 3976 274ba - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 3977 274ba - inc DLLMEM+DBOFFSET-1,x 3978 274ba -skiphidoublebufferadjust 3979 274ba endif ; DOUBLEBUFFER 3980 274ba e8 inx 3981 274bb c8 iny 3982 274bc c0 18 cpy #WZONECOUNT 3983 274be d0 e4 bne createvisiblezonesloop 3984 274c0 60 rts 3985 274c1 3986 274c1 waitforvblankstart 3987 274c1 vblankendwait 3988 274c1 24 28 BIT MSTAT 3989 274c3 30 fc bmi vblankendwait 3990 274c5 vblankstartwait 3991 274c5 24 28 BIT MSTAT 3992 274c7 10 fc bpl vblankstartwait 3993 274c9 60 rts 3994 274ca 3995 274ca - ifconst DOUBLEBUFFER 3996 274ca -flipdisplaybufferreturn 3997 274ca - rts 3998 274ca -flipdisplaybuffer 3999 274ca - ifconst interrupthold 4000 274ca - lda #$FF 4001 274ca - sta interrupthold 4002 274ca - endif 4003 274ca - lda doublebufferstate 4004 274ca - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 4005 274ca - 4006 274ca - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 4007 274ca - 4008 274ca - lda doublebufferstate 4009 274ca - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 4010 274ca - tax 4011 274ca - 4012 274ca - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 4013 274ca - 4014 274ca -flipdisplaybufferwait1 4015 274ca - lda visibleover 4016 274ca - beq flipdisplaybufferwait1 4017 274ca - 4018 274ca -flipdisplaybufferwait 4019 274ca - lda visibleover 4020 274ca - bne flipdisplaybufferwait 4021 274ca - 4022 274ca - lda doublebufferminimumframetarget 4023 274ca - beq skipminimumframecode 4024 274ca - lda doublebufferminimumframeindex 4025 274ca - bne flipdisplaybufferwait1 4026 274ca - lda doublebufferminimumframetarget 4027 274ca - sta doublebufferminimumframeindex 4028 274ca -skipminimumframecode 4029 274ca - 4030 274ca - lda DLLMEMLutHi,x 4031 274ca - sta DPPH 4032 274ca - lda DLLMEMLutLo,x 4033 274ca - sta DPPL 4034 274ca - 4035 274ca - lda NewPageflipstate,x 4036 274ca - sta doublebufferstate 4037 274ca - lda NewPageflipoffset,x 4038 274ca - sta doublebufferdloffset 4039 274ca - 4040 274ca - lda doublebufferbufferdirty 4041 274ca - beq flipdisplaybufferreturn 4042 274ca - 4043 274ca - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 4044 274ca - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 4045 274ca - ; from the displayed buffer to the working buffer... 4046 274ca - 4047 274ca - lda doublebufferdloffset 4048 274ca - eor #DOUBLEBUFFEROFFSET 4049 274ca - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 4050 274ca - 4051 274ca - ldx #(WZONECOUNT-1) 4052 274ca -copybufferzoneloop 4053 274ca - 4054 274ca - lda DLPOINTL,x 4055 274ca - clc 4056 274ca - adc doublebufferdloffset 4057 274ca - sta temp1 4058 274ca - lda DLPOINTH,x 4059 274ca - adc #0 4060 274ca - sta temp2 4061 274ca - 4062 274ca - lda DLPOINTL,x 4063 274ca - clc 4064 274ca - adc temp6 4065 274ca - sta temp3 4066 274ca - lda DLPOINTH,x 4067 274ca - adc #0 4068 274ca - sta temp4 4069 274ca - 4070 274ca - lda dlendsave,x 4071 274ca - tay 4072 274ca -copybuffercharsloop 4073 274ca - lda (temp3),y 4074 274ca - sta (temp1),y 4075 274ca - dey 4076 274ca - bpl copybuffercharsloop 4077 274ca - dex 4078 274ca - bpl copybufferzoneloop 4079 274ca - lda #0 4080 274ca - sta doublebufferbufferdirty 4081 274ca - rts 4082 274ca - 4083 274ca -doublebufferoff 4084 274ca - lda #1 4085 274ca - sta doublebufferstate 4086 274ca - jsr flipdisplaybuffer 4087 274ca - lda #0 4088 274ca - sta doublebufferstate 4089 274ca - sta doublebufferdloffset 4090 274ca - rts 4091 274ca - 4092 274ca -DLLMEMLutLo 4093 274ca - .byte DLLMEM,>(DLLMEM+DBOFFSET) 4096 274ca -NewPageflipstate 4097 274ca - .byte 3,1 4098 274ca -NewPageflipoffset 4099 274ca - .byte DOUBLEBUFFEROFFSET,0 4100 274ca - 4101 274ca endif ; DOUBLEBUFFER 4102 274ca 4103 274ca - ifconst MOUSESUPPORT 4104 274ca - 4105 274ca -rotationalcompare 4106 274ca - ; old = 00 01 10 11 4107 274ca - .byte $00, $01, $ff, $00 ; new=00 4108 274ca - .byte $ff, $00, $00, $01 ; new=01 4109 274ca - .byte $01, $00, $00, $ff ; new=10 4110 274ca - .byte $00, $ff, $01, $00 ; new=11 4111 274ca - 4112 274ca - ; 0000YyXx st mouse 4113 274ca - 4114 274ca - ; 0000xyXY amiga mouse 4115 274ca - 4116 274ca - ifconst MOUSEXONLY 4117 274ca -amigatoataribits ; swap bits 1 and 4... 4118 274ca - .byte %0000, %0000, %0010, %0010 4119 274ca - .byte %0000, %0000, %0010, %0010 4120 274ca - .byte %0001, %0001, %0011, %0011 4121 274ca - .byte %0001, %0001, %0011, %0011 4122 274ca - 4123 274ca - ; null change bits 4124 274ca - .byte %0000, %0001, %0010, %0011 4125 274ca - .byte %0000, %0001, %0010, %0011 4126 274ca - .byte %0000, %0001, %0010, %0011 4127 274ca - .byte %0000, %0001, %0010, %0011 4128 274ca - 4129 274ca - else ; !MOUSEXONLY 4130 274ca - 4131 274ca -amigatoataribits ; swap bits 1 and 4... 4132 274ca - .byte %0000, %1000, %0010, %1010 4133 274ca - .byte %0100, %1100, %0110, %1110 4134 274ca - .byte %0001, %1001, %0011, %1011 4135 274ca - .byte %0101, %1101, %0111, %1111 4136 274ca - ; null change bits 4137 274ca - .byte %0000, %0001, %0010, %0011 4138 274ca - .byte %0100, %0101, %0110, %0111 4139 274ca - .byte %1000, %1001, %1010, %1011 4140 274ca - .byte %1100, %1101, %1110, %1111 4141 274ca - endif ; !MOUSEXONLY 4142 274ca - 4143 274ca endif ; MOUSESUPPORT 4144 274ca 4145 274ca mouse0update 4146 274ca - ifconst MOUSE0SUPPORT 4147 274ca - 4148 274ca -mousetableselect = inttemp2 4149 274ca -mousexdelta = inttemp3 4150 274ca -mouseydelta = inttemp4 4151 274ca -lastSWCHA = inttemp6 4152 274ca - 4153 274ca - ; 0000YyXx st mouse 4154 274ca - ; 0000xyXY amiga mouse 4155 274ca - 4156 274ca - lda #$ff 4157 274ca - sta lastSWCHA 4158 274ca - 4159 274ca - ldy port0control 4160 274ca - 4161 274ca - lda #%00010000 4162 274ca - cpy #9 ; AMIGA? 4163 274ca - bne skipamigabitsfix0 4164 274ca - lda #0 4165 274ca -skipamigabitsfix0 4166 274ca - sta mousetableselect 4167 274ca - ifconst DRIVINGBOOST 4168 274ca - cpy #6 ; DRIVING? 4169 274ca - bne skipdriving0setup 4170 274ca - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 4171 274ca - ; trails the actual mousex0, so we can smoothly interpolate toward 4172 274ca - ; the actual position. This actual position is stored in mousey0 4173 274ca - ; after the driver has run. 4174 274ca - ldx mousex0 4175 274ca - lda mousey0 4176 274ca - stx mousey0 4177 274ca - sta mousex0 4178 274ca -skipdriving0setup 4179 274ca - endif ; DRIVINGBOOST 4180 274ca - 4181 274ca - lda #0 4182 274ca - sta mousexdelta 4183 274ca - sta mouseydelta 4184 274ca - 4185 274ca - ifnconst MOUSETIME 4186 274ca - ifnconst MOUSEXONLY 4187 274ca - lda #180 ; minimum for x+y 4188 274ca - else 4189 274ca - lda #100 ; minimum for just x 4190 274ca - endif 4191 274ca - else 4192 274ca - lda #MOUSETIME 4193 274ca - endif 4194 274ca - jsr SETTIM64T ; INTIM is in Y 4195 274ca - 4196 274ca -mouse0updateloop 4197 274ca - lda SWCHA 4198 274ca - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 4199 274ca - cmp lastSWCHA 4200 274ca - beq mouse0loopcondition 4201 274ca - sta lastSWCHA 4202 274ca - lsr 4203 274ca - lsr 4204 274ca - lsr 4205 274ca - 4206 274ca - ora mousetableselect ; atari/amiga decoding table selection 4207 274ca - 4208 274ca - ; st mice encode on different bits/joystick-lines than amiga mice... 4209 274ca - ; 0000YyXx st mouse 4210 274ca - ; 0000xyXY amiga mouse 4211 274ca - ; ...so can shuffle the amiga bits to reuse the st driver. 4212 274ca - tay 4213 274ca - lax amigatoataribits,y 4214 274ca - 4215 274ca - ifnconst MOUSEXONLY 4216 274ca - ; first the Y... 4217 274ca - and #%00001100 4218 274ca - ora mousecodey0 4219 274ca - tay 4220 274ca - lda rotationalcompare,y 4221 274ca - clc 4222 274ca - adc mouseydelta 4223 274ca - sta mouseydelta 4224 274ca - tya 4225 274ca - lsr 4226 274ca - lsr 4227 274ca - sta mousecodey0 4228 274ca - txa 4229 274ca - ; ...then the X... 4230 274ca - and #%00000011 4231 274ca - tax 4232 274ca - endif ; !MOUSEXONLY 4233 274ca - 4234 274ca - asl 4235 274ca - asl 4236 274ca - ora mousecodex0 4237 274ca - tay 4238 274ca - lda rotationalcompare,y 4239 274ca - adc mousexdelta ; carry was clear by previous ASL 4240 274ca - sta mousexdelta 4241 274ca - stx mousecodex0 4242 274ca -mouse0loopcondition 4243 274ca - lda TIMINT 4244 274ca - bpl mouse0updateloop 4245 274ca - 4246 274ca - ; *** adapt to selected device resolution. 4247 274ca - ldx port0control 4248 274ca - 4249 274ca - ifconst PRECISIONMOUSING 4250 274ca - ldy port0resolution 4251 274ca - bne mouse0halveddone 4252 274ca - cpx #6 ; half-resolution is no good for driving wheels 4253 274ca - beq mouse0halveddone 4254 274ca - ; resolution=0 is half mouse resolution, necessary for precision 4255 274ca - ; mousing on a 160x240 screen with a 1000 dpi mouse. 4256 274ca - 4257 274ca - lda mousexdelta 4258 274ca - cmp #$80 4259 274ca - ror ; do a signed divide by 2. 4260 274ca - clc 4261 274ca - adc mousex0 4262 274ca - sta mousex0 4263 274ca - ifnconst MOUSEXONLY 4264 274ca - lda mouseydelta 4265 274ca - clc 4266 274ca - adc mousey0 4267 274ca - sta mousey0 4268 274ca - endif 4269 274ca - ; at half resolution we just exit after updating x and y 4270 274ca - jmp LLRET0 4271 274ca -mouse0halveddone 4272 274ca - endif ; PRECISIONMOUSING 4273 274ca - 4274 274ca - ifnconst MOUSEXONLY 4275 274ca - asl mouseydelta ; *2 because Y resolution is finer 4276 274ca - ldy port0resolution 4277 274ca - dey 4278 274ca - lda #0 4279 274ca -mousey0resolutionfix 4280 274ca - clc 4281 274ca - adc mouseydelta 4282 274ca - dey 4283 274ca - bpl mousey0resolutionfix 4284 274ca - clc 4285 274ca - adc mousey0 4286 274ca - sta mousey0 4287 274ca - endif ; MOUSEXONLY 4288 274ca - 4289 274ca - ldy port0resolution 4290 274ca - dey 4291 274ca - lda #0 4292 274ca -mousex0resolutionfix 4293 274ca - clc 4294 274ca - adc mousexdelta 4295 274ca - dey 4296 274ca - bpl mousex0resolutionfix 4297 274ca - ifnconst DRIVINGBOOST 4298 274ca - clc 4299 274ca - adc mousex0 4300 274ca - sta mousex0 4301 274ca - else 4302 274ca - cpx #6 4303 274ca - beq carryonmouse0boost 4304 274ca - clc 4305 274ca - adc mousex0 4306 274ca - sta mousex0 4307 274ca - jmp LLRET0 4308 274ca -carryonmouse0boost 4309 274ca - sta mousexdelta 4310 274ca - clc 4311 274ca - adc mousecodey0 4312 274ca - sta mousecodey0 4313 274ca - clc 4314 274ca - adc mousex0 4315 274ca - tay ; save the target X 4316 274ca - adc mousey0 ; average in the smoothly-trailing X 4317 274ca - ror 4318 274ca - sta mousex0 ; mousex0 now has the smoothly trailing X 4319 274ca - sty mousey0 ; and mousey0 has the the target X 4320 274ca - 4321 274ca - ; check to see if the coordinate wrapped. If so, undo the averaging code. 4322 274ca - ; A has mousex0, the smoothly trailing X 4323 274ca - sbc mousey0 ; less the target X 4324 274ca - bpl skipabsolutedrive0 4325 274ca - eor #$ff 4326 274ca -skipabsolutedrive0 4327 274ca - cmp #64 ; just an unreasonably large change 4328 274ca - bcc skipdrivewrapfix0 4329 274ca - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 4330 274ca -skipdrivewrapfix0 4331 274ca - 4332 274ca - ; get rid of the tweening if the distance travelled was very small 4333 274ca - lda mousexdelta 4334 274ca - cmp port0resolution 4335 274ca - bcs skipbetweenfix0 4336 274ca - lda mousex0 4337 274ca - sta mousey0 4338 274ca -skipbetweenfix0 4339 274ca - 4340 274ca -drivingboostreductioncheck0 4341 274ca - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 4342 274ca - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 4343 274ca - ; negated again because truncation during BCD math results in 4344 274ca - ; differing magnitudes, depending if the value is +ve or -ve. 4345 274ca -driving0fix 4346 274ca - lax mousecodey0 4347 274ca - cmp #$80 4348 274ca - bcs driving0skipnegate1 4349 274ca - eor #$FF 4350 274ca - adc #1 4351 274ca - sta mousecodey0 4352 274ca -driving0skipnegate1 4353 274ca - cmp #$80 4354 274ca - ror 4355 274ca - cmp #$80 4356 274ca - ror 4357 274ca - cmp #$80 4358 274ca - ror 4359 274ca - sta inttemp1 4360 274ca - lda mousecodey0 4361 274ca - sec 4362 274ca - sbc inttemp1 4363 274ca - cpx #$80 4364 274ca - bcs driving0skipnegate2 4365 274ca - eor #$FF 4366 274ca - adc #1 4367 274ca -driving0skipnegate2 4368 274ca - sta mousecodey0 4369 274ca -drivingboostdone0 4370 274ca - endif ; DRIVINGBOOST 4371 274ca - 4372 274ca - jmp LLRET0 4373 274ca - 4374 274ca endif ; MOUSE0SUPPORT 4375 274ca 4376 274ca mouse1update 4377 274ca - ifconst MOUSE1SUPPORT 4378 274ca - 4379 274ca -mousetableselect = inttemp2 4380 274ca -mousexdelta = inttemp3 4381 274ca -mouseydelta = inttemp4 4382 274ca -lastSWCHA = inttemp6 4383 274ca - 4384 274ca - ; 0000YyXx st mouse 4385 274ca - ; 0000xyXY amiga mouse 4386 274ca - 4387 274ca - lda #$ff 4388 274ca - sta lastSWCHA 4389 274ca - 4390 274ca - ldy port1control 4391 274ca - 4392 274ca - lda #%00010000 4393 274ca - cpy #9 ; AMIGA? 4394 274ca - bne skipamigabitsfix1 4395 274ca - lda #0 4396 274ca -skipamigabitsfix1 4397 274ca - sta mousetableselect 4398 274ca - ifconst DRIVINGBOOST 4399 274ca - cpy #6 ; DRIVING? 4400 274ca - bne skipdriving1setup 4401 274ca - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 4402 274ca - ; trails the actual mousex1, so we can smoothly interpolate toward 4403 274ca - ; the actual position. This actual position is stored in mousey1 4404 274ca - ; after the driver has run. 4405 274ca - ldx mousex1 4406 274ca - lda mousey1 4407 274ca - stx mousey1 4408 274ca - sta mousex1 4409 274ca -skipdriving1setup 4410 274ca - endif ; DRIVINGBOOST 4411 274ca - 4412 274ca - lda #0 4413 274ca - sta mousexdelta 4414 274ca - sta mouseydelta 4415 274ca - 4416 274ca - ifnconst MOUSETIME 4417 274ca - ifnconst MOUSEXONLY 4418 274ca - lda #180 ; minimum for x+y 4419 274ca - else 4420 274ca - lda #100 ; minimum for just x 4421 274ca - endif 4422 274ca - else 4423 274ca - lda #MOUSETIME 4424 274ca - endif 4425 274ca - jsr SETTIM64T ; INTIM is in Y 4426 274ca - 4427 274ca -mouse1updateloop 4428 274ca - lda SWCHA 4429 274ca - and #%00001111 4430 274ca - cmp lastSWCHA 4431 274ca - beq mouse1loopcondition 4432 274ca - sta lastSWCHA 4433 274ca - 4434 274ca - ora mousetableselect ; atari/amiga decoding table selection 4435 274ca - 4436 274ca - ; st mice encode on different bits/joystick-lines than amiga mice... 4437 274ca - ; 0000YyXx st mouse 4438 274ca - ; 0000xyXY amiga mouse 4439 274ca - ; ...so can shuffle the amiga bits to reuse the st driver. 4440 274ca - tay 4441 274ca - lax amigatoataribits,y 4442 274ca - 4443 274ca - ifnconst MOUSEXONLY 4444 274ca - ; first the Y... 4445 274ca - and #%00001100 4446 274ca - ora mousecodey1 4447 274ca - tay 4448 274ca - lda rotationalcompare,y 4449 274ca - clc 4450 274ca - adc mouseydelta 4451 274ca - sta mouseydelta 4452 274ca - tya 4453 274ca - lsr 4454 274ca - lsr 4455 274ca - sta mousecodey1 4456 274ca - txa 4457 274ca - ; ...then the X... 4458 274ca - and #%00000011 4459 274ca - tax 4460 274ca - endif ; !MOUSEXONLY 4461 274ca - 4462 274ca - asl 4463 274ca - asl 4464 274ca - ora mousecodex1 4465 274ca - tay 4466 274ca - lda rotationalcompare,y 4467 274ca - adc mousexdelta ; carry was clear by previous ASL 4468 274ca - sta mousexdelta 4469 274ca - stx mousecodex1 4470 274ca -mouse1loopcondition 4471 274ca - lda TIMINT 4472 274ca - bpl mouse1updateloop 4473 274ca - 4474 274ca - ; *** adapt to selected device resolution. 4475 274ca - ldx port1control 4476 274ca - 4477 274ca - ifconst PRECISIONMOUSING 4478 274ca - ldy port1resolution 4479 274ca - bne mouse1halveddone 4480 274ca - cpx #6 ; half-resolution is no good for driving wheels 4481 274ca - beq mouse1halveddone 4482 274ca - ; resolution=0 is half mouse resolution, necessary for precision 4483 274ca - ; mousing on a 160x240 screen with a 1000 dpi mouse. 4484 274ca - 4485 274ca - lda mousexdelta 4486 274ca - cmp #$80 4487 274ca - ror ; do a signed divide by 2. 4488 274ca - clc 4489 274ca - adc mousex1 4490 274ca - sta mousex1 4491 274ca - ifnconst MOUSEXONLY 4492 274ca - lda mouseydelta 4493 274ca - clc 4494 274ca - adc mousey1 4495 274ca - sta mousey1 4496 274ca - endif 4497 274ca - ; at half resolution we just exit after updating x and y 4498 274ca - jmp LLRET1 4499 274ca -mouse1halveddone 4500 274ca - endif ; PRECISIONMOUSING 4501 274ca - 4502 274ca - ifnconst MOUSEXONLY 4503 274ca - asl mouseydelta ; *2 because Y resolution is finer 4504 274ca - ldy port1resolution 4505 274ca - dey 4506 274ca - lda #0 4507 274ca -mousey1resolutionfix 4508 274ca - clc 4509 274ca - adc mouseydelta 4510 274ca - dey 4511 274ca - bpl mousey1resolutionfix 4512 274ca - clc 4513 274ca - adc mousey1 4514 274ca - sta mousey1 4515 274ca - endif ; MOUSEXONLY 4516 274ca - 4517 274ca - ldy port1resolution 4518 274ca - dey 4519 274ca - lda #0 4520 274ca -mousex1resolutionfix 4521 274ca - clc 4522 274ca - adc mousexdelta 4523 274ca - dey 4524 274ca - bpl mousex1resolutionfix 4525 274ca - ifnconst DRIVINGBOOST 4526 274ca - clc 4527 274ca - adc mousex1 4528 274ca - sta mousex1 4529 274ca - else 4530 274ca - cpx #6 4531 274ca - beq carryonmouse1boost 4532 274ca - clc 4533 274ca - adc mousex1 4534 274ca - sta mousex1 4535 274ca - jmp LLRET1 4536 274ca -carryonmouse1boost 4537 274ca - sta mousexdelta 4538 274ca - clc 4539 274ca - adc mousecodey1 4540 274ca - sta mousecodey1 4541 274ca - clc 4542 274ca - adc mousex1 4543 274ca - tay ; save the target X 4544 274ca - adc mousey1 ; average in the smoothly-trailing X 4545 274ca - ror 4546 274ca - sta mousex1 ; mousex0 now has the smoothly trailing X 4547 274ca - sty mousey1 ; and mousey0 has the the target X 4548 274ca - 4549 274ca - ; check to see if the coordinate wrapped. If so, undo the averaging code. 4550 274ca - ; A has mousex1, the smoothly trailing X 4551 274ca - sbc mousey1 ; less the target X 4552 274ca - bpl skipabsolutedrive1 4553 274ca - eor #$ff 4554 274ca -skipabsolutedrive1 4555 274ca - cmp #64 ; just an unreasonably large change 4556 274ca - bcc skipdrivewrapfix1 4557 274ca - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 4558 274ca -skipdrivewrapfix1 4559 274ca - 4560 274ca - ; get rid of the tweening if the distance travelled was very small 4561 274ca - lda mousexdelta 4562 274ca - cmp port1resolution 4563 274ca - bcs skipbetweenfix1 4564 274ca - lda mousex1 4565 274ca - sta mousey1 4566 274ca -skipbetweenfix1 4567 274ca - 4568 274ca -drivingboostreductioncheck1 4569 274ca - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 4570 274ca - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 4571 274ca - ; negated again because truncation during BCD math results in 4572 274ca - ; differing magnitudes, depending if the value is +ve or -ve. 4573 274ca -driving1fix 4574 274ca - lax mousecodey1 4575 274ca - cmp #$80 4576 274ca - bcs driving0skipnegate1 4577 274ca - eor #$FF 4578 274ca - adc #1 4579 274ca - sta mousecodey1 4580 274ca -driving0skipnegate1 4581 274ca - cmp #$80 4582 274ca - ror 4583 274ca - cmp #$80 4584 274ca - ror 4585 274ca - cmp #$80 4586 274ca - ror 4587 274ca - sta inttemp1 4588 274ca - lda mousecodey1 4589 274ca - sec 4590 274ca - sbc inttemp1 4591 274ca - cpx #$80 4592 274ca - bcs driving1skipnegate2 4593 274ca - eor #$FF 4594 274ca - adc #1 4595 274ca -driving1skipnegate2 4596 274ca - sta mousecodey1 4597 274ca -drivingboostdone1 4598 274ca - endif ; DRIVINGBOOST 4599 274ca - 4600 274ca - jmp LLRET1 4601 274ca - 4602 274ca endif ; MOUSE1SUPPORT 4603 274ca 4604 274ca 4605 274ca trakball0update 4606 274ca - ifconst TRAKBALL0SUPPORT 4607 274ca - ifnconst TRAKTIME 4608 274ca - ifnconst TRAKXONLY 4609 274ca - lda #180 ; minimum for x+y 4610 274ca - else ; !TRAKXONLY 4611 274ca - lda #100 ; minimum for just x 4612 274ca - endif ; !TRAKXONLY 4613 274ca - else ; !TRAKTIME 4614 274ca - lda #TRAKTIME 4615 274ca - endif ; !TRAKTIME 4616 274ca - jsr SETTIM64T ; INTIM is in Y 4617 274ca - ldx #0 4618 274ca - ifnconst TRAKXONLY 4619 274ca - ldy #0 4620 274ca - endif ; TRAKXONLY 4621 274ca -trakball0updateloop 4622 274ca - lda SWCHA 4623 274ca - and #%00110000 4624 274ca - cmp trakballcodex0 4625 274ca - sta trakballcodex0 4626 274ca - beq trakball0movementXdone 4627 274ca - and #%00010000 4628 274ca - beq trakball0negativeX 4629 274ca -trakball0positiveX 4630 274ca - ;(2 from beq) 4631 274ca - inx ; 2 4632 274ca - jmp trakball0movementXdone ; 3 4633 274ca -trakball0negativeX 4634 274ca - ;(3 from beq) 4635 274ca - dex ; 2 4636 274ca - nop ; 2 4637 274ca -trakball0movementXdone 4638 274ca - 4639 274ca - ifnconst TRAKXONLY 4640 274ca - lda SWCHA 4641 274ca - and #%11000000 4642 274ca - cmp trakballcodey0 4643 274ca - sta trakballcodey0 4644 274ca - beq trakball0movementYdone 4645 274ca - and #%01000000 4646 274ca - beq trakball0negativeY 4647 274ca -trakball0positiveY 4648 274ca - ;(2 from beq) 4649 274ca - iny ; 2 4650 274ca - jmp trakball0movementYdone ; 3 4651 274ca -trakball0negativeY 4652 274ca - ;(3 from beq) 4653 274ca - dey ; 2 4654 274ca - nop ; 2 4655 274ca -trakball0movementYdone 4656 274ca - endif ; !TRAKXONLY 4657 274ca - 4658 274ca - lda TIMINT 4659 274ca - bpl trakball0updateloop 4660 274ca - lda #0 4661 274ca - cpx #0 4662 274ca - beq trakball0skipXadjust 4663 274ca - clc 4664 274ca -trakball0Xloop 4665 274ca - adc port0resolution 4666 274ca - dex 4667 274ca - bne trakball0Xloop 4668 274ca - clc 4669 274ca - adc trakballx0 4670 274ca - sta trakballx0 4671 274ca -trakball0skipXadjust 4672 274ca - ifnconst TRAKXONLY 4673 274ca - lda #0 4674 274ca - cpy #0 4675 274ca - beq trakball0skipYadjust 4676 274ca - clc 4677 274ca -trakball0yloop 4678 274ca - adc port0resolution 4679 274ca - dey 4680 274ca - bne trakball0yloop 4681 274ca - clc 4682 274ca - adc trakbally0 4683 274ca - sta trakbally0 4684 274ca -trakball0skipYadjust 4685 274ca - endif ; !TRAKXONLY 4686 274ca - 4687 274ca - jmp LLRET0 4688 274ca endif 4689 274ca 4690 274ca 4691 274ca 4692 274ca trakball1update 4693 274ca - ifconst TRAKBALL1SUPPORT 4694 274ca - ifnconst TRAKTIME 4695 274ca - ifnconst TRAKXONLY 4696 274ca - lda #180 ; minimum for x+y 4697 274ca - else ; !TRAKXONLY 4698 274ca - lda #100 ; minimum for just x 4699 274ca - endif ; !TRAKXONLY 4700 274ca - else ; !TRAKTIME 4701 274ca - lda #TRAKTIME 4702 274ca - endif ; !TRAKTIME 4703 274ca - jsr SETTIM64T ; INTIM is in Y 4704 274ca - ldx #0 4705 274ca - ifnconst TRAKXONLY 4706 274ca - ldy #0 4707 274ca - endif ; TRAKXONLY 4708 274ca -trakball1updateloop 4709 274ca - lda SWCHA 4710 274ca - and #%00000011 4711 274ca - cmp trakballcodex1 4712 274ca - sta trakballcodex1 4713 274ca - beq trakball1movementXdone 4714 274ca - and #%00000001 4715 274ca - beq trakball1negativeX 4716 274ca -trakball1positiveX 4717 274ca - ;(2 from beq) 4718 274ca - inx ; 2 4719 274ca - jmp trakball1movementXdone ; 3 4720 274ca -trakball1negativeX 4721 274ca - ;(3 from beq) 4722 274ca - dex ; 2 4723 274ca - nop ; 2 4724 274ca -trakball1movementXdone 4725 274ca - 4726 274ca - ifnconst TRAKXONLY 4727 274ca - lda SWCHA 4728 274ca - and #%00001100 4729 274ca - cmp trakballcodey1 4730 274ca - sta trakballcodey1 4731 274ca - beq trakball1movementYdone 4732 274ca - and #%00000100 4733 274ca - beq trakball1negativeY 4734 274ca -trakball1positiveY 4735 274ca - ;(2 from beq) 4736 274ca - iny ; 2 4737 274ca - jmp trakball1movementYdone ; 3 4738 274ca -trakball1negativeY 4739 274ca - ;(3 from beq) 4740 274ca - dey ; 2 4741 274ca - nop ; 2 4742 274ca -trakball1movementYdone 4743 274ca - endif ; !TRAKXONLY 4744 274ca - 4745 274ca - lda TIMINT 4746 274ca - bpl trakball1updateloop 4747 274ca - lda #0 4748 274ca - cpx #0 4749 274ca - beq trakball1skipXadjust 4750 274ca - clc 4751 274ca -trakball1Xloop 4752 274ca - adc port1resolution 4753 274ca - dex 4754 274ca - bne trakball1Xloop 4755 274ca - clc 4756 274ca - adc trakballx1 4757 274ca - sta trakballx1 4758 274ca -trakball1skipXadjust 4759 274ca - ifnconst TRAKXONLY 4760 274ca - lda #0 4761 274ca - cpy #0 4762 274ca - beq trakball1skipYadjust 4763 274ca - clc 4764 274ca -trakball1yloop 4765 274ca - adc port1resolution 4766 274ca - dey 4767 274ca - bne trakball1yloop 4768 274ca - clc 4769 274ca - adc trakbally1 4770 274ca - sta trakbally1 4771 274ca -trakball1skipYadjust 4772 274ca - endif ; !TRAKXONLY 4773 274ca - 4774 274ca - jmp LLRET1 4775 274ca endif 4776 274ca 4777 274ca 4778 274ca paddleport0update 4779 274ca - ifconst PADDLE0SUPPORT 4780 274ca - lda #6 4781 274ca - sta VBLANK ; start charging the paddle caps 4782 274ca - lda #0 ; use PADDLE timing 4783 274ca - jsr SETTIM64T ; INTIM is in Y 4784 274ca - 4785 274ca -paddleport0updateloop 4786 274ca - lda INPT0 4787 274ca - bmi skippaddle0setposition 4788 274ca - sty paddleposition0 4789 274ca -skippaddle0setposition 4790 274ca - ifconst TWOPADDLESUPPORT 4791 274ca - lda INPT1 4792 274ca - bmi skippaddle1setposition 4793 274ca - sty paddleposition1 4794 274ca -skippaddle1setposition 4795 274ca - endif 4796 274ca - ldy INTIM 4797 274ca - cpy #TIMEOFFSET 4798 274ca - bcs paddleport0updateloop 4799 274ca - 4800 274ca - lda #%10000110 4801 274ca - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 4802 274ca - sec 4803 274ca - lda paddleposition0 4804 274ca - sbc #TIMEOFFSET 4805 274ca - ifconst PADDLESCALEX2 4806 274ca - asl 4807 274ca - endif 4808 274ca - 4809 274ca - ifnconst PADDLESMOOTHINGOFF 4810 274ca - clc 4811 274ca - adc paddleprevious0 4812 274ca - ror 4813 274ca - sta paddleprevious0 4814 274ca - endif 4815 274ca - 4816 274ca - sta paddleposition0 4817 274ca - 4818 274ca - ifconst TWOPADDLESUPPORT 4819 274ca - sec 4820 274ca - lda paddleposition1 4821 274ca - sbc #TIMEOFFSET 4822 274ca - ifconst PADDLESCALEX2 4823 274ca - asl 4824 274ca - endif 4825 274ca - 4826 274ca - ifnconst PADDLESMOOTHINGOFF 4827 274ca - clc 4828 274ca - adc paddleprevious1 4829 274ca - ror 4830 274ca - sta paddleprevious1 4831 274ca - endif 4832 274ca - sta paddleposition1 4833 274ca - endif ; TWOPADDLESUPPORT 4834 274ca - 4835 274ca - jmp LLRET0 4836 274ca endif 4837 274ca 4838 274ca paddleport1update 4839 274ca - ifconst PADDLE1SUPPORT 4840 274ca - lda #6 4841 274ca - sta VBLANK ; start charging the paddle caps 4842 274ca - 4843 274ca - lda #0 ; use PADDLE timing 4844 274ca - jsr SETTIM64T ; INTIM is in Y 4845 274ca - 4846 274ca -paddleport1updateloop 4847 274ca - lda INPT2 4848 274ca - bmi skippaddle2setposition 4849 274ca - sty paddleposition2 4850 274ca -skippaddle2setposition 4851 274ca - ifconst TWOPADDLESUPPORT 4852 274ca - lda INPT3 4853 274ca - bmi skippaddle3setposition 4854 274ca - sty paddleposition3 4855 274ca -skippaddle3setposition 4856 274ca - endif 4857 274ca - ldy INTIM 4858 274ca - cpy #TIMEOFFSET 4859 274ca - bcs paddleport1updateloop 4860 274ca - 4861 274ca - lda #%10000110 4862 274ca - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 4863 274ca - sec 4864 274ca - lda paddleposition2 4865 274ca - sbc #TIMEOFFSET 4866 274ca - ifconst PADDLESCALEX2 4867 274ca - asl 4868 274ca - endif 4869 274ca - 4870 274ca - ifnconst PADDLESMOOTHINGOFF 4871 274ca - clc 4872 274ca - adc paddleprevious2 4873 274ca - ror 4874 274ca - sta paddleprevious2 4875 274ca - endif 4876 274ca - 4877 274ca - sta paddleposition2 4878 274ca - 4879 274ca - ifconst TWOPADDLESUPPORT 4880 274ca - sec 4881 274ca - lda paddleposition3 4882 274ca - sbc #TIMEOFFSET 4883 274ca - ifconst PADDLESCALEX2 4884 274ca - asl 4885 274ca - endif 4886 274ca - 4887 274ca - ifnconst PADDLESMOOTHINGOFF 4888 274ca - clc 4889 274ca - adc paddleprevious3 4890 274ca - ror 4891 274ca - sta paddleprevious3 4892 274ca - endif 4893 274ca - sta paddleposition3 4894 274ca - endif ; TWOPADDLESUPPORT 4895 274ca - 4896 274ca - jmp LLRET1 4897 274ca endif 4898 274ca 4899 274ca 4900 274ca paddlebuttonhandler ; outside of conditional, for button-handler LUT 4901 274ca - ifconst PADDLESUPPORT 4902 274ca - ; x=0|1 for port, rather than paddle #. 4903 274ca - ; Only the first paddle button will integrate into "joy0fire" testing. If the 4904 274ca - ; game wants to support 2 paddles, up to the game to instead test the 4905 274ca - ; joystick right+left directions instead. 4906 274ca - lda SWCHA ; top of nibble is first paddle button 4907 274ca - cpx #0 ; port 0? 4908 274ca - beq skippaddleport2shift 4909 274ca - asl ; shift second port to upper nibble 4910 274ca - asl 4911 274ca - asl 4912 274ca - asl 4913 274ca -skippaddleport2shift 4914 274ca - and #%10000000 4915 274ca - eor #%10000000 ; invert 4916 274ca - sta sINPT1,x 4917 274ca - jmp buttonreadloopreturn 4918 274ca endif ; PADDLESUPPORT 4919 274ca 4920 274ca mousebuttonhandler ; outside of conditional, for button-handler LUT 4921 274ca - ifconst MOUSESUPPORT 4922 274ca - ; stick the mouse buttons in the correct shadow register... 4923 274ca - txa 4924 274ca - asl 4925 274ca - tay ; y=x*2 4926 274ca - lda INPT4,x 4927 274ca - eor #%10000000 4928 274ca - lsr 4929 274ca - sta sINPT1,x 4930 274ca - 4931 274ca - lda INPT1,y 4932 274ca - and #%10000000 4933 274ca - eor #%10000000 4934 274ca - ora sINPT1,x 4935 274ca - sta sINPT1,x 4936 274ca - jmp buttonreadloopreturn 4937 274ca endif ; MOUSESUPPORT 4938 274ca 4939 274ca - ifconst KEYPADSUPPORT 4940 274ca - ; ** select keypad rows 0 to 3 over 4 frames... 4941 274ca -keypadrowselect 4942 274ca - ldy #0 4943 274ca - lda port0control 4944 274ca - cmp #7 4945 274ca - bne skipport0val 4946 274ca - iny ; y=y+1 4947 274ca -skipport0val 4948 274ca - lda port1control 4949 274ca - cmp #7 4950 274ca - bne skipport1val 4951 274ca - iny 4952 274ca - iny ; y=y+2 4953 274ca -skipport1val 4954 274ca - lda keyrowdirectionmask,y 4955 274ca - sta CTLSWA 4956 274ca - tya 4957 274ca - asl 4958 274ca - asl 4959 274ca - sta inttemp1 4960 274ca - lda framecounter 4961 274ca - and #3 4962 274ca - ora inttemp1 4963 274ca - tax 4964 274ca - lda keyrowselectvalue,x 4965 274ca - sta SWCHA 4966 274ca - rts 4967 274ca - 4968 274ca -keyrowdirectionmask 4969 274ca - .byte #%00000000 ; 0 : port0=input port1=input 4970 274ca - .byte #%11110000 ; 1 : port0=output port1=input 4971 274ca - .byte #%00001111 ; 2 : port0=input port1=output 4972 274ca - .byte #%11111111 ; 3 : port0=output port1=output 4973 274ca - 4974 274ca -keyrowselectvalue 4975 274ca - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 4976 274ca - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 4977 274ca - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 4978 274ca - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 4979 274ca endif ; KEYPADSUPPORT 4980 274ca 4981 274ca - ifconst KEYPADSUPPORT 4982 274ca - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 4983 274ca -keypadcolumnread 4984 274ca - lda port0control 4985 274ca - cmp #7 4986 274ca - bne skipkeypadcolumnread0 4987 274ca - lda framecounter 4988 274ca - and #3 4989 274ca - asl ; x2 because keypad variables are interleaved 4990 274ca - tax 4991 274ca - lda #0 4992 274ca - sta keypadmatrix0a,x 4993 274ca - lda INPT0 4994 274ca - cmp #$80 4995 274ca - rol keypadmatrix0a,x 4996 274ca - lda INPT1 4997 274ca - cmp #$80 4998 274ca - rol keypadmatrix0a,x 4999 274ca - lda INPT4 5000 274ca - cmp #$80 5001 274ca - rol keypadmatrix0a,x 5002 274ca - lda keypadmatrix0a,x 5003 274ca - eor #%00000111 5004 274ca - sta keypadmatrix0a,x 5005 274ca -skipkeypadcolumnread0 5006 274ca - 5007 274ca - lda port1control 5008 274ca - cmp #7 5009 274ca - bne skipkeypadcolumnread1 5010 274ca - lda framecounter 5011 274ca - and #3 5012 274ca - asl ; x2 because keypad variables are interleaved 5013 274ca - tax 5014 274ca - lda #0 5015 274ca - sta keypadmatrix1a,x 5016 274ca - rol keypadmatrix1a,x 5017 274ca - lda INPT2 5018 274ca - cmp #$80 5019 274ca - rol keypadmatrix1a,x 5020 274ca - lda INPT3 5021 274ca - cmp #$80 5022 274ca - rol keypadmatrix1a,x 5023 274ca - lda INPT5 5024 274ca - cmp #$80 5025 274ca - rol keypadmatrix1a,x 5026 274ca - lda keypadmatrix1a,x 5027 274ca - eor #%00000111 5028 274ca - sta keypadmatrix1a,x 5029 274ca -skipkeypadcolumnread1 5030 274ca - rts 5031 274ca endif ; KEYPADSUPPORT 5032 274ca 5033 274ca setportforinput 5034 274ca a5 e4 lda CTLSWAs 5035 274cc 3d d5 f4 and allpinsinputlut,x 5036 274cf 85 e4 sta CTLSWAs 5037 274d1 8d 81 02 sta CTLSWA 5038 274d4 60 rts 5039 274d5 5040 274d5 allpinsinputlut 5041 274d5 0f f0 .byte.b $0F, $F0 5042 274d7 5043 274d7 setonebuttonmode 5044 274d7 a9 06 lda #6 ; in case we're in unlocked-bios mode 5045 274d9 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 5046 274db a9 14 lda #$14 5047 274dd 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 5048 274e0 a5 e5 lda CTLSWBs 5049 274e2 1d eb f4 ora thisjoy2buttonbit,x 5050 274e5 85 e5 sta CTLSWBs 5051 274e7 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 5052 274ea 60 rts 5053 274eb 5054 274eb thisjoy2buttonbit 5055 274eb 04 10 .byte.b $04, $10 5056 274ed 5057 274ed settwobuttonmode 5058 274ed a9 06 lda #6 ; in case we're in unlocked-bios mode 5059 274ef 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 5060 274f1 a9 14 lda #$14 5061 274f3 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 5062 274f6 a5 e5 lda CTLSWBs 5063 274f8 3d 01 f5 and thisjoy2buttonmask,x 5064 274fb 85 e5 sta CTLSWBs 5065 274fd 8d 82 02 sta SWCHB 5066 27500 60 rts 5067 27501 5068 27501 thisjoy2buttonmask 5069 27501 fb ef .byte.b $fb, $ef 5070 27503 5071 27503 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5072 27503 5073 27503 START 5074 27503 start 5075 27503 5076 27503 ;******** more or less the Atari recommended startup procedure 5077 27503 5078 27503 78 sei 5079 27504 d8 cld 5080 27505 5081 27505 ifnconst NOTIALOCK 5082 27505 a9 07 lda #$07 5083 27507 - else 5084 27507 - lda #$06 5085 27507 endif 5086 27507 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 5087 27509 a9 7f lda #$7F 5088 2750b 85 3c sta CTRL ;disable DMA 5089 2750d a9 00 lda #$00 5090 2750f 85 38 sta OFFSET 5091 27511 ifnconst NOTIALOCK 5092 27511 85 01 sta INPTCTRL 5093 27513 85 20 sta BACKGRND ; black default, in case a flash cart is using something else 5094 27515 endif 5095 27515 a2 ff ldx #$FF 5096 27517 9a txs 5097 27518 5098 27518 ;************** Clear Memory 5099 27518 5100 27518 a2 40 ldx #$40 5101 2751a a9 00 lda #$00 5102 2751c crloop1 5103 2751c 95 00 sta $00,x ;Clear zero page 5104 2751e 9d 00 01 sta $100,x ;Clear page 1 5105 27521 e8 inx 5106 27522 d0 f8 bne crloop1 5107 27524 5108 27524 5109 27524 a0 00 ldy #$00 ;Clear Ram 5110 27526 a9 18 lda #$18 ;Start at $1800 5111 27528 85 81 sta $81 5112 2752a a9 00 lda #$00 5113 2752c 85 80 sta $80 5114 2752e crloop3 5115 2752e a9 00 lda #$00 5116 27530 91 80 sta ($80),y ;Store data 5117 27532 c8 iny ;Next byte 5118 27533 d0 f9 bne crloop3 ;Branch if not done page 5119 27535 e6 81 inc $81 ;Next page 5120 27537 a5 81 lda $81 5121 27539 c9 20 cmp #$20 ;End at $1FFF 5122 2753b d0 f1 bne crloop3 ;Branch if not 5123 2753d 5124 2753d a0 00 ldy #$00 ;Clear Ram 5125 2753f a9 22 lda #$22 ;Start at $2200 5126 27541 85 81 sta $81 5127 27543 a9 00 lda #$00 5128 27545 85 80 sta $80 5129 27547 crloop4 5130 27547 a9 00 lda #$00 5131 27549 91 80 sta ($80),y ;Store data 5132 2754b c8 iny ;Next byte 5133 2754c d0 f9 bne crloop4 ;Branch if not done page 5134 2754e e6 81 inc $81 ;Next page 5135 27550 a5 81 lda $81 5136 27552 c9 27 cmp #$27 ;End at $27FF 5137 27554 d0 f1 bne crloop4 ;Branch if not 5138 27556 5139 27556 a2 00 ldx #$00 5140 27558 a9 00 lda #$00 5141 2755a crloop5 ;Clear 2100-213F, 2000-203F 5142 2755a 9d 00 20 sta $2000,x 5143 2755d 9d 00 21 sta $2100,x 5144 27560 e8 inx 5145 27561 e0 40 cpx #$40 5146 27563 d0 f5 bne crloop5 5147 27565 5148 27565 85 80 sta $80 5149 27567 85 81 sta $81 5150 27569 85 82 sta $82 5151 2756b 85 83 sta $83 5152 2756d 5153 2756d ;seed random number with hopefully-random timer value 5154 2756d a9 01 lda #1 5155 2756f 0d 84 02 ora INTIM 5156 27572 85 40 sta rand 5157 27574 5158 27574 ; detect the console type... 5159 27574 pndetectvblankstart 5160 27574 a5 28 lda MSTAT 5161 27576 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 5162 27578 pndetectvblankover 5163 27578 a5 28 lda MSTAT 5164 2757a 30 fc bmi pndetectvblankover ; then wait for it to be over 5165 2757c a0 00 ldy #$00 5166 2757e a2 00 ldx #$00 5167 27580 pndetectvblankhappening 5168 27580 a5 28 lda MSTAT 5169 27582 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 5170 27584 85 24 sta WSYNC 5171 27586 85 24 sta WSYNC 5172 27588 e8 inx 5173 27589 d0 f5 bne pndetectvblankhappening 5174 2758b pndetectinvblank 5175 2758b e0 7d cpx #125 5176 2758d 90 02 bcc pndetecispal 5177 2758f a0 01 ldy #$01 5178 27591 pndetecispal 5179 27591 8c 09 21 sty paldetected 5180 27594 5181 27594 20 30 f4 jsr createallgamedlls 5182 27597 5183 27597 a9 18 lda #>DLLMEM 5184 27599 85 2c sta DPPH 5185 2759b a9 00 lda # 255 5380 275f4 -DOUBLEBUFFEROFFSET = 255 5381 275f4 else 5382 275f4 00 7a DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 5383 275f4 endif 5384 275f4 5385 275f4 ifconst EXTRADLMEMORY 5386 275f4 SECONDDLHALFSTART SET $2300 5387 275f4 endif 5388 275f4 5389 275f4 DLPOINTH 5390 275f4 DLINDEX SET 0 5391 275f4 REPEAT WZONECOUNT 5392 275f4 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275f4 ifconst EXTRADLMEMORY 5394 275f4 - if TMPMEMADDRESS > $1FFF 5395 275f4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275f4 else 5397 275f4 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275f4 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275f4 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275f4 endif 5401 275f4 endif ; TMPMEMADDRESS > $1FFF 5402 275f4 endif ; EXTRADLMEMORY 5403 275f4 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275f4 18 .byte.b >TMPMEMADDRESS 5405 275f4 DLINDEX SET DLINDEX + 1 5391 275f4 REPEND 5392 275f4 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275f5 ifconst EXTRADLMEMORY 5394 275f5 - if TMPMEMADDRESS > $1FFF 5395 275f5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275f5 else 5397 275f5 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275f5 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275f5 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275f5 endif 5401 275f5 endif ; TMPMEMADDRESS > $1FFF 5402 275f5 endif ; EXTRADLMEMORY 5403 275f5 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275f5 18 .byte.b >TMPMEMADDRESS 5405 275f5 DLINDEX SET DLINDEX + 1 5391 275f5 REPEND 5392 275f5 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275f6 ifconst EXTRADLMEMORY 5394 275f6 - if TMPMEMADDRESS > $1FFF 5395 275f6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275f6 else 5397 275f6 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275f6 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275f6 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275f6 endif 5401 275f6 endif ; TMPMEMADDRESS > $1FFF 5402 275f6 endif ; EXTRADLMEMORY 5403 275f6 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275f6 19 .byte.b >TMPMEMADDRESS 5405 275f6 DLINDEX SET DLINDEX + 1 5391 275f6 REPEND 5392 275f6 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275f7 ifconst EXTRADLMEMORY 5394 275f7 - if TMPMEMADDRESS > $1FFF 5395 275f7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275f7 else 5397 275f7 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275f7 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275f7 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275f7 endif 5401 275f7 endif ; TMPMEMADDRESS > $1FFF 5402 275f7 endif ; EXTRADLMEMORY 5403 275f7 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275f7 19 .byte.b >TMPMEMADDRESS 5405 275f7 DLINDEX SET DLINDEX + 1 5391 275f7 REPEND 5392 275f7 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275f8 ifconst EXTRADLMEMORY 5394 275f8 - if TMPMEMADDRESS > $1FFF 5395 275f8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275f8 else 5397 275f8 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275f8 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275f8 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275f8 endif 5401 275f8 endif ; TMPMEMADDRESS > $1FFF 5402 275f8 endif ; EXTRADLMEMORY 5403 275f8 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275f8 1a .byte.b >TMPMEMADDRESS 5405 275f8 DLINDEX SET DLINDEX + 1 5391 275f8 REPEND 5392 275f8 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275f9 ifconst EXTRADLMEMORY 5394 275f9 - if TMPMEMADDRESS > $1FFF 5395 275f9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275f9 else 5397 275f9 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275f9 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275f9 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275f9 endif 5401 275f9 endif ; TMPMEMADDRESS > $1FFF 5402 275f9 endif ; EXTRADLMEMORY 5403 275f9 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275f9 1a .byte.b >TMPMEMADDRESS 5405 275f9 DLINDEX SET DLINDEX + 1 5391 275f9 REPEND 5392 275f9 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275fa ifconst EXTRADLMEMORY 5394 275fa - if TMPMEMADDRESS > $1FFF 5395 275fa -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275fa else 5397 275fa - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275fa -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275fa -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275fa endif 5401 275fa endif ; TMPMEMADDRESS > $1FFF 5402 275fa endif ; EXTRADLMEMORY 5403 275fa ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275fa 1b .byte.b >TMPMEMADDRESS 5405 275fa DLINDEX SET DLINDEX + 1 5391 275fa REPEND 5392 275fa TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275fb ifconst EXTRADLMEMORY 5394 275fb - if TMPMEMADDRESS > $1FFF 5395 275fb -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275fb else 5397 275fb - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275fb -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275fb -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275fb endif 5401 275fb endif ; TMPMEMADDRESS > $1FFF 5402 275fb endif ; EXTRADLMEMORY 5403 275fb ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275fb 1b .byte.b >TMPMEMADDRESS 5405 275fb DLINDEX SET DLINDEX + 1 5391 275fb REPEND 5392 275fb TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275fc ifconst EXTRADLMEMORY 5394 275fc - if TMPMEMADDRESS > $1FFF 5395 275fc -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275fc else 5397 275fc - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275fc -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275fc -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275fc endif 5401 275fc endif ; TMPMEMADDRESS > $1FFF 5402 275fc endif ; EXTRADLMEMORY 5403 275fc ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275fc 1c .byte.b >TMPMEMADDRESS 5405 275fc DLINDEX SET DLINDEX + 1 5391 275fc REPEND 5392 275fc TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275fd ifconst EXTRADLMEMORY 5394 275fd - if TMPMEMADDRESS > $1FFF 5395 275fd -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275fd else 5397 275fd - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275fd -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275fd -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275fd endif 5401 275fd endif ; TMPMEMADDRESS > $1FFF 5402 275fd endif ; EXTRADLMEMORY 5403 275fd ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275fd 1c .byte.b >TMPMEMADDRESS 5405 275fd DLINDEX SET DLINDEX + 1 5391 275fd REPEND 5392 275fd TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275fe ifconst EXTRADLMEMORY 5394 275fe - if TMPMEMADDRESS > $1FFF 5395 275fe -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275fe else 5397 275fe - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275fe -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275fe -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275fe endif 5401 275fe endif ; TMPMEMADDRESS > $1FFF 5402 275fe endif ; EXTRADLMEMORY 5403 275fe ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275fe 1d .byte.b >TMPMEMADDRESS 5405 275fe DLINDEX SET DLINDEX + 1 5391 275fe REPEND 5392 275fe TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 275ff ifconst EXTRADLMEMORY 5394 275ff - if TMPMEMADDRESS > $1FFF 5395 275ff -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 275ff else 5397 275ff - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 275ff -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 275ff -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 275ff endif 5401 275ff endif ; TMPMEMADDRESS > $1FFF 5402 275ff endif ; EXTRADLMEMORY 5403 275ff ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 275ff 1d .byte.b >TMPMEMADDRESS 5405 275ff DLINDEX SET DLINDEX + 1 5391 275ff REPEND 5392 275ff TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 27600 ifconst EXTRADLMEMORY 5394 27600 - if TMPMEMADDRESS > $1FFF 5395 27600 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 27600 else 5397 27600 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 27600 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 27600 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 27600 endif 5401 27600 endif ; TMPMEMADDRESS > $1FFF 5402 27600 endif ; EXTRADLMEMORY 5403 27600 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 27600 1e .byte.b >TMPMEMADDRESS 5405 27600 DLINDEX SET DLINDEX + 1 5391 27600 REPEND 5392 27600 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 27601 ifconst EXTRADLMEMORY 5394 27601 - if TMPMEMADDRESS > $1FFF 5395 27601 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 27601 else 5397 27601 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 27601 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 27601 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 27601 endif 5401 27601 endif ; TMPMEMADDRESS > $1FFF 5402 27601 endif ; EXTRADLMEMORY 5403 27601 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 27601 1e .byte.b >TMPMEMADDRESS 5405 27601 DLINDEX SET DLINDEX + 1 5391 27601 REPEND 5392 27601 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 27602 ifconst EXTRADLMEMORY 5394 27602 - if TMPMEMADDRESS > $1FFF 5395 27602 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 27602 else 5397 27602 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 27602 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 27602 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 27602 endif 5401 27602 endif ; TMPMEMADDRESS > $1FFF 5402 27602 endif ; EXTRADLMEMORY 5403 27602 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 27602 1f .byte.b >TMPMEMADDRESS 5405 27602 DLINDEX SET DLINDEX + 1 5391 27602 REPEND 5392 27602 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 27603 ifconst EXTRADLMEMORY 5394 27603 - if TMPMEMADDRESS > $1FFF 5395 27603 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 27603 else 5397 27603 if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 27603 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 27603 SECONDDLHALFSTART SET TMPMEMADDRESS 5400 27603 endif 5401 27603 endif ; TMPMEMADDRESS > $1FFF 5402 27603 endif ; EXTRADLMEMORY 5403 27603 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 27603 22 .byte.b >TMPMEMADDRESS 5405 27603 DLINDEX SET DLINDEX + 1 5391 27603 REPEND 5392 27603 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 27604 ifconst EXTRADLMEMORY 5394 27604 if TMPMEMADDRESS > $1FFF 5395 27604 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 27604 - else 5397 27604 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 27604 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 27604 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 27604 - endif 5401 27604 endif ; TMPMEMADDRESS > $1FFF 5402 27604 endif ; EXTRADLMEMORY 5403 27604 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 27604 23 .byte.b >TMPMEMADDRESS 5405 27604 DLINDEX SET DLINDEX + 1 5391 27604 REPEND 5392 27604 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 27605 ifconst EXTRADLMEMORY 5394 27605 if TMPMEMADDRESS > $1FFF 5395 27605 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 27605 - else 5397 27605 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 27605 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 27605 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 27605 - endif 5401 27605 endif ; TMPMEMADDRESS > $1FFF 5402 27605 endif ; EXTRADLMEMORY 5403 27605 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 27605 23 .byte.b >TMPMEMADDRESS 5405 27605 DLINDEX SET DLINDEX + 1 5391 27605 REPEND 5392 27605 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 27606 ifconst EXTRADLMEMORY 5394 27606 if TMPMEMADDRESS > $1FFF 5395 27606 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 27606 - else 5397 27606 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 27606 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 27606 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 27606 - endif 5401 27606 endif ; TMPMEMADDRESS > $1FFF 5402 27606 endif ; EXTRADLMEMORY 5403 27606 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 27606 24 .byte.b >TMPMEMADDRESS 5405 27606 DLINDEX SET DLINDEX + 1 5391 27606 REPEND 5392 27606 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 27607 ifconst EXTRADLMEMORY 5394 27607 if TMPMEMADDRESS > $1FFF 5395 27607 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 27607 - else 5397 27607 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 27607 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 27607 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 27607 - endif 5401 27607 endif ; TMPMEMADDRESS > $1FFF 5402 27607 endif ; EXTRADLMEMORY 5403 27607 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 27607 24 .byte.b >TMPMEMADDRESS 5405 27607 DLINDEX SET DLINDEX + 1 5391 27607 REPEND 5392 27607 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 27608 ifconst EXTRADLMEMORY 5394 27608 if TMPMEMADDRESS > $1FFF 5395 27608 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 27608 - else 5397 27608 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 27608 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 27608 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 27608 - endif 5401 27608 endif ; TMPMEMADDRESS > $1FFF 5402 27608 endif ; EXTRADLMEMORY 5403 27608 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 27608 25 .byte.b >TMPMEMADDRESS 5405 27608 DLINDEX SET DLINDEX + 1 5391 27608 REPEND 5392 27608 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 27609 ifconst EXTRADLMEMORY 5394 27609 if TMPMEMADDRESS > $1FFF 5395 27609 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 27609 - else 5397 27609 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 27609 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 27609 -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 27609 - endif 5401 27609 endif ; TMPMEMADDRESS > $1FFF 5402 27609 endif ; EXTRADLMEMORY 5403 27609 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 27609 25 .byte.b >TMPMEMADDRESS 5405 27609 DLINDEX SET DLINDEX + 1 5391 27609 REPEND 5392 27609 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 2760a ifconst EXTRADLMEMORY 5394 2760a if TMPMEMADDRESS > $1FFF 5395 2760a TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 2760a - else 5397 2760a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 2760a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 2760a -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 2760a - endif 5401 2760a endif ; TMPMEMADDRESS > $1FFF 5402 2760a endif ; EXTRADLMEMORY 5403 2760a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 2760a 26 .byte.b >TMPMEMADDRESS 5405 2760a DLINDEX SET DLINDEX + 1 5391 2760a REPEND 5392 2760a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5393 2760b ifconst EXTRADLMEMORY 5394 2760b if TMPMEMADDRESS > $1FFF 5395 2760b TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5396 2760b - else 5397 2760b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5398 2760b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5399 2760b -SECONDDLHALFSTART SET TMPMEMADDRESS 5400 2760b - endif 5401 2760b endif ; TMPMEMADDRESS > $1FFF 5402 2760b endif ; EXTRADLMEMORY 5403 2760b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 5404 2760b 26 .byte.b >TMPMEMADDRESS 5405 2760b DLINDEX SET DLINDEX + 1 5406 2760c REPEND 5407 2760c 5408 2760c ifconst EXTRADLMEMORY $22b0 to $27ff was claimed as extra DL memory. 5409 2760c echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 5410 2760c endif 5411 2760c 5412 2760c 5413 2760c DLPOINTL 5414 2760c DLINDEX SET 0 5415 2760c REPEAT WZONECOUNT 5416 2760c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5417 2760c ifconst EXTRADLMEMORY 5418 2760c - if TMPMEMADDRESS > $1FFF 5419 2760c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 2760c else 5421 2760c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 2760c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 2760c endif 5424 2760c endif ; TMPMEMADDRESS > $1FFF 5425 2760c endif ; EXTRADLMEMORY 5426 2760c 80 .byte.b $1FFF 5419 2760d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 2760d else 5421 2760d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 2760d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 2760d endif 5424 2760d endif ; TMPMEMADDRESS > $1FFF 5425 2760d endif ; EXTRADLMEMORY 5426 2760d fa .byte.b $1FFF 5419 2760e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 2760e else 5421 2760e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 2760e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 2760e endif 5424 2760e endif ; TMPMEMADDRESS > $1FFF 5425 2760e endif ; EXTRADLMEMORY 5426 2760e 75 .byte.b $1FFF 5419 2760f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 2760f else 5421 2760f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 2760f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 2760f endif 5424 2760f endif ; TMPMEMADDRESS > $1FFF 5425 2760f endif ; EXTRADLMEMORY 5426 2760f f0 .byte.b $1FFF 5419 27610 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27610 else 5421 27610 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27610 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27610 endif 5424 27610 endif ; TMPMEMADDRESS > $1FFF 5425 27610 endif ; EXTRADLMEMORY 5426 27610 6a .byte.b $1FFF 5419 27611 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27611 else 5421 27611 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27611 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27611 endif 5424 27611 endif ; TMPMEMADDRESS > $1FFF 5425 27611 endif ; EXTRADLMEMORY 5426 27611 e5 .byte.b $1FFF 5419 27612 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27612 else 5421 27612 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27612 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27612 endif 5424 27612 endif ; TMPMEMADDRESS > $1FFF 5425 27612 endif ; EXTRADLMEMORY 5426 27612 60 .byte.b $1FFF 5419 27613 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27613 else 5421 27613 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27613 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27613 endif 5424 27613 endif ; TMPMEMADDRESS > $1FFF 5425 27613 endif ; EXTRADLMEMORY 5426 27613 da .byte.b $1FFF 5419 27614 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27614 else 5421 27614 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27614 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27614 endif 5424 27614 endif ; TMPMEMADDRESS > $1FFF 5425 27614 endif ; EXTRADLMEMORY 5426 27614 55 .byte.b $1FFF 5419 27615 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27615 else 5421 27615 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27615 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27615 endif 5424 27615 endif ; TMPMEMADDRESS > $1FFF 5425 27615 endif ; EXTRADLMEMORY 5426 27615 d0 .byte.b $1FFF 5419 27616 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27616 else 5421 27616 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27616 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27616 endif 5424 27616 endif ; TMPMEMADDRESS > $1FFF 5425 27616 endif ; EXTRADLMEMORY 5426 27616 4a .byte.b $1FFF 5419 27617 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27617 else 5421 27617 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27617 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27617 endif 5424 27617 endif ; TMPMEMADDRESS > $1FFF 5425 27617 endif ; EXTRADLMEMORY 5426 27617 c5 .byte.b $1FFF 5419 27618 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27618 else 5421 27618 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27618 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27618 endif 5424 27618 endif ; TMPMEMADDRESS > $1FFF 5425 27618 endif ; EXTRADLMEMORY 5426 27618 40 .byte.b $1FFF 5419 27619 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27619 else 5421 27619 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27619 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27619 endif 5424 27619 endif ; TMPMEMADDRESS > $1FFF 5425 27619 endif ; EXTRADLMEMORY 5426 27619 ba .byte.b $1FFF 5419 2761a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 2761a else 5421 2761a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 2761a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 2761a endif 5424 2761a endif ; TMPMEMADDRESS > $1FFF 5425 2761a endif ; EXTRADLMEMORY 5426 2761a 35 .byte.b $1FFF 5419 2761b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 2761b else 5421 2761b if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 2761b TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 2761b endif 5424 2761b endif ; TMPMEMADDRESS > $1FFF 5425 2761b endif ; EXTRADLMEMORY 5426 2761b b0 .byte.b $1FFF 5419 2761c TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 2761c - else 5421 2761c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 2761c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 2761c - endif 5424 2761c endif ; TMPMEMADDRESS > $1FFF 5425 2761c endif ; EXTRADLMEMORY 5426 2761c 2a .byte.b $1FFF 5419 2761d TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 2761d - else 5421 2761d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 2761d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 2761d - endif 5424 2761d endif ; TMPMEMADDRESS > $1FFF 5425 2761d endif ; EXTRADLMEMORY 5426 2761d a5 .byte.b $1FFF 5419 2761e TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 2761e - else 5421 2761e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 2761e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 2761e - endif 5424 2761e endif ; TMPMEMADDRESS > $1FFF 5425 2761e endif ; EXTRADLMEMORY 5426 2761e 20 .byte.b $1FFF 5419 2761f TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 2761f - else 5421 2761f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 2761f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 2761f - endif 5424 2761f endif ; TMPMEMADDRESS > $1FFF 5425 2761f endif ; EXTRADLMEMORY 5426 2761f 9a .byte.b $1FFF 5419 27620 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27620 - else 5421 27620 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27620 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27620 - endif 5424 27620 endif ; TMPMEMADDRESS > $1FFF 5425 27620 endif ; EXTRADLMEMORY 5426 27620 15 .byte.b $1FFF 5419 27621 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27621 - else 5421 27621 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27621 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27621 - endif 5424 27621 endif ; TMPMEMADDRESS > $1FFF 5425 27621 endif ; EXTRADLMEMORY 5426 27621 90 .byte.b $1FFF 5419 27622 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27622 - else 5421 27622 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27622 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27622 - endif 5424 27622 endif ; TMPMEMADDRESS > $1FFF 5425 27622 endif ; EXTRADLMEMORY 5426 27622 0a .byte.b $1FFF 5419 27623 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5420 27623 - else 5421 27623 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5422 27623 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5423 27623 - endif 5424 27623 endif ; TMPMEMADDRESS > $1FFF 5425 27623 endif ; EXTRADLMEMORY 5426 27623 85 .byte.b $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 18 80 ZONE0ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 18 fa ZONE1ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 19 75 ZONE2ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 19 f0 ZONE3ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 1a 6a ZONE4ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 1a e5 ZONE5ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 1b 60 ZONE6ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 1b da ZONE7ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 1c 55 ZONE8ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 1c d0 ZONE9ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 1d 4a ZONE10ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 1d c5 ZONE11ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 1e 40 ZONE12ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 1e ba ZONE13ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 1f 35 ZONE14ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 - if TMPMEMADDRESS > $1FFF 5436 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 else 5438 27624 if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 22 b0 ZONE15ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 if TMPMEMADDRESS > $1FFF 5436 27624 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 - else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 - endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 23 2a ZONE16ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 if TMPMEMADDRESS > $1FFF 5436 27624 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 - else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 - endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 23 a5 ZONE17ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 if TMPMEMADDRESS > $1FFF 5436 27624 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 - else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 - endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 24 20 ZONE18ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 if TMPMEMADDRESS > $1FFF 5436 27624 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 - else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 - endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 24 9a ZONE19ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 if TMPMEMADDRESS > $1FFF 5436 27624 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 - else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 - endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 25 15 ZONE20ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 if TMPMEMADDRESS > $1FFF 5436 27624 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 - else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 - endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 25 90 ZONE21ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 if TMPMEMADDRESS > $1FFF 5436 27624 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 - else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 - endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 26 0a ZONE22ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5432 27624 REPEND 5433 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 5434 27624 ifconst EXTRADLMEMORY 5435 27624 if TMPMEMADDRESS > $1FFF 5436 27624 TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5437 27624 - else 5438 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 5439 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 5440 27624 - endif 5441 27624 endif ; TMPMEMADDRESS > $1FFF 5442 27624 endif ; EXTRADLMEMORY 5443 27624 5444 27624 26 85 ZONE23ADDRESS = TMPMEMADDRESS 5445 27624 5446 27624 DLINDEX SET DLINDEX + 1 5447 27624 REPEND 5448 27624 5449 27624 $1880 to $23ff used as zone memory, allowing 24 display objects per zone. 5450 27624 echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 5451 27624 5452 27624 DLHEIGHT 5453 27624 REPEAT WZONECOUNT 5454 27624 07 .byte.b (WZONEHEIGHT-1) 5453 27624 REPEND 5454 27625 07 .byte.b (WZONEHEIGHT-1) 5453 27625 REPEND 5454 27626 07 .byte.b (WZONEHEIGHT-1) 5453 27626 REPEND 5454 27627 07 .byte.b (WZONEHEIGHT-1) 5453 27627 REPEND 5454 27628 07 .byte.b (WZONEHEIGHT-1) 5453 27628 REPEND 5454 27629 07 .byte.b (WZONEHEIGHT-1) 5453 27629 REPEND 5454 2762a 07 .byte.b (WZONEHEIGHT-1) 5453 2762a REPEND 5454 2762b 07 .byte.b (WZONEHEIGHT-1) 5453 2762b REPEND 5454 2762c 07 .byte.b (WZONEHEIGHT-1) 5453 2762c REPEND 5454 2762d 07 .byte.b (WZONEHEIGHT-1) 5453 2762d REPEND 5454 2762e 07 .byte.b (WZONEHEIGHT-1) 5453 2762e REPEND 5454 2762f 07 .byte.b (WZONEHEIGHT-1) 5453 2762f REPEND 5454 27630 07 .byte.b (WZONEHEIGHT-1) 5453 27630 REPEND 5454 27631 07 .byte.b (WZONEHEIGHT-1) 5453 27631 REPEND 5454 27632 07 .byte.b (WZONEHEIGHT-1) 5453 27632 REPEND 5454 27633 07 .byte.b (WZONEHEIGHT-1) 5453 27633 REPEND 5454 27634 07 .byte.b (WZONEHEIGHT-1) 5453 27634 REPEND 5454 27635 07 .byte.b (WZONEHEIGHT-1) 5453 27635 REPEND 5454 27636 07 .byte.b (WZONEHEIGHT-1) 5453 27636 REPEND 5454 27637 07 .byte.b (WZONEHEIGHT-1) 5453 27637 REPEND 5454 27638 07 .byte.b (WZONEHEIGHT-1) 5453 27638 REPEND 5454 27639 07 .byte.b (WZONEHEIGHT-1) 5453 27639 REPEND 5454 2763a 07 .byte.b (WZONEHEIGHT-1) 5453 2763a REPEND 5454 2763b 07 .byte.b (WZONEHEIGHT-1) 5455 2763c REPEND 5456 2763c 5457 2763c ; Provided under the CC0 license. See the included LICENSE.txt for details. 5458 2763c 5459 2763c ; a simple guard, than ensures the 7800basic code hasn't 5460 2763c ; spilled into the encryption area... 2370 bytes left in the 7800basic reserved area. 5461 2763c echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 5462 2763c - if (*>$FF7D) 5463 2763c - ERR ; abort the assembly 5464 2763c endif 5465 2763c ; Provided under the CC0 license. See the included LICENSE.txt for details. 5466 2763c 5467 2763c - ifconst DEV 5468 2763c - ifnconst ZONEHEIGHT 5469 2763c - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 5470 2763c - else 5471 2763c - if ZONEHEIGHT = 8 5472 2763c - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 5473 2763c - else 5474 2763c - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 5475 2763c - endif 5476 2763c - endif 5477 2763c endif 5478 2763c 5479 2763c ; FF7E/FF7F contains the 7800basic crc checksum word 5480 2763c 5481 2763c ; FF80 - FFF7 contains the 7800 encryption key 5482 2763c 5483 2763c - ifnconst bankswitchmode 5484 2763c - ORG $FFF8 5485 2763c else 5486 2763c ifconst ROM128K 5487 27ff8 ORG $27FF8 5488 27ff8 RORG $FFF8 5489 27ff8 endif 5490 27ff8 - ifconst ROM144K 5491 27ff8 - ORG $27FF8 5492 27ff8 - RORG $FFF8 5493 27ff8 endif 5494 27ff8 - ifconst ROM256K 5495 27ff8 - ORG $47FF8 5496 27ff8 - RORG $FFF8 5497 27ff8 endif 5498 27ff8 - ifconst ROM272K 5499 27ff8 - ORG $47FF8 5500 27ff8 - RORG $FFF8 5501 27ff8 endif 5502 27ff8 - ifconst ROM512K 5503 27ff8 - ORG $87FF8 5504 27ff8 - RORG $FFF8 5505 27ff8 endif 5506 27ff8 - ifconst ROM528K 5507 27ff8 - ORG $87FF8 5508 27ff8 - RORG $FFF8 5509 27ff8 endif 5510 27ff8 endif 5511 27ff8 5512 27ff8 5513 27ff8 ff .byte.b $FF ; region verification. $FF=all regions 5514 27ff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 5515 27ffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 5516 27ffa 5517 27ffa ;Vectors 5518 27ffa 00 f0 .word.w NMI 5519 27ffc 03 f5 .word.w START 5520 27ffe 5f f0 .word.w IRQ 5521 28000