C64 Software  <  SCA: The C64 Software Collection / BOUNCESCROLL3

  Run
1000              ;
1010              ;NORMALSCROLL 1
1020              ;21.6.80   STI
1030              ;
1040 Y            EQU 60   ;POSITION
1050 IY           EQU 255  ;WANN IRQ
1060              ;
1070              ;
1080 EY           EQU 255  ;EXPAND Y
1090              ;
1100 ZEROFREE     EQU 247
1110              ;
1120 ROW          EQU ZEROFREE
1130 CNTR         EQU ZEROFREE+1
1140 TEXT         EQU ZEROFREE+2
1150 PTR1         EQU ZEROFREE+4
1160              ;
1170 BOUNCEKIND   EQU ZEROFREE+6
1180 BOUNCECOUNTEREQU ZEROFREE+7
1190 BOUNCEDATA   EQU $3000
1200              ;
1210 SPRITEPTR    EQU 2040
1220 SPRITENR     EQU 128
1230 SPRITES      EQU 8192
1240 LASTSPRITE   EQU SPRITES+448+12
1250 REG          EQU 53270
1260 SPRITEFARB   EQU 53287
1270              ;
1280              ORG 20000
1290              ;
1300              ;
1310 BOUNINIT     LDA #0
1320              STA BOUNCEKIND
1330              STA BOUNCECOUNTER
1340              ;
1350 INT          SEI
1360              LDA #<ISR
1370              STA 788
1380              LDA #>ISR
1390              STA 789
1400              LDA #127
1410              STA 56333
1420              ;
1430              LDX #46
1440 INIT1        LDA VICTAB,X
1450              STA 53248,X
1460              DEX
1470              BPL INIT1
1480              ;
1490              LDX #8
1500              STX CNTR
1510              LDA #SPRITENR+7
1520 INIT2        STA SPRITEPTR-1,X
1530              SEC
1540              SBC #1
1550              DEX
1560              BNE INIT2
1570              ;
1580              TXA
1590 INIT3        STA SPRITES,X
1600              STA SPRITES+256,X
1610              STA SPRITES+512,X
1620              INX
1630              BNE INIT3
1640              ;
1650              LDA #<TEXTTAB
1660              STA TEXT
1670              LDA #>TEXTTAB
1680              STA TEXT+1
1690              ;
1700              CLI
1710              RTS
1720              ;
1730              ;
1740              ;
1750 ISR          LDA #1
1760              STA 53273
1770              ;
1780              ;INC 53280
1790              JSR BOUNCE
1800              ;INC 53280
1810              JSR SCLOLL
1820              ;INC 53280
1830              JSR SPRITECYCLE
1840              ;LDA #0
1850              ;STA 53280
1860              ;
1870              JMP 59953
1880              ;
1890 BOUNCE       DEC BOUNCECOUNTER
1900              BEQ NEWBOUNCE
1910              ;
1920              LDY BOUNCECOUNTER
1930 MAKE1        LDA BOUNCEDATA,Y
1940              LDX BOUNCEKIND
1950              BPL POSIBOUNCE
1960 NEGABOUNCE   EOR #255
1970              CLC
1980              ADC #18
1990              ;
2000 POSIBOUNCE   LDX #0
2010 BOUNCELOOP1  STA 53249,X
2020              INX
2030              INX
2040              CPX #16
2050              BNE BOUNCELOOP1
2060              RTS
2070              ;
2080 NEWBOUNCE    LDA #202
2090              STA BOUNCECOUNTER
2100              LDA BOUNCEKIND
2110              EOR #255
2120              STA BOUNCEKIND
2130              JMP BOUNCE
2140              ;
2150              ;
2160              ;
2170              ;
2180 SPRITECYCLE  LDA 162
2190              AND #1
2200              BNE CYCLEEND
2210              LDY #7
2220 CYCLELOOP    LDA CYCLEDATA,Y
2230              STA SPRITEFARB,Y
2240              DEY
2250              BPL CYCLELOOP
2260 CYCLEROTATE  LDY #58 ; ANZAHL-1
2270              LDA CYCLEDATA+1,Y
2280              TAX
2290 CYCLELOOP2   LDA CYCLEDATA,Y
2300              STA CYCLEDATA+1,Y
2310              DEY
2320              BPL CYCLELOOP2
2330              STX CYCLEDATA
2340 CYCLEEND     RTS
2350              ;
2360              ;
2370 SCLOLL       LDA #27
2380 SCLOLL1      STA ROW
2390              CLC
2400              ADC #<LASTSPRITE
2410              STA MODIF+1
2420              LDA #>LASTSPRITE
2430              STA MODIF+2
2440              ;
2450              LDY #8
2460 SCLOLL2      LDX #2
2470 MODIF        ROL 65530,X
2480              DEX
2490              BPL MODIF
2500              ;
2510              PHP
2520              LDA MODIF+1
2530              SEC
2540              SBC #64
2550              STA MODIF+1
2560              BCS SCLOLL3
2570              DEC MODIF+2
2580 SCLOLL3      PLP
2590              DEY
2600              BNE SCLOLL2
2610              ;
2620              LDA ROW
2630              SEC
2640              SBC #3
2650              BPL SCLOLL1
2660              ;
2670              DEC CNTR
2680              LDA CNTR
2690              BNE SCLOLLAUS
2700              LDA #8
2710              STA CNTR
2720              LDA #27    ;$D8/8
2730              STA PTR1+1
2740              ;
2750              LDY #0
2760 SCLOLL4      LDA (TEXT),Y
2770              BNE SCLOLL5
2780              ;
2790              LDA #<TEXTTAB
2800              STA TEXT
2810              LDA #>TEXTTAB
2820              STA TEXT+1
2830              BNE SCLOLL4
2840              ;
2850 SCLOLL5      INC TEXT
2860              BNE SCLOLL6
2870              INC TEXT+1
2880              ;
2890 SCLOLL6      ASL
2900              ROL PTR1+1
2910              ASL
2920              ROL PTR1+1
2930              ASL
2940              ROL PTR1+1
2950              STA PTR1
2960              LDA #51
2970              STA 1
2980              LDX #0
2990              LDY #0
3000 SCLOLL7      LDA (PTR1),Y
3010              STA LASTSPRITE+2,X
3020              INX
3030              INX
3040              INX
3050              INY
3060              CPY #8
3070              BCC SCLOLL7
3080              LDA #55
3090              STA 1
3100              ;
3110              ;
3120 SCLOLLAUS    RTS
3130              ;
3140              ;
3150              ;
3160 VICTAB       DFB 0,Y,48,Y,96,Y,144,Y,192,Y,240,Y,32,Y,80,Y,%11000000
3170              DFB 27,IY,0,0,255,8,EY,21,1,129,0,0,255,0,0
3180              DFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
3190              ;
3200 CYCLEDATA    DFB 11,12,15,1,15,12,11,0,0,0
3210              DFB 9,8,7,1,7,8,9,0,0,0
3220              DFB 6,14,3,1,3,14,6,0,0,0
3230              DFB 2,10,7,1,7,10,2,0,0,0
3240              DFB 9,5,13,1,13,5,9,0,0,0
3250              DFB 4,10,3,1,3,10,4,0,0,0
3260              ;
3270              ;
3280 TEXTTAB      DFB ""
3290              DFB ""
3300              DFB ""
3310              DFB "",0
READY.