home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / cliscroll.lha / .source / Scroll.S
Encoding:
Text File  |  1980-01-22  |  3.4 KB  |  119 lines

  1. ; SoftScroller
  2. ; 1989 by Brian Postma
  3. ; J.v.Hartenstraat 51
  4. ; 7576VX Oldenzaal (NL)
  5. ; Tel:05410-14763
  6.  
  7. start:    movem.l        d0-d7/a0-a6,-(a7)
  8.     lea        gfxname,a1    ;Name of graphics library
  9.     move.l        4,a6        ;Execbase
  10.     jsr        -408(a6)    ;Open Library
  11.     move.l        d0,gfxbase    ;Rememer graphics base
  12.     lea        intname,a1    ;Name of intuition lib.
  13.     jsr        -408(a6)    ;Open Library
  14.     move.l        d0,intbase    ;Remember intuition base
  15.     move.l        intbase,a6
  16.     lea        osargs,a0    ;Pointer to newscreen struct.
  17.     jsr        -198(a6)    ;Open Screen
  18.     move.l        d0,screenbase    ;Pointer to screen struct
  19.     beq        quit        ;Could I open it ??
  20.     add.l        #84,d0        ;Screenbase+84
  21.     move.l        d0,rastport    ;Is Rastport
  22.     move.l        gfxbase,a6    
  23.     move.l        rastport,a1
  24.     clr.l        d0        ;Color=0
  25.     jsr        -234(a6)    ;Setrast->Clear Screen
  26.     move.l        screenbase,a0
  27.     move.l        192(a0),d0    ;Pointer to first bitplane
  28.     move.w        d0,planes+6    ;Low word in copperlist
  29.     swap        d0
  30.     move.w        d0,planes+2    ;High word in copperlist
  31.     move.l        gfxbase,a0    ;gfxbase+$32=pointer to clist
  32.     move.l        $32(a0),oldcop    ;save old copperlist
  33.     move.l        #newcop,$32(a0)    ;My own copperlist
  34.     move.l        $6c,oldirq    ;Save old VBL irq pointer
  35.     move.l        #newirq,$6c    ;my VBL interrupt
  36. wait:    btst        #6,$bfe001    ;Left mouse button pressed ??
  37.     bne        wait        ;No !!
  38.     move.l        oldirq,$6c    ;Restore interrupt
  39.     move.l        gfxbase,a0    ;restore
  40.     move.l        oldcop,$32(a1)    ;old copperlist
  41.     move.l        intbase,a6
  42.     move.l        screenbase,a0
  43.     jsr        -66(a6)        ;Close the screen
  44. quit:    movem.l        (a7)+,d0-d7/a0-a6
  45.     rts
  46.  
  47. newirq:    movem.l        d0-d7/a0-a6,-(a7);Save regs
  48.     bsr        scroll
  49.     movem.l        (a7)+,d0-d7/a0-a6;Restore regs
  50.     dc.w        $4ef9        ;Code for 'JUMP'
  51. oldirq:    dc.l        0        ;Jump to oldirq
  52.  
  53. scroll:    move.l        gfxbase,a6
  54.     move.l        #2,d0        ;dx, 2 pixels to the left
  55.     clr.l        d1        ;dy
  56.     move.l        #0,d2        ;min x
  57.     move.l        #0,d3        ;min y
  58.     move.l        #367,d4        ;max x
  59.     move.l        #15,d5        ;max y
  60.     move.l        rastport,a1    ;rastport pointer
  61.     jsr        -396(a6)    ;ScrollRaster
  62.     subq.w        #1,scrcount    ;Counter for newtext
  63.     beq        newtext        ;is zero->new char
  64.     rts                ;else->bye ??
  65. newtext:move.w        #5,scrcount    ;newtext delay set
  66.     move.l        gfxbase,a6
  67.     move.l        rastport,a1
  68.     move.l        #358,d0        ;x
  69.     move.l        #8,d1        ;y
  70.     jsr        -240(a6)    ;move
  71.     move.l        stringpointer,a0;pointer to string
  72.     move.l        #1,d0        ;1 char
  73.     jsr        -60(a6)
  74.     addq.l        #1,stringpointer;Next char
  75.     cmpi.l        #endstring,stringpointer
  76.     bne        notend        ;end of string reached
  77.     move.l        #string,stringpointer;Start al over
  78. notend:    rts
  79.  
  80. newcop:    dc.w    $0092,$0028,$0094,$00d8    ;DFFSTART,DFFSTOP->OverScan
  81.     dc.w    $008e,$296a,$0090,$29fa    ;DIWSTART,DIWSTOP
  82.     dc.w    $0108,$0000,$010a,$0000    ;BPL1MOD,BPL2MOD
  83.     dc.w    $0096,$0020,$0100,$0000    ;Sprites off,planes off
  84.     dc.w    $0180,$0000,$0182,$0fff    ;Colors
  85. planes:    dc.w    $00e0,$0000,$00e2,$0000    ;Plane1 low,high word
  86.     dc.w    $8001,$fffe        ;Wait till line 128 reached
  87.     dc.w    $0100,$1000        ;Bitplane 1 on
  88.     dc.w    $9001,$fffe        ;Wait till line 144 reached
  89.     dc.w    $0100,$0000        ;Bitplanes off
  90.     dc.w    $ffff,$fffe        ;Wait till end
  91.  
  92. osargs:    dc.w    0,0,368,16        ;x-min,y-min,width,height
  93.     dc.w    1            ;depth 1 bitplane
  94.     dc.b    0,1            ;detailpen,blockpen
  95.     dc.w    0,15            ;viewmodes,type=customscreen
  96.     dc.l    textattr,0        ;textattr,title=none
  97.     dc.l    0,0            ;gadgets,bitmap
  98. textattr:
  99.     dc.l    fontname        ;Fontname
  100.     dc.w    9            ;fontsize
  101.     dc.b    0            ;Style=normal
  102.     dc.b    1            ;flags=romfont
  103.  
  104. scrcount:    dc.w    1
  105. oldcop:        dc.l    0
  106. gfxbase:    dc.l    0
  107. intbase:    dc.l    0
  108. rastport:    dc.l    0
  109. screenbase:    dc.l    0
  110. stringpointer:    dc.l    string
  111. intname:    dc.b    "intuition.library",0
  112. gfxname:    dc.b    "graphics.library",0
  113. fontname:    dc.b    "topaz.font",0
  114. string:
  115.  dc.b    "WRITTEN BY BRIAN POSTMA"
  116.  dc.b    "      "
  117. endstring:
  118.  
  119.