home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI09.ARJ / ictari.09 / ASSEMBLY / TWIST / TWIST.S < prev   
Text File  |  1994-03-27  |  20KB  |  849 lines

  1. * Serial number: 0359477910
  2.  
  3.  **********************************************
  4. *        The twist scroll    (Low Rez)           *
  5. *     Coding January 1989 by manikin           *
  6. *      of the lost boys                   *
  7. *                           *
  8. *  To contact us:    12 Cambridge Rd           *
  9. *        Teddington           *
  10. *        Middx               *
  11. *        TW11 8DR               *
  12. *                       *  
  13. *    Set TABS to 10                   *
  14.  **********************************************
  15.  
  16. start    clr.l     -(sp)        set supervisor
  17.     move     #$20,-(sp)
  18.     trap     #1
  19.     add.l     #6,sp
  20.     move.l     d0,oldssp
  21.  
  22.     dc.w     $a00a        lose mouse
  23.  
  24.     move.l     #$00000777,$ff8240    set a few colors
  25.     move.l     #$04440777,$ff8244
  26.     bsr     makefonts        make up the fonts
  27.  
  28.     move     #2,-(sp)        get physbase
  29.     trap     #14    
  30.     add.l     #2,sp
  31.     move.l     d0,screen    
  32.     move.l     d0,savescrn
  33.  
  34.     move.l     #text,-(sp)    clear the screen
  35.     move     #9,-(sp)
  36.     trap     #1
  37.     add.l     #6,sp
  38.  
  39.  ****************************
  40. *     the main loop          *
  41.  ****************************
  42.  
  43. vbloop    tst     switch        which screen display
  44.     bne     time
  45.     move.l     #$78000,screen1    screen1=physbase
  46.     move.l     #$70000,screen    screen=logbase
  47.     move     #1,switch        change for next time
  48.     bra     time2
  49.  
  50. time    move.l     #$70000,screen1    screen=physbase
  51.     move.l     #$78000,screen    screen1=physbase
  52.     move     #0,switch        change for next time
  53. time2    move     #-1,-(sp)        set screens using xbios 5
  54.     move.l     screen1,-(sp)    phys
  55.     move.l     screen,-(sp)    log
  56.     move     #5,-(sp)
  57.     trap     #14
  58.     add.l     #12,sp
  59.  
  60.     move     #2,-(sp)        any keys waiting
  61.     move     #1,-(sp)
  62.     trap     #13
  63.     addq.l     #4,sp
  64.     tst     d0        test for key
  65.     bne    twistend        yes then exit the twist scroll
  66.  
  67.     move     #37,-(sp)        wait for vbl
  68.     trap     #14
  69.     add.l     #2,-(sp)
  70.  
  71.     add.l    #8640,fonttype    take the next font
  72.     cmp.l     #fontend,fonttype    is it past the last font?
  73.     bne     cont        if no then continue
  74.     move.l     #font1,fonttype    else reset font pointer to first font
  75.     add.l     #1,scrollpnt    advance scrolline by 1 character
  76.     move.l     scrollpnt,a6    get scroll
  77.     clr.l     d6
  78.     move.b     (a6)+,d6            
  79.     cmp.b     #$ff,21(a6)    test for end of scrolline
  80.     bne     cont        no then continue
  81.     move.l     #scrolline,scrollpnt    else restart scroll
  82.  
  83.  ********************************************************
  84. * Well this is the actual scrolline. each character is   *
  85. * is put on the screen by its own little routine.        *
  86. * which puts its character to a particular point in the  *
  87. * buffer. The first part of the character is added to    *
  88. * the screen while the second part is moved straight to  *
  89. * the screen. ie first word added second word moved      *
  90. * this is done (in general) for the first 29 lines but   *
  91. * as each character is 8 lines lower than the last the   *
  92. * last 8 lines would be added to themselves as the       *
  93. * previous character would not have cleared the screen   *
  94. * with its own character.       If you can understand    *
  95. * this bit then you have the key to the twist scroll.    *
  96. * take your time it will all become clear.           *
  97. * The scroll was worked out very carefully originally    *
  98. * so that where a character extends over the bottom of   *
  99. * the buffer it is drawn over at the top. This is done   *
  100. * in the dbra loops so you'll have to study them         *
  101. * carefully to see where.                   *
  102.  ********************************************************
  103.  
  104. cont    move.l     scrollpnt,a6    get scroll pointer
  105.     move.l     fonttype,a0    get fonttype
  106.     clr.l     d6
  107.     move.b     (a6)+,d6        get character
  108.     sub.b     #32,d6            
  109.     mulu     #144,d6        get offset for this character in font
  110.     add.l     d6,a0
  111.     move.l     screen,a1        
  112.     add.l     #32,a0
  113.     move     #29-1,d0        do 29 lines
  114. f_draw    add.l     #2,a0        this is the first character
  115.     move     (a0)+,(a1)    so only the second half is drawn 
  116.     add.l     #160,a1        on the screen.
  117.     dbra     d0,f_draw
  118.  
  119.     move.l     fonttype,a0    as above
  120.     clr.l     d6
  121.     move.b     (a6)+,d6
  122.     sub.b     #32,d6
  123.     mulu     #144,d6
  124.     add.l     d6,a0
  125.     move.l     screen,a1
  126.     move     #28,d0        do 29 lines
  127. f_draw1c    move     (a0)+,d5        
  128.     add     d5,(a1)        add to screen
  129.     move     (a0)+,8(a1)    move to screen 
  130.     add.l     #160,a1
  131.     dbra     d0,f_draw1c
  132.     
  133.     move     #7,d0        do another 8 lines
  134. f_draw1d    move     (a0)+,(a1)    move to screen
  135.     move     (a0)+,8(a1)    add to screen
  136.     add.l     #160,a1
  137.     dbra     d0,f_draw1d
  138.  
  139.  ***********************************************
  140. * Construction of buffer continues as above     *
  141. * with appropriate offsets etc                  *
  142.  ***********************************************
  143.  
  144.     move     #28,d0
  145.     move.l     fonttype,a0
  146.     clr.l     d6
  147.     move.b     (a6)+,d6
  148.     sub.b     #32,d6
  149.     mulu     #144,d6
  150.     add.l     d6,a0
  151.     move.l     screen,a1
  152.     add.l     #1288,a1
  153. f_draw1    move     (a0)+,d5
  154.     add     d5,(a1)
  155.     move     (a0)+,8(a1)
  156.     add.l     #160,a1
  157.     dbra     d0,f_draw1
  158.     
  159.     move     #7,d0
  160. f_draw1b    move     (a0)+,(a1)
  161.     move     (a0)+,8(a1)
  162.     add.l     #160,a1
  163.     dbra     d0,f_draw1b
  164.     
  165.     move     #28,d0
  166.     move.l     fonttype,a0
  167.     clr.l     d6
  168.     move.b     (a6)+,d6
  169.     sub.b     #32,d6
  170.     mulu     #144,d6
  171.     add.l     d6,a0
  172.     move.l     screen,a1
  173.     add.l     #2576,a1
  174. f_draw2    move     (a0)+,d5
  175.     add     d5,(a1)
  176.     move     (a0)+,8(a1)
  177.     add.l     #160,a1
  178.     dbra     d0,f_draw2
  179.     
  180.     move     #7,d0
  181. f_draw2b    move     (a0)+,(a1)
  182.     move     (a0)+,8(a1)
  183.     add.l     #160,a1
  184.     dbra     d0,f_draw2b
  185.     
  186.     move     #28,d0
  187.     move.l     fonttype,a0
  188.     clr.l     d6
  189.     move.b     (a6)+,d6
  190.     sub.b     #32,d6
  191.     mulu     #144,d6
  192.     add.l     d6,a0
  193.     move.l     screen,a1
  194.     add.l     #3864,a1
  195. f_draw3    move     (a0)+,d5
  196.     add     d5,(a1)
  197.     move     (a0)+,8(a1)
  198.     add.l     #160,a1
  199.     dbra     d0,f_draw3
  200.     
  201.     move     #7,d0
  202. f_draw3b    move     (a0)+,(a1)
  203.     move     (a0)+,8(a1)
  204.     add.l     #160,a1
  205.     dbra     d0,f_draw3b
  206.     
  207.     move     #28,d0
  208.     move.l     fonttype,a0
  209.     clr.l     d6
  210.     move.b     (a6)+,d6
  211.     sub.b     #32,d6
  212.     mulu     #144,d6
  213.     add.l     d6,a0
  214.     move.l     screen,a1
  215.     add.l     #5152,a1
  216. f_draw4    move     (a0)+,d5
  217.     add     d5,(a1)
  218.     move     (a0)+,8(a1)
  219.     add.l     #160,a1
  220.     dbra     d0,f_draw4
  221.     
  222.     move     #7,d0
  223. f_draw4b    move     (a0)+,(a1)
  224.     move     (a0)+,8(a1)
  225.     add.l     #160,a1
  226.     dbra     d0,f_draw4b
  227.     
  228.     move     #28,d0
  229.     move.l     fonttype,a0
  230.     clr.l     d6
  231.     move.b     (a6)+,d6
  232.     sub.b     #32,d6
  233.     mulu     #144,d6
  234.     add.l     d6,a0
  235.     move.l     screen,a1
  236.     add.l     #6440,a1
  237. f_draw5    move     (a0)+,d5
  238.     add     d5,(a1)
  239.     move     (a0)+,8(a1)
  240.     add.l     #160,a1
  241.     dbra     d0,f_draw5
  242.     
  243.     move     #7,d0
  244. f_draw5b    move     (a0)+,(a1)
  245.     move     (a0)+,8(a1)
  246.     add.l     #160,a1
  247.     dbra     d0,f_draw5b
  248.     
  249.     move     #28,d0
  250.     move.l     fonttype,a0
  251.     clr.l     d6
  252.     move.b     (a6)+,d6
  253.     sub.b     #32,d6
  254.     mulu     #144,d6
  255.     add.l     d6,a0
  256.     move.l     screen,a1
  257.     add.l     #7728,a1
  258. f_draw6    move     (a0)+,d5
  259.     add     d5,(a1)
  260.     move     (a0)+,8(a1)
  261.     add.l     #160,a1
  262.     dbra     d0,f_draw6
  263.     
  264.     move     #2,d0
  265. f_draw6b    move     (a0)+,(a1)
  266.     move     (a0)+,8(a1)
  267.     add.l     #160,a1
  268.     dbra     d0,f_draw6b
  269.     
  270.     move     #4,d0
  271. f_draw6c    move     (a0)+,-12800(a1)
  272.     move     (a0)+,-12792(a1)
  273.     add.l     #160,a1
  274.     dbra     d0,f_draw6c
  275.     
  276.     move     #23,d0
  277.     move.l     fonttype,a0
  278.     clr.l     d6
  279.     move.b     (a6)+,d6
  280.     sub.b     #32,d6
  281.     mulu     #144,d6
  282.     add.l     d6,a0
  283.     move.l     screen,a1
  284.     add.l     #9016,a1
  285. f_draw7    move     (a0)+,d5
  286.     add     d5,(a1)
  287.     move     (a0)+,8(a1)
  288.     add.l     #160,a1
  289.     dbra     d0,f_draw7
  290.     
  291.     move     #4,d0
  292. f_draw7c    move     (a0)+,d5
  293.     add     d5,-12800(a1)
  294.     move     (a0)+,-12792(a1)
  295.     add.l     #160,a1
  296.     dbra     d0,f_draw7c
  297.     
  298.     move     #7,d0
  299. f_draw7b    move     (a0)+,-12800(a1)
  300.     move     (a0)+,-12792(a1)
  301.     add.l     #160,a1
  302.     dbra     d0,f_draw7b
  303.     
  304.     move     #15,d0
  305.     move.l     fonttype,a0
  306.     clr.l     d6
  307.     move.b     (a6)+,d6
  308.     sub.b     #32,d6
  309.     mulu     #144,d6
  310.     add.l     d6,a0
  311.     move.l     screen,a1
  312.     add.l     #10304,a1
  313. f_draw8c    move     (a0)+,d5
  314.     add     d5,(a1)
  315.     move     (a0)+,8(a1)
  316.     add.l     #160,a1
  317.     dbra     d0,f_draw8c
  318.     
  319.     move     #12,d0
  320. f_draw8    move     (a0)+,d5
  321.     add     d5,-12800(a1)
  322.     move     (a0)+,-12792(a1)
  323.     add.l     #160,a1
  324.     dbra     d0,f_draw8
  325.     
  326.     move     #7,d0
  327. f_draw8b    move     (a0)+,-12800(a1)
  328.     move     (a0)+,-12792(a1)
  329.     add.l     #160,a1
  330.     dbra     d0,f_draw8b
  331.     
  332.     move     #7,d0
  333.     move.l     fonttype,a0
  334.     clr.l     d6
  335.     move.b     (a6)+,d6
  336.     sub.b     #32,d6
  337.     mulu     #144,d6
  338.     add.l     d6,a0
  339.     move.l     screen,a1
  340.     add.l     #11592,a1
  341. f_draw9    move     (a0)+,d5
  342.     add     d5,(a1)
  343.     move     (a0)+,8(a1)
  344.     add.l     #160,a1
  345.     dbra     d0,f_draw9
  346.     
  347.     move     #20,d0
  348. f_draw9b    move     (a0)+,d5
  349.     add     d5,-12800(a1)
  350.     move     (a0)+,-12792(a1)
  351.     add.l     #160,a1
  352.     dbra     d0,f_draw9b
  353.     
  354.     move     #7,d0
  355. f_draw9c    move     (a0)+,-12800(a1)
  356.     move     (a0)+,-12792(a1)
  357.     add.l     #160,a1
  358.     dbra     d0,f_draw9c
  359.     
  360.     move     #28,d0
  361.     move.l     fonttype,a0
  362.     clr.l     d6    
  363.     move.b     (a6)+,d6
  364.     sub.b     #32,d6
  365.     mulu     #144,d6
  366.     add.l     d6,a0
  367.     move.l     screen,a1
  368.     add.l     #80,a1
  369. f_draw10    move     (a0)+,d5
  370.     add     d5,(a1)
  371.     move     (a0)+,8(a1)
  372.     add.l     #160,a1
  373.     dbra     d0,f_draw10
  374.     
  375.     move     #7,d0
  376. f_draw10c    move     (a0)+,(a1)
  377.     move     (a0)+,8(a1)
  378.     add.l     #160,a1
  379.     dbra     d0,f_draw10c
  380.     
  381.     move     #28,d0
  382.     move.l     fonttype,a0
  383.     clr.l     d6
  384.     move.b     (a6)+,d6
  385.     sub.b     #32,d6
  386.     mulu     #144,d6
  387.     add.l     d6,a0
  388.     move.l     screen,a1
  389.     add.l     #1368,a1
  390. f_draw11    move     (a0)+,d5
  391.     add     d5,(a1)
  392.     move     (a0)+,8(a1)
  393.     add.l     #160,a1
  394.     dbra     d0,f_draw11
  395.     
  396.     move     #7,d0
  397. f_draw11b    move     (a0)+,(a1)
  398.     move     (a0)+,8(a1)
  399.     add.l     #160,a1
  400.     dbra     d0,f_draw11b
  401.     
  402.     move     #28,d0
  403.     move.l     fonttype,a0
  404.     clr.l     d6
  405.     move.b     (a6)+,d6
  406.     sub.b     #32,d6
  407.     mulu     #144,d6
  408.     add.l     d6,a0
  409.     move.l     screen,a1
  410.     add.l     #2656,a1
  411. f_draw12    move     (a0)+,d5
  412.     add     d5,(a1)
  413.     move     (a0)+,8(a1)
  414.     add.l     #160,a1
  415.     dbra     d0,f_draw12
  416.     
  417.     move     #7,d0
  418. f_draw12b    move     (a0)+,(a1)
  419.     move     (a0)+,8(a1)
  420.     add.l     #160,a1
  421.     dbra     d0,f_draw12b
  422.     
  423.     move     #28,d0
  424.     move.l     fonttype,a0
  425.     clr.l     d6
  426.     move.b     (a6)+,d6
  427.     sub.b     #32,d6
  428.     mulu     #144,d6
  429.     add.l     d6,a0
  430.     move.l     screen,a1
  431.     add.l     #3944,a1
  432. f_draw13    move     (a0)+,d5
  433.     add     d5,(a1)
  434.     move     (a0)+,8(a1)
  435.     add.l     #160,a1
  436.     dbra     d0,f_draw13
  437.     
  438.     move     #7,d0
  439. f_draw13b    move     (a0)+,(a1)
  440.     move     (a0)+,8(a1)
  441.     add.l     #160,a1
  442.     dbra     d0,f_draw13b
  443.     
  444.     move     #28,d0
  445.     move.l     fonttype,a0
  446.     clr.l     d6
  447.     move.b     (a6)+,d6
  448.     sub.b     #32,d6
  449.     mulu     #144,d6
  450.     add.l     d6,a0
  451.     move.l     screen,a1
  452.     add.l     #5232,a1
  453. f_draw14    move     (a0)+,d5
  454.     add     d5,(a1)
  455.     move     (a0)+,8(a1)
  456.     add.l     #160,a1
  457.     dbra     d0,f_draw14
  458.     
  459.     move     #7,d0
  460. f_draw14b    move     (a0)+,(a1)
  461.     move     (a0)+,8(a1)
  462.     add.l     #160,a1
  463.     dbra     d0,f_draw14b
  464.     
  465.     move     #28,d0
  466.     move.l     fonttype,a0
  467.     clr.l     d6
  468.     move.b     (a6)+,d6
  469.     sub.b     #32,d6
  470.     mulu     #144,d6
  471.     add.l     d6,a0
  472.     move.l     screen,a1
  473.     add.l     #6520,a1
  474. f_draw15    move     (a0)+,d5
  475.     add     d5,(a1)
  476.     move     (a0)+,8(a1)
  477.     add.l     #160,a1
  478.     dbra     d0,f_draw15
  479.     
  480.     move     #7,d0
  481. f_draw15b    move     (a0)+,(a1)
  482.     move     (a0)+,8(a1)
  483.     add.l     #160,a1
  484.     dbra     d0,f_draw15b
  485.     
  486.     move     #28,d0
  487.     move.l     fonttype,a0
  488.     clr.l     d6
  489.     move.b     (a6)+,d6
  490.     sub.b     #32,d6
  491.     mulu     #144,d6
  492.     add.l     d6,a0
  493.     move.l     screen,a1
  494.     add.l     #7808,a1
  495. f_draw16    move     (a0)+,d5
  496.     add     d5,(a1)
  497.     move     (a0)+,8(a1)
  498.     add.l     #160,a1
  499.     dbra     d0,f_draw16
  500.     
  501.     move     #2,d0
  502. f_draw16b    move     (a0)+,(a1)
  503.     move     (a0)+,8(a1)
  504.     add.l     #160,a1
  505.     dbra     d0,f_draw16b
  506.     
  507.     move     #4,d0
  508. f_draw16c    move     (a0)+,-12800(a1)
  509.     move     (a0)+,-12792(a1)
  510.     add.l     #160,a1
  511.     dbra     d0,f_draw16c
  512.     
  513.     move     #23,d0
  514.     move.l     fonttype,a0
  515.     clr.l     d6    
  516.     move.b     (a6)+,d6
  517.     sub.b     #32,d6
  518.     mulu     #144,d6
  519.     add.l     d6,a0
  520.     move.l     screen,a1
  521.     add.l     #9096,a1
  522. f_draw17    move     (a0)+,d5
  523.     add     d5,(a1)
  524.     move     (a0)+,8(a1)
  525.     add.l     #160,a1
  526.     dbra     d0,f_draw17
  527.     
  528.     move     #4,d0
  529. f_draw17c    move     (a0)+,d5
  530.     add     d5,-12800(a1)
  531.     move     (a0)+,-12792(a1)
  532.     add.l     #160,a1
  533.     dbra     d0,f_draw17c
  534.     
  535.     move     #7,d0
  536. f_draw17b    move     (a0)+,-12800(a1)
  537.     move     (a0)+,-12792(a1)
  538.     add.l     #160,a1
  539.     dbra     d0,f_draw17b
  540.     
  541.     move     #15,d0
  542.     move.l     fonttype,a0
  543.     clr.l     d6
  544.     move.b     (a6)+,d6
  545.     sub.b     #32,d6
  546.     mulu     #144,d6
  547.     add.l     d6,a0
  548.     move.l     screen,a1
  549.     add.l     #10384,a1
  550. f_draw18    move     (a0)+,d5
  551.     add     d5,(a1)
  552.     move     (a0)+,8(a1)
  553.     add.l     #160,a1
  554.     dbra     d0,f_draw18
  555.     
  556.     move     #12,d0
  557. f_draw18c    move     (a0)+,d5
  558.     add     d5,-12800(a1)
  559.     move     (a0)+,-12792(a1)
  560.     add.l     #160,a1
  561.     dbra     d0,f_draw18c
  562.     
  563.     move     #7,d0
  564. f_draw18b    move     (a0)+,-12800(a1)
  565.     move     (a0)+,-12792(a1)
  566.     add.l     #160,a1
  567.     dbra     d0,f_draw18b
  568.     
  569.     move     #7,d0        the last character is added 
  570.     move.l     fonttype,a0    only to the first word
  571.     clr.l     d6        the second is discarded.
  572.     move.b     (a6)+,d6
  573.     sub.b     #32,d6
  574.     mulu     #144,d6
  575.     add.l     d6,a0
  576.     move.l     screen,a1
  577.     add.l     #11672,a1
  578. f_draw19    move     (a0)+,d5
  579.     add     d5,(a1)
  580.     add.l     #2,a0
  581.     add.l     #160,a1
  582.     dbra     d0,f_draw19
  583.     
  584.     move     #20,d0
  585. f_draw19c    move     (a0)+,d5
  586.     add     d5,-12800(a1)
  587.     add.l     #2,a0
  588.     add.l     #160,a1
  589.     dbra     d0,f_draw19c
  590.     
  591.     move     #7,d0
  592. f_draw19b    move     (a0)+,-12800(a1)
  593.     add.l     #2,a0
  594.     add.l     #160,a1
  595.     dbra     d0,f_draw19b
  596.     
  597.     bsr     construct
  598.     bra    vbloop
  599.  
  600.  *******************************************
  601. * Now this is where the scroll is actually  *
  602. * constructed. this is done by copying the  *
  603. * the buffer to the screen once the right   *
  604. * way up in plane 1 then upside down and    *
  605. * in plane 2 to the screen. A table tells   *
  606. * the routine how many times to display     *
  607. * each line of the buffer. By missing or    *
  608. * or displaying some lines twice it is easy *
  609. * to give the appearance of wrapping the    *
  610. * scroll around a bar.                      *
  611.  *******************************************
  612.  
  613. construct    move.l     screen,a1
  614.     move.l     a1,a0
  615.     add.l     #16000,a1        start scroll 100 lines down screen
  616.     move.l     a1,a3
  617.     add.l     #10722,a3        start the upside down bit further down and in plane2
  618.     move.l     #addtab,a2    the addtable (for controlling the drawing of scroll)
  619.     move     #67,d0        do 68 lines
  620. cnstruct1    move    (a0),(a1)    copy buffer to screen
  621.     move     8(a0),8(a1)
  622.     move     16(a0),16(a1)
  623.     move     24(a0),24(a1)
  624.     move     32(a0),32(a1)
  625.     move     40(a0),40(a1)
  626.     move     48(a0),48(a1)
  627.     move     56(a0),56(a1)
  628.     move     64(a0),64(a1)
  629.     move     72(a0),72(a1)
  630.     move     80(a0),80(a1)
  631.     move     88(a0),88(a1)
  632.     move     96(a0),96(a1)
  633.     move     104(a0),104(a1)
  634.     move     112(a0),112(a1)
  635.     move     120(a0),120(a1)
  636.     move     128(a0),128(a1)
  637.     move     136(a0),136(a1)
  638.     move     144(a0),144(a1)
  639.     move     152(a0),152(a1)
  640.     move     (a0),(a3)        move buffer to plane 2 
  641.     move     8(a0),8(a3)
  642.     move     16(a0),16(a3)
  643.     move     24(a0),24(a3)
  644.     move     32(a0),32(a3)
  645.     move     40(a0),40(a3)
  646.     move     48(a0),48(a3)
  647.     move     56(a0),56(a3)
  648.     move     64(a0),64(a3)
  649.     move     72(a0),72(a3)
  650.     move     80(a0),80(a3)
  651.     move     88(a0),88(a3)
  652.     move     96(a0),96(a3)
  653.     move     104(a0),104(a3)
  654.     move     112(a0),112(a3)
  655.     move     120(a0),120(a3)
  656.     move     128(a0),128(a3)
  657.     move     136(a0),136(a3)
  658.     move     144(a0),144(a3)
  659.     move     152(a0),152(a3)
  660.     add.l     #160,a1        add one line to first pointer
  661.     sub.l     #160,a3        sub one line from second pointer
  662.     move     (a2)+,d1        take value from add table for how
  663.     add     d1,a0        many lines to advance through buffer
  664.     dbra     d0,cnstruct1
  665.     rts
  666.  
  667.  ****************************************
  668. * the exit routine. if you've finished   *
  669. * gawping at our amazing scroll then you *
  670. * are free to leave!!!!!!!!!!!!!!!!!!!!  *
  671.  ****************************************
  672.  
  673. twistend    move.l     #$7770000,$ff8240    reset some colors
  674.     move.l     #$0,$ff8244
  675.     move.l     oldssp,-(sp)    back to user mode
  676.     move      #$20,-(sp)
  677.     trap      #1
  678.     add.l     #6,sp    
  679.  
  680.     move     #-1,-(sp)        reset screen pointer
  681.     move.l     savescrn,-(sp)
  682.     move.l     savescrn,-(sp)
  683.     move     #5,-(sp)
  684.     trap     #14
  685.     add.l     #12,sp    
  686.  
  687.     clr     -(sp)        good bye cruel world!!!
  688.     trap     #1        aaaarrghhhhhhh!!!!!!!
  689.  
  690.  
  691.  **************************************
  692. *  These routines are for making the   *
  693. *  special fonts which this scroll     *
  694. *  uses to make the diagonal scroll    *
  695. *  each copy of the original font is   *
  696. *  shifted left by 2 pixels and        *
  697. *  moved up by one from the previous   *
  698. *  thus when all 8 copies are animated *
  699. *  they appear to move diagonally      *
  700.  **************************************
  701.  
  702. makefonts    lea     mainfont,a0    take original font
  703.     lea     font1,a1        first copy
  704.     move     #32,d0        start 8 lines in to char        
  705.     move     #0,d4        shift left by 1 pixel
  706.     bsr     movefont
  707.     
  708.     lea     mainfont,a0    take original font
  709.     lea     font2,a1        second copy
  710.     move     #28,d0        start 7 lines in to char
  711.     move     #2,d4        shift left by 3 pixels
  712.     bsr     movefont    
  713.     
  714.     lea     mainfont,a0    take original font
  715.     lea     font3,a1        third copy
  716.     move     #24,d0        start 6 line s in to char
  717.     move     #4,d4        shift left by 5 pixels
  718.     bsr     movefont
  719.     
  720.     lea     mainfont,a0    etc
  721.     lea     font4,a1
  722.     move     #20,d0        etc
  723.     move     #6,d4
  724.     bsr     movefont
  725.     
  726.     lea     mainfont,a0
  727.     lea     font5,a1
  728.     move     #16,d0
  729.     move     #8,d4
  730.     bsr     movefont
  731.     
  732.     lea     mainfont,a0
  733.     lea     font6,a1
  734.     move     #12,d0
  735.     move     #10,d4
  736.     bsr     movefont
  737.     
  738.     lea     mainfont,a0
  739.     lea     font7,a1
  740.     move     #8,d0
  741.     move     #12,d4
  742.     bsr     movefont
  743.     
  744.     lea     mainfont,a0    take original font 
  745.     lea     font8,a1        eigth copy
  746.     move     #4,d0        start on 2nd line
  747.     move     #14,d4        shift left by 15 pixels
  748.     bsr     movefont
  749.     
  750.     rts
  751.  
  752.  
  753. movefont    move     #59,d1        60 characters
  754. movefont1    move.l     a1,a2        first move font to copy 
  755.     add     d0,a2        add line offset
  756.     move     #35,d3        36 lines high
  757.     move.l     a2,a3
  758. movefont2    clr     (a2)+        blank 1 word
  759.     move     (a0)+,(a2)+    move font to 2nd word
  760.     dbra     d3,movefont2    loop
  761.     
  762.     move     d4,d5        move amount to shift to d5
  763. movefont3    move.l     a3,a4
  764.     move     #35,d3        now shift font over (36 lines)
  765. movefont4    lsl     2(a4)        shift 1st word     
  766.     roxl     (a4)        2nd word taking shifted bit from first
  767.     add.l     #4,a4
  768.     dbra     d3,movefont4
  769.     
  770.     dbra     d5,movefont3
  771.     
  772.     add.l     #144,a1
  773.     dbra     d1,movefont1
  774.     rts
  775.  
  776.  ************************************
  777. * The table for wrapping the scroll  *
  778. * around the imaginary bar. Numbers  *
  779. * correspond to numbers of bytes in  *
  780. * the buffer, 160= 1 line,320= 2line *
  781.  ************************************
  782.  
  783. addtab    dc.w     800,640,480,320,320,320,320,160,320,160,320,160,160,160,0,160,160,0
  784.     dc.w    160,160,0,160,160,0,160,0,160,0,160,0,160,0,160,0
  785.     dc.w     0,160,0,160,0,160,0,160,0,160,0,160,160,0,160,160
  786.     dc.w    0,160,160,0,160,160,160,320,160,320,160,320,320,320,480,320,640,800
  787. oldssp    dc.l     0
  788. savescrn    dc.l     0    
  789. fonttype    dc.l    font1
  790. screen1    dc.l     0            the two screens
  791. screen    dc.l     0
  792. switch    dc.w     0
  793. scrollpnt    dc.l     scrolline        pointer to scrolline
  794. text    dc.b     $1b,$45,0,0    text for clearing screen
  795.  
  796.  ********************************************
  797. * Well this is where you can type all that   *
  798. * spontaneous bullshit that comes to the     *
  799. * minds of scrolline writers...              *
  800. * Scroll is terminated by $ff but there must *
  801. * be 20 odd blank characters after this      *
  802. * so that spurious data is not displayed     *
  803.  ********************************************
  804.  
  805. scrolline    dc.b     "                      "
  806.     dc.b     "  HI THERE, MANIKIN OF THE LOST BOYS HERE ON THE TWIST SCROLL. THE LOST BOYS ARE AN ESTABLISHED DEMO CREW FROM"
  807.     dc.b    "  ENGLAND AND THIS SCROLL IS FROM OUR NEWEST DEMO ON THE ST, THE DEFINITIVE DEMO. COPIES AVAILABLE FROM THE BEST"
  808.     dc.b    " PD LIBRARIES OR FROM THE ADDRESS IN THIS SOURCE CODE. FOR THE PRICE OF 5 POUNDS, COMPLETE SOURCE CODE FOR THE DEF"
  809.     dc.b    " DEMO ALSO AVAILABLE FOR 25 POUNDS AGAIN FROM THIS ADDRESS. "
  810.     dc.b     "                      ",$ff
  811.     even
  812.  
  813.  ********************************************
  814. * The font is made up of 1 plane characters  *
  815. * which are 36 lines high and 1 word wide    *
  816. * the bottom 8 lines must be blank to allow  *
  817. * for the special format of characters!!     *
  818. * to make a font draw a series of characters *
  819. * 15 pixels wide (1 blank for space between  *
  820. * letters) and 28 lines high. you could draw *
  821. * them with a slant like I did to improve    *
  822. * the diagonal effect.                       *
  823.  ********************************************
  824.  
  825. mainfont    incbin    "twist.dat"
  826.  
  827.  ********************************************
  828. * The incbin instruction is used by genst    *
  829. * to include a binary file into an assembled *
  830. * file. If the assembler you use does not    *
  831. * have this instruction then either convert  *
  832. * the twist.dat file into dc.w statements or *
  833. * add an additional piece of code to load    *
  834. * the file to this part of the program.      *
  835.  ********************************************
  836.  
  837. * Font stores 
  838.  
  839. font1
  840. font2    equ     font1+8640
  841. font3     equ     font2+8640
  842. font4    equ     font3+8640
  843. font5    equ     font4+8640
  844. font6    equ     font5+8640
  845. font7    equ     font6+8640
  846. font8    equ     font7+8640
  847. fontend    equ     font8+8640
  848.  
  849.