1000 ; DISP_RGB›1010 ; by Clay Halliwell›1020 ; -----------------›1030 ; USR(16384,mode)›1040 ;›1050 ; System Equates›1060 SETVBV=$E45C›1070 XITVBV=$E462›1080 WSYNC =$D40A›1090 HPOS0 =$D000›1100 HPOS1 =$D001›1110 SIZEP0=$D008›1120 SIZEP1=$D009›1130 GRAFP0=$D00D›1140 GRAFP1=$D00E›1150 COLPF0=$D016›1160 COLPF1=$D017›1170 COLPF2=$D018›1180 COLBK =$D01A›1190 PRIOR =$D01B›1200 KBCODE=$D209›1210 IRQEN =$D20E›1220 NMIEN =$D40E›1230 VDSLST=$0200›1240 PCOLR0=$02C0›1250 PCOLR1=$02C1›1260 POKMSK=$0010›1270 ;›1280 ; Variables›1290 PAGE  =203›1300 LINES =204›1310 MODE  =205›1320 COUNT =206›1330 ;›1340 ; Constants›1350 DLIST =32822›1360 LMS1  =32827›1370 LMS2  =32923›1380 ;›1390  *=$4000›1400 ;›1410 ; INIT VBI›1420 ;›1430  PLA›1440  PLA›1450  PLA›1460  STA MODE›1470 ;›1480  LDY #VBI&255›1490  LDX #VBI/256›1500  LDA #7›1510  JSR SETVBV›1520 ;›1530 ; INIT DLI›1540 ;›1550  LDA MODE›1560  CMP #15›1570  BNE MODE9›1580  LDA #DLI2&255›1590  STA VDSLST›1600  LDA #DLI2/256›1610  STA VDSLST+1›1620  LDA #65›1630  JMP SETUP›1640 MODE9›1650  LDA #DLI&255›1660  STA VDSLST›1670  LDA #DLI/256›1680  STA VDSLST+1›1690  LDA #192›1700 SETUP›1710  STA COUNT›1720  STA LINES›1730  LDA #0         ; disable IRQs›1740  STA IRQEN›1750  STA POKMSK›1760  LDA #192       ; enable DLIs›1770  STA NMIEN›1780 ;›1790  LDA #48        ; mod disp list›1800  STA DLIST›1810  LDA #240›1820  STA DLIST+2›1830  LDX #2›1840 MODLOOP›1850  LDA DLDATA,X›1860  STA DLIST+199,X›1870  DEX›1880  BPL MODLOOP›1890 ;›1900  LDA #0         ; setup p/m›1910  STA PCOLR0›1920  STA PCOLR1›1930  LDA #255›1940  STA GRAFP0›1950  STA GRAFP1›1960  STA SIZEP0›1970  STA SIZEP1›1980  LDA #16›1990  STA HPOS0›2000  LDA #208›2010  STA HPOS1›2020  RTS›2030 ;›2040 DLDATA›2050  .BYTE $01,$50,$7F›2060 ;›2070 VBI›2080  LDA KBCODE›2090  CMP #56›2100  BEQ DONE›2110  LDX PAGE›2120  DEX›2130  BPL FLIP›2140  LDX #2›2150 FLIP›2160  STX PAGE›2170  LDA PADR1,X›2180  STA LMS1›2190  LDA PADR2,X›2200  STA LMS2›2210 DONE›2220  LDA COUNT›2230  STA LINES›2240  JMP XITVBV›2250 ;›2260 PADR1›2270  .BYTE $81,$61,$41›2280 PADR2›2290  .BYTE $90,$70,$50›2300 ;›2310 DLI›2320  PHA›2330  TXA›2340  PHA›2350  LDX PAGE›2360 LOOP9›2370  LDA COLTAB9,X›2380  STA WSYNC›2390  STA COLBK›2400 NEXTLINE›2410  DEX›2420  BPL DECLINE›2430  LDX #2›2440 DECLINE›2450  DEC LINES›2460  BNE LOOP9›2470  LDA #0         ; text line›2480  STA WSYNC›2490  STA PRIOR›2500  STA COLBK›2510  STA COLPF2›2520  LDA #14›2530  STA COLPF1›2540 ;›2550  PLA›2560  TAX›2570  PLA›2580  RTI›2590 ;›2600 ; Color Table›2610 COLTAB9›2620  .BYTE 48,192,112›2630 ;›2640 DLI2›2650  PHA›2660  TXA›2670  PHA›2680  TYA›2690  PHA›2700  LDA PAGE›2710  BEQ RED›2720  CMP #1›2730  BEQ GREEN›2740 ;›2750 BLUE›2760  LDA #116›2770  LDX #122›2780  LDY #126›2790  STA WSYNC›2800  STA COLPF0›2810  STX COLPF1›2820  STY COLPF2›2830 ;›2840 GREEN›2850  LDA #196›2860  LDX #202›2870  LDY #206›2880  STA WSYNC›2890  STA COLPF0›2900  STX COLPF1›2910  STY COLPF2›2920 ;›2930 RED›2940  LDA #52›2950  LDX #58›2960  LDY #62›2970  STA WSYNC›2980  STA COLPF0›2990  STX COLPF1›3000  STY COLPF2›3010 ;›3020  DEC LINES›3030  BNE BLUE›3040 ;›3050  LDA #0         ; text line›3060  STA WSYNC›3070  STA COLPF2›3080  LDA #14›3090  STA COLPF1›3100 ;›3110  PLA›3120  TAY›3130  PLA›3140  TAX›3150  PLA›3160  RTI›