10 ;  ДМЙТПХФ ›20 ;›30 ; COPYRIGHT (C) 1982 BY DAVID FOX AND MITCHELL WAITE›40 ;›0100  .TITLE "CLK-DLIROUT.ASM;v01.06-810806,820619"›0110  .PAGE "DLI Color Changer"›0120 ;›0130 ; BY COREY L. KOSAK›0140 ;›0150 ; B=$4000,FREL›0160 ;›0170 BASE=$4000›0180 ;›0190  *=$400›0200 ;›0210 ; CASBUF DATABASE EQUATES›0220 ;›0230 PMBAS *=*+1 ;HIBYTE OF PLAYER MISSILE AREA (LOBYTE EQUALS 0)›0240 PMBUF *=*+2 ;ADDRESS OF 128 BYTE BUFFER (FOR PMOVER)›0250 ANIMINIT *=*+1 ;INIT LOCATION FOR ANIMATE›0260 AUTOINIT *=*+1 ;INIT LOCATION FOR AUTOMOVE›0270 SCRLINIT *=*+1 ;INIT LOCATION FOR SCROLLER›0280 HPLR *=*+4 ;PLAYERS 0-3 X COORDINATE (FOR PMOVER)›0290 VPLR *=*+4 ;PLRS 0-3 Y COORD (FOR PMOVER)›0300 RATE *=*+4 ;PLRS 0-3 RATE (FOR ANIMATE)›0310 FLSTPTR *=*+8 ;PLRS 0-3 FRAME LIST POINTERS (FOR ANIMATE)›0320 SCRLADR *=*+2 ;SCREEN ADDRESS (FOR SCROLL)›0330 SCRLLEN *=*+2 ;LINE LENGTH OF SCROLLED AREA (FOR SCROLL)›0340 SCRLCLK *=*+1 ;COLOR CLOCKS IN SCREEN BYTE (FOR SCROLL)›0350 SCRLSTEP *=*+1 ;SCROLL STEP (FOR SCROLL)›0360 MOVERATE *=*+4 ;PLRS 0-3 HORIZONTAL STEP (FOR AUTOMOVE)›0370 DLIADR *=*+2 ;ADDRESS OF COLOR TABLE›0380 ;›0390 ;*LOCAL* DATABASE EQUATES›0400 ; THESE LOCATIONS ARE *LOCAL* TO THE ROUTINES›0410 ; AND SHOULD *NOT* BE MODIFIED BY THE HOST PROGRAM›0420 ;›0430 O0X *=*+4 ;PLRS 0-3 X COORDINATE›0440 O0Y *=*+4 ;PLRS 0-3 Y COORD›0450 ORATE0 *=*+4 ;PLRS 0-3 FRAME CHANGE RATE›0460 OADR0 *=*+8 ;PLRS 0-3 FRAME LIST ADDRESS›0470 TIMR0 *=*+4 ;PLRS 0-3 COUNTDOWN TIMERS (HOW MANY JIFFIES UNTIL FRAME CHANGE)›0480 POS0 *=*+4 ;PLRS 0-3 FRAME LIST POSITION›0490 OSADR *=*+2 ;SCREEN ADDRESS FOR SCROLLER›0500 CPOS *=*+2 ;COARSE SCROLL POSITION FOR SCROLLER (0-LINELEN)›0510 FPOS *=*+1 ;FINE SCROLL POSITION (0-7)›0520 OXSTEP0 *=*+4 ;PLRS 0-3 HORIZONTAL STEP›0530 DLIPOS *=*+1 ;CURRENT POSITION IN COLOR TABLE›0540 PM1 *=*+1 ;4 LOCATIONS RESERVED FOR PMOVER›0550 PM2 *=*+1›0560 PM3 *=*+1›0570 PM4 *=*+1›0580 EX1 *=*+1 ;4 LOCATIONS RESERVED FOR ANIMATE, AUTOMOVE, SCROLL, AND MFILL›0590 EX2 *=*+1›0600 EX3 *=*+1›0610 EX4 *=*+1›0620 PMSAVE *=*+5 ;ZERO PAGE SAVE AREA FOR PMOVER›0630 ZSAVE *=*+4 ;ZERO PAGE SAVE AREA FOR ALL OTHER ROUTINES›0640 DLI1 *=*+1›0650 DLI2 *=*+1›0660 ;›0670 COLPF2=$D018›0680 COLPF3=$D019›0690 COLBAK=$D01A›0700 XITVBV=$E462›0710 WSYNC=$D40A›0720 ;›0730 ZERO=$E0›0740 ;›0750  *=BASE›0760 ;›0770 START›0780  CLV›0790  BVC DLIDO ;SKIP OVER VBLANK EXIT ROUTINE›0800 ;›0810 EXIT›0820  JMP XITVBV›0830 ;›0840 VBINT›0850  LDA #$00 ;ON VBLANK, ZERO THE COLOR TABLE POINTER›0860  STA DLIPOS›0870  BEQ EXIT ;LEAVE›0880 ;›0890 DLIDO›0900  PHA  ;SAVE A,X, & Y ON STACK›0910  TXA›0920  PHA›0930  TYA›0940  PHA›0950 ;›0960  LDA ZERO ;SAVE ZERO PAGE LOCS›0970  STA DLI1›0980  LDA ZERO+1›0990  STA DLI2›1000  LDA DLIADR ;MOVE ADDRESS OF COLOR TABLE›1010  STA ZERO ;INTO POINTER›1020  LDA DLIADR+1›1030  STA ZERO+1›1040 ;›1050  LDY DLIPOS ;GET COLOR TABLE POINTER INTO Y-REG›1060  LDA (ZERO),Y ;GET COLOR›1070  PHA ;A=COLPF2›1080 ;›1090  INY ;GET THE NEXT COLOR›1100  LDA (ZERO),Y›1110  TAX ;X=COLPF3›1120 ;›1130  INY ;AND THE NEXT›1140  LDA (ZERO),Y›1150  INY›1160  STY DLIPOS ;STORE NEW COLOR TABLE POINTER›1170  TAY ;Y=COLBAK›1180  PLA ;A=COLPF2›1190  NOP ;PUT 18 CYCLE DELAY IN FOR›1200  NOP ;TIMING PROBLEM›1210  NOP›1220  NOP›1230  NOP›1240  NOP›1250  NOP›1260  NOP›1270  NOP›1280 ;›1290  STA WSYNC ;WAIT FOR HORIZONTAL SYNC›1300  STA COLPF2 ;QUICK! STORE THOSE COLORS!›1310  STX COLPF3›1320  STY COLBAK›1330 ;›1340  LDA DLI1 ;RESTORE ZERO PAGE LOCS›1350  STA ZERO›1360  LDA DLI2›1370  STA ZERO+1›1380 ;›1390  PLA  ;AND REGISTERS FROM STACK›1400  TAY›1410  PLA›1420  TAX›1430  PLA›1440  RTI  ;AND RETURN FROM WHENCE.›1450 ;›1460  .END›