home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / intro.lha / intro.s < prev    next >
Encoding:
Text File  |  1991-11-27  |  16.9 KB  |  658 lines

  1. ;*********************************************************
  2. ;*This intro uses the blitter to scroll text and the     *
  3. ;*Copper to initiate the scroll and the raster         *
  4. ;*********************************************************
  5. speed           equ    2
  6. mod           equ    0
  7. ;           include    "df1:exec_lib.i"
  8. ;           include    "df1:special_lib.i"
  9. ;           include    "df1:copmac.i"
  10. ;           include    "df1:dos_lib.i"
  11. LIBRARIES_DOS_LIB_I    SET    $1
  12. reserve EQU    $4
  13. vsize    EQU    $6
  14. count    SET    $FFFFFFE2
  15. LIBENT    MACRO
  16. _LVO\1    EQU    count
  17. count    SET    count-vsize
  18.     ENDM
  19.     LIBENT    Open
  20.     LIBENT    Close
  21.     LIBENT    Read
  22.     LIBENT    Write
  23.     LIBENT    Input
  24.     LIBENT    Output
  25.     LIBENT    Seek
  26.     LIBENT    DeleteFile
  27.     LIBENT    Rename
  28.     LIBENT    Lock
  29.     LIBENT    UnLock
  30.     LIBENT    DupLock
  31.     LIBENT    Examine
  32.     LIBENT    ExNext
  33.     LIBENT    Info
  34.     LIBENT    CreateDir
  35.     LIBENT    CurrentDir
  36.     LIBENT    IoErr
  37.     LIBENT    CreateProc
  38.     LIBENT    Exit
  39.     LIBENT    LoadSeg
  40.     LIBENT    UnLoadSeg
  41.     LIBENT    GetPacket
  42.     LIBENT    QueuePacket
  43.     LIBENT    DeviceProc
  44.     LIBENT    SetComment
  45.     LIBENT    SetProtection
  46.     LIBENT    DateStamp
  47.     LIBENT    Delay
  48.     LIBENT    WaitForChar
  49.     LIBENT    ParentDir
  50.     LIBENT    IsInteractive
  51.     LIBENT    Execute
  52.     ifnd macros
  53. ;    include "macros.s"
  54.     endc
  55. *------------------------------------------------------------------------*
  56. * MyExec.i                                 *
  57. *------------------------------------------------------------------------*
  58.  
  59. set           equ    1<<15
  60. all           equ    1<<9
  61. bpldma           equ    1<<8
  62. copdma           equ    1<<7
  63. bltdma           equ    1<<6
  64. sprdma           equ    1<<5
  65. dskdma           equ    1<<4
  66. ch3dma           equ    1<<3
  67. ch2dma           equ    1<<2
  68. ch1dma           equ    1<<1
  69. ch0dma           equ    1
  70.  
  71. ChipBase equ $dff000
  72.  
  73. CIA_A_PA equ $bfe001
  74. CIA_A_PB equ $bfe101
  75. CIA_A_DDRA equ $bfe201
  76. CIA_A_DDRB equ $bfe301
  77. CIA_A_TALO equ $bfe401
  78. CIA_A_TAHI equ $bfe501
  79. CIA_A_TBLO equ $bfe601
  80. CIA_A_TBHI equ $bfe701
  81. CIA_A_E.LSB equ $bfe801
  82. CIA_A_E.MID equ $bfe901
  83. CIA_A_E.MSB equ $bfea01
  84. CIA_A_SP equ $bfec01
  85. CIA_A_IRC equ $bfed01
  86. CIA_A_CRA equ $bfee01
  87. CIA_A_CRB equ $bfef01
  88.  
  89. CIA_B_PA equ $bfd001
  90. CIA_B_PB equ $bfd101
  91. CIA_B_DDRA equ $bfd201
  92. CIA_B_DDRB equ $bfd301
  93. CIA_B_TALO equ $bfd401
  94. CIA_B_TAHI equ $bfd501
  95. CIA_B_TBLO equ $bfd601
  96. CIA_B_TBHI equ $bfd701
  97. CIA_B_E.LSB equ $bfd801
  98. CIA_B_E.MID equ $bfd901
  99. CIA_B_E.MSB equ $bfda01
  100. CIA_B_SP equ $bfdc01
  101. CIA_B_IRC equ $bfdd01
  102. CIA_B_CRA equ $bfde01
  103. CIA_B_CRB equ $bfdf01
  104.  
  105. bltddat equ $000
  106. dmaconr equ $002
  107. vposr equ $004
  108. vhposr equ $006
  109. dskdatr equ $008
  110. joy0dat equ $0A
  111. joy1dat equ $00C
  112. clxdat equ $00E
  113.  
  114. adkconr equ $010
  115. pot0dat equ $012
  116. pot1dat equ $014
  117. potinp equ $016
  118. serdatr equ $018
  119. dskbytr equ $01A
  120. intenar equ $01C
  121. intreqr equ $01E
  122.  
  123. dskpt equ $020
  124. dsklen equ $024
  125. dskdat equ $026
  126. refptr equ $028
  127. vposw equ $02A
  128. vhposw equ $02C
  129. copcon equ $02E
  130. serdat equ $030
  131. serper equ $032
  132. potgo  equ $034
  133. joytest equ $036
  134. strequ equ $038
  135. strvbl equ $03A
  136. strhor equ $03C
  137. strlong equ $03E
  138.  
  139. bltcon0 equ $040
  140. bltcon1 equ $042
  141. bltafwm equ $044
  142. bltalwm equ $046
  143. bltcpt equ $048
  144. bltbpt equ $04C
  145. bltapt equ $050
  146. bltdpt equ $054
  147. bltsize equ $058
  148.  
  149. bltcmod equ $060
  150. bltbmod equ $062
  151. bltamod equ $064
  152. bltdmod equ $066
  153.  
  154. bltcdat equ $070
  155. bltbdat equ $072
  156. bltadat equ $074
  157.  
  158. dsksync equ $07E
  159.  
  160. cop1lc equ $080
  161. cop2lc equ $084
  162. copjmp1 equ $088
  163. copjmp2 equ $08A
  164. copins equ $08C
  165. diwstrt equ $08E
  166. diwstop equ $090
  167. ddfstrt equ $092
  168. ddfstop equ $094
  169. dmacon equ $096
  170. clxcon equ $098
  171. intena equ $09A
  172. intreq equ $09C
  173. adkcon equ $09E
  174.  
  175. aud  equ $0A0
  176. aud0 equ $0A0
  177. aud1 equ $0B0
  178. aud2 equ $0C0
  179. aud3 equ $0D0
  180.  
  181. ac_ptr equ $00     ; ptr to start of waveform data
  182. ac_len equ $04     ; length of waveform in words
  183. ac_per equ $06     ; sample period
  184. ac_vol equ $08     ; volume
  185. ac_dat equ $0A     ; sample pair
  186. ac_SIZEOF equ $10
  187.  
  188. bplpt equ $0E0
  189.  
  190. bplcon0 equ $100
  191. bplcon1 equ $102
  192. bplcon2 equ $104
  193. bpl1mod equ $108
  194. bpl2mod equ $10A
  195.  
  196. bpldat equ $110
  197.  
  198. sprpt  equ $120
  199.  
  200. spr equ $140
  201.  
  202. sd_pos equ $00
  203. sd_ctl equ $02
  204. sd_dataa equ $04
  205. sd_datab equ $08
  206.  
  207. color equ $180
  208.  
  209. cmove           macro
  210.            dc.w    \2,\1
  211.            endm
  212. cwait           macro
  213.            dc.b    \1,$01
  214.            dc.w    $ff00
  215.            endm
  216. cend           macro
  217.            dc.w    $ffff,$fffe
  218.            endm
  219.  
  220. cb           macro
  221.            dc.w    $0180,$0000
  222.            endm
  223.  
  224.  
  225.  
  226.     ifnd macros
  227. ;    include "macros.s"
  228.     endc
  229. ExecBase equ 4
  230. Supervisor equ -30
  231. ExitIntr equ -36
  232. Schedule equ -42
  233. Reschedule equ -48
  234. Switch equ -54
  235. Dispatch equ -60
  236. Exception equ -66
  237. InitCode equ -72
  238. InitStruct equ -78
  239. MakeLibrary equ -84
  240. MakeFunctions equ -90
  241. FindResident equ -96
  242. InitResident equ -102
  243. Alert equ -108
  244. Debug equ -114
  245. Disable equ -120
  246. Enable equ -126
  247. Forbid equ -132
  248. Permit equ -138
  249. SetSR equ -144
  250. SuperState equ -150
  251. UserState equ -156
  252. SetIntVector equ -162
  253. AddIntServer equ -168
  254. RemIntServer equ -174
  255. Cause equ -180
  256. Allocate equ -186
  257. Deallocate equ -192
  258. AllocMem equ -198
  259. AllocAbs equ -204
  260. FreeMem equ -210
  261. AvailMem equ -216
  262. AllocEntry equ -222
  263. FreeEntry equ -228
  264. Insert equ -234
  265. AddHead equ -240
  266. AddTail equ -246
  267. Remove equ -252
  268. RemHead equ -258
  269. RemTail equ -264
  270. Enqueue equ -270
  271. FindName equ -276
  272. AddTask equ -282
  273. RemTask equ -288
  274. FindTask equ -294
  275. SetTaskPri equ -300
  276. SetSignal equ -306
  277. SetExcept equ -312
  278. Wait equ -318
  279. Signal equ -324
  280. AllocSignal equ -330
  281. FreeSignal equ -336
  282. AllocTrap equ -342
  283. FreeTrap equ -348
  284. AddPort equ -354
  285. RemPort equ -360
  286. PutMsg equ -366
  287. GetMsg equ -372
  288. ReplyMsg equ -378
  289. WaitPort equ -384
  290. FindPort equ -390
  291. AddLibrary equ -396
  292. RemLibrary equ -402
  293. OldOpenLibrary equ -408
  294. CloseLibrary equ -414
  295. SetFunction equ -420
  296. SumLibrary equ -426
  297. AddDevice equ -432
  298. RemDevice equ -438
  299. OpenDevice equ -444
  300. CloseDevice equ -450
  301. DoIO equ -456
  302. SendIO equ -462
  303. CheckIO equ -468
  304. WaitIO equ -474
  305. AbortIO equ -480
  306. AddResource equ -486
  307. RemResource equ -492
  308. OpenResource equ -498
  309. RawIOInit equ -504
  310. RawMayGetChar equ -510
  311. RawPutChar equ -516
  312. RawDoFmt equ -522
  313. GetCC equ -528
  314. TypeOfMem equ -534
  315. Procure equ -540
  316. Vacate equ -546
  317. OpenLibrary equ -552
  318. ; Kickstart 1.3 only
  319. InitSemaphore equ -558
  320. ObtainSemaphore equ -564
  321. ReleaseSemaphore equ -570
  322. AttemptSemaphore equ -576
  323. ObtainSemaphorelist equ -582
  324. ReleaseSemaphorelist equ -588
  325. FindSemaphore equ -594
  326. AddSemaphore equ -600
  327. RemSemaphore equ -606
  328. SumKickData equ -612
  329. AddMemList equ -618
  330. CopyMem equ -624
  331. CopyMemQuick equ -630
  332.  
  333.            section    mycode,code_c
  334.  
  335. begin           move.l    (ExecBase).w,a6    ;Get ExecBase
  336.            lea    $dff000,a4       ;Chipbase
  337.            jsr    Forbid(a6)         ;Prevent multitasking
  338.            move.l    (a6),a2            ;
  339.            move.l    (a2),a3            ;Get gfxbase
  340. ;           move.l    $32(a3),d5         ;save old Clist
  341.            move.w    intenar(a4),d1     ;save intena
  342.            or.w    #$c000,d1       ;Enable all bits that were set
  343.            move.w    d1,intsav       ;
  344.            lea    MyCopper(pc),a1    ;
  345.            move.l    a1,a2           ;
  346. ;           move.l    a1,$32(a3)         ;tell the system about our Clist
  347.            move.l    a1,cop1lc(a4)      ;poke the copper anyway
  348.            clr.w    copjmp1(a4)        ;start it
  349.            move.l    #$10002,d1
  350.            move.l    #(40*200),d0
  351.            jsr    AllocMem(a6)       ;allocate 1 bitplane lores
  352.            move.l    d0,d7
  353.            bne.s    skl
  354.            rts
  355. skl
  356.            move.w    d0,6(a2)           ;put the bitplane address
  357.            swap    d0           ;in our copper list
  358.            move.w    d0,2(a2)           ;
  359.            lea    text(pc),a1        ;initial text to print
  360.            move.l    a1,textptn       ;initialize the pointer
  361. ww           btst    #6,dmaconr(a4)     ;
  362.            bne ww               ;Waitblit()
  363. upt           move.l    $6c.w,interuptsave ;save autovector
  364.            lea    newinterupt(pc),a1 ;
  365.            move.l    a1,$6c.w       ;put ours there
  366.            move.w    #$3fff,intena(a4)  ;clear all interupts
  367.            move.w    #$c020,intena(a4)  ;blit and vertical blank only
  368.            move.w    #$0020,dmacon(a4)  ;turn off sprites
  369.            move.w    #$8040,dmacon(a4)  ;turn on blitter dma
  370.            move.l    d7,bitaddress       ;
  371. ;           bsr    putit           ;print text
  372. wait_mouse     btst    #6,$bfe001       ;
  373.            bne.s    wait_mouse       ;wait for mouse click
  374.            jmp    endint
  375.  
  376. newinterupt    movem.l    a0-a6/d0-d7,-(sp)
  377.            lea    $dff000,a4       ;get chipbase
  378.            move.l    #-1,bltafwm(a4)    ;make first and last masks all 1's
  379.            lea    MyCopper(pc),a1    ;
  380.            move.l    a1,cop1lc(a4)      ;poke copper, redundant
  381.            clr.w    copjmp1(a4)        ;activate it
  382.            lea    copstart(pc),a0    ;address of copper
  383.            lea    colortab(pc),a1    ;color table
  384.            move.l    #$0103fffe,(a0)+   ;wait line 1
  385.            move.l    #$01820000,(a0)+   ;black background
  386.            move.l    #$01820fff,(a0)+   ;white foreground
  387.            moveq.l    #24-2,d0       ;size of 8 colors
  388.            lea    position(pc),a2    ;get position of sin table
  389.            lea    positiontab(pc),a3 ;get address of table
  390.            move.l    a3,d2
  391.            clr.l    d3
  392.            move.w    (a2),d3
  393.            add.l    d3,d2
  394.            move.l    d2,a2
  395.            clr.l    d4
  396.            move.b    (a2),d4
  397.            addi.b    #80,d4
  398.            lea    possave(pc),a4
  399.            move.w    d4,(a4)
  400.            lsl.w    #4,d4
  401.            lsl.w    #4,d4
  402.            andi.w    #$ff00,d4
  403.            or.w    #$01,d4
  404. loop           move.w    d4,(a0)+           ;construct copper wait
  405.            move.w    #$fffe,(a0)+       ;mask
  406.            move.w    #$0182,(a0)+       ;color0
  407.            move.w    (a1)+,(a0)+        ;poke color
  408.            add.l    #$0100,d4       ;increase vertical position
  409.            dbf    d0,loop        ;
  410.            move.w    d4,(a0)+           ;black
  411.            move.w    #$fffe,(a0)+       ;
  412.            move.l    #$01800000,(a0)+   ; black
  413.            move.w    #$0182,(a0)+       ;foreground move
  414.            lea    colortab(pc),a5    ;
  415.            move.w    (a5),(a0)+         ;flash text at bottom
  416.            move.l    #$fffffffe,(a0)    ;end of Clist
  417.            moveq.l    #1,d0           ;
  418.            sub.w    d0,time        ;
  419.            bne.s    df           ;
  420.            move.w    #speed,time       ;speed of rotation
  421.            lea    colortab(pc),a1    ;rotate colors
  422.            move.l    a1,a0           ;
  423.            move.w    (a1)+,d2           ;save first color
  424.            move.l  #(colortab2-colortab-4)/2,d0  ;
  425. loop2           move.w    (a1)+,(a0)+        ;load color+1  sta color
  426.            dbf    d0,loop2
  427.            move.w    d2,(a0)            ;move saved color at end of list
  428. df           lea    position(pc),a0    ;
  429.            move.w    (a0),d0            ;increment sin table
  430.            addq.w    #1,d0
  431.            cmpi.w    #(ptabend-ptabst)-1,d0
  432.            bne.s    posok
  433.            moveq    #0,d0
  434. posok           move.w    d0,(a0)
  435.            lea    $dff000,a4
  436.            bsr    scrollit       ;scroll the scroller
  437.            move.w    #$20,intreq(a4)    ;clear vertb interupt
  438. endo           movem.l    (sp)+,a0-a6/d0-d7  ;restore regs
  439.            rte
  440.  
  441. scrollit       move.l    bitaddress,a3       ;clear
  442.            move.l    #(40*8*4),d0       ; the
  443.            add.l    d0,a3           ;   scroller
  444.            move.l    a3,bltdpt(a4)      ;    area
  445.            clr.w    bltdmod(a4)        ;     for
  446.            move.w    #$0100,bltcon0(a4) ;      redraw
  447.            move.w    #$0000,bltcon1(a4) ;
  448.            move.w    #8724,bltsize(a4)  ;
  449. bw1           btst    #6,dmaconr(a4)     ; Waitblit()
  450.            bne    bw1
  451.            clr.l    d0
  452.            clr.l    d1
  453.            move.w    possave,d0       ;
  454.            sub.w    #$24,d0        ;
  455.            move.l    #40,d1           ;calculate new position of scroller
  456.            mulu.w    d0,d1           ;
  457.            add.l    bitaddress,d1       ;
  458.            move.l    d1,a0
  459.            lea    scrollbuffer(pc),a1;
  460.            move.w    #$09f0,bltcon0(a4) ;blit it
  461.            move.w    #$2,bltamod(a4)    ;  onto
  462.            move.l    a1,bltapt(a4)      ;   the screen
  463.            move.l    a0,bltdpt(a4)      ; size=40 bytes wide (320 pixels)
  464.            move.w    #532,bltsize(a4)   ; 8 lines high
  465. bw2           btst    #6,dmaconr(a4)     ;Waitblit()
  466.            bne.s    bw2
  467.            lea    charend(pc),a0     ;
  468.            move.l    a0,bltapt(a4)      ;scroll the
  469.            move.l    a0,bltdpt(a4)      ;  scroller
  470.            clr.w    bltdmod(a4)        ;    to the
  471.            clr.w    bltamod(a4)        ;      left
  472.            move.w    #$49f0,bltcon0(a4) ; 1 shift left channel A, USEA USED
  473.            move.w    #$0002,bltcon1(a4) ; Decrement
  474.            move.w    #533,bltsize(a4)   ;size, 328 pixels wide, 8 high
  475. bw3           btst.b    #6,dmaconr(a4)     ;Waitblit()
  476.            bne.s    bw3
  477.            move.w    scroll,d0
  478.            subq.w    #4,d0
  479.            move.w    d0,scroll
  480.            beq.s    newchar
  481.            rts
  482.            
  483. newchar        move.l    textptn,a0       ;
  484. reloop           addq.l    #1,a0           ;fetch
  485.            move.l    a0,textptn       ;  new
  486.            clr.l    d0           ;    letter
  487.            subq.l    #1,a0           ;      and
  488.            move.b    (a0)+,d0           ;        print it
  489.            bne.s    aok           ;         into the
  490.            lea    text(pc),a0        ;          end of the
  491.            bra.s    reloop           ;        scroll
  492. aok           cmpi.b    #'a',d0            ;             buffer
  493.            blo.s    nolet2           ;
  494.            cmpi.b    #'z',d0
  495.            bge.s    nolet2
  496.            subi.l    #$60,d0
  497. nolet2           add.l    d0,d0
  498.            add.l    d0,d0
  499.            add.l    d0,d0
  500.            lea    charbase+2048(pc),a0
  501.            add.l    d0,a0
  502.            lea    charsave(pc),a1
  503.            subq.l    #1,a1
  504.            moveq.l    #8,d0
  505. nlp           move.b    (a0),(a1)
  506.            addq.l    #1,a0
  507.            add.l    #42,a1
  508.            subq.l    #1,d0
  509.            bne.s    nlp
  510.            move.w    #8,scroll
  511.            rts
  512.  
  513. endint           move.l    interuptsave(pc),$6c.w  ; restore old autovector
  514.            move.w    #$7fff,intena(a4)       ;clear all interupts
  515.            move.w    intsav,intena(a4)       ; put old bits back
  516. ;           move.l    d5,$32(a3)              ;put Clist pack
  517. ;           move.l    d5,cop1lc(a4)           ;force it back
  518.            move.l    38(a3),cop1lc(a4)
  519.            clr.w    copjmp1(a4)             ;load it
  520.            move.w    #$8020,dmacon(a4)       ;enable sprites
  521.            move.w    #$8020,intreq(a4)       ;trigger a soft int
  522. enddeb           move.l    d7,a1            ;
  523.            move.l    #(40*200),d0            ;
  524.            jsr    FreeMem(a6)             ;free bitplane
  525.            jsr    Permit(a6)              ;renable multitasking
  526.            moveq    #0,d0
  527.            rts
  528.  
  529. interuptsave   dc.l    0
  530. scroll           dc.w    8
  531. textptn        dc.l    0
  532. bitaddress     dc.l    0
  533.  
  534. colortab       dc.w    $000,$010,$020,$030,$040,$050,$060,$070,$080
  535.            dc.w    $090,$0a0,$0b0,$0c0,$0d0,$0e0,$0f0,$0f0
  536.            dc.w    $0e0,$0d0,$0c0,$0b0,$0a0,$090,$080,$070
  537.            dc.w    $060,$050,$040,$030,$020,$010,$000
  538.            dc.w    $000,$001,$002,$003,$004,$005,$006,$007,$008
  539.            dc.w    $009,$00a,$00b,$00c,$00d,$00e,$00f,$00f
  540.            dc.w    $00e,$00d,$00c,$00b,$00a,$009,$008,$007
  541.            dc.w    $006,$005,$004,$003,$002,$001,$000
  542.            dc.w    $000,$100,$200,$300,$400,$500,$600,$700,$800
  543.            dc.w    $900,$a00,$b00,$c00,$d00,$e00,$f00,$f00
  544.            dc.w    $e00,$d00,$c00,$b00,$a00,$900,$800,$700
  545.            dc.w    $600,$500,$400,$300,$200,$100,$000
  546.            dc.w    $000,$111,$222,$333,$444,$555,$666,$777
  547.            dc.w    $888,$999,$aaa,$bbb,$ccc,$ddd,$eee,$fff
  548.            dc.w    $fff,$eee,$ddd,$ccc,$bbb,$aaa,$999,$888
  549.            dc.w    $777,$666,$555,$444,$333,$222,$111,$000
  550.            dc.w    $008,$018,$028,$038,$048,$058,$068,$078
  551.            dc.w    $088,$098,$0a8,$0b8,$0c8,$0d8,$0e8,$0f8
  552.            dc.w    $0f8,$0e8,$0d8,$0c8,$0b8,$0a8,$098,$088
  553.            dc.w    $078,$068,$058,$048,$038,$028,$018,$008
  554.            dc.w    $008,$108,$208,$308,$408,$508,$608,$708
  555.            dc.w    $808,$908,$a08,$b08,$c08,$d08,$e08,$f08
  556.            dc.w    $f08,$e08,$d08,$c08,$b08,$a08,$908,$808
  557.            dc.w    $708,$608,$508,$408,$308,$208,$108,$008
  558. colortab2
  559. time           dc.w    speed
  560. MyCopper       dc.w    $00e0
  561. bitplanehi     dc.w    $007c
  562.            dc.w    $00e2
  563. bitplanelo     dc.w    $0000
  564.            cmove    $2c81,$008e
  565.            cmove    $f4c1,$0090
  566.            cmove    $0038,$0092
  567.            cmove    $00d0,$0094
  568.            cmove    $0000,$0180
  569.            cmove    $0000,$0120
  570.            cmove    $0000,$0122
  571.            cmove    mod,$108
  572.            cmove    mod,$10a
  573.            cmove    %0001001000000000,$0100
  574.            dc.w    $383b,$fffe
  575. copstart       ds.l    100
  576.            even
  577.            dc.l    0
  578.            ds.l    10
  579.            even
  580. scrollbuffer   ds.b    320
  581.            ds.w    6
  582. charend        dc.w    0
  583. charsave       equ    scrollbuffer+40
  584. intsav           dc.w    0
  585. position       dc.w    0
  586. possave        dc.w    0
  587.            dc.w    50,50,50,50
  588. ptabst
  589. positiontab:    incbin    "ram:sine_data"
  590. ptabend
  591.            even
  592. *------------------ Print rotine
  593. * a0=bitplane
  594. * d0=character
  595. * d1=x
  596. * d2=y
  597. horez           equ    320
  598. charbase       incbin    "df1:charset"
  599. a           set    0
  600. table
  601.            rept   25
  602.            dc.w    a
  603. a           set    a+horez
  604.            endr
  605.  
  606. cprint           movem.l    d0-d3/a0-a1,-(sp)
  607.            lea    table(pc),a1
  608.            add.l    d2,d2
  609.            move.w    0(a1,d2.w),d2
  610.            lea    charbase+2048(pc),a1
  611.            add.l    d0,d0
  612.            add.l    d0,d0
  613.            add.l    d0,d0        ; C=character x 8
  614.            add.l    d0,a1        ; c=c+charbase    Add it to original Base
  615. *------------------ Offset it
  616.            add.l    d2,d1        ; Add X + (Y*8) --> d
  617.            add.l    d1,a0        ; Add d to BITMAP
  618. *------------------ Transfer
  619.            moveq    #8-1,d0
  620.            moveq    #(horez/8),d1
  621. .loop           move.b    (a1)+,d3
  622.            move.b    d3,(a0)
  623.            add.w    d1,a0
  624.            dbra    d0,.loop
  625.            movem.l    (sp)+,d0-d3/a0-a1
  626.            rts
  627. *------------------ Character set plot
  628. putit
  629.            move.l    d7,a0
  630.            moveq    #0,d1
  631.            moveq    #22,d2
  632.            lea    text2(pc),a1
  633.            moveq    #0,d0
  634. hyu           move.b    (a1)+,d0
  635.            beq.s    tend
  636.            cmpi.b    #'a',d0
  637.            blo.s    nolet
  638.            cmpi.b    #'z',d0
  639.            bge.s    nolet
  640.            subi.l    #$60,d0
  641. nolet           bsr    cprint
  642.            addq.l    #1,d1
  643.            bra.s    hyu
  644. tend           rts
  645. text2           dc.b    '-    Insert your screen text here!   -',0
  646.            even
  647. text           dc.b    'OK, This is a TEST of my scroll text for my INTRO. HERE IS THE CAPS CHARACTER SET, HERE is the lower case set. '
  648.            dc.b    'The code is old, sloppy, and redundant, but it works. When I get the time, I will allocate '
  649.            dc.b    'a screen using the OS, remove the forbid, shut down amiga n/m, and see if it is still as '
  650.            dc.b    'smooth. My mail address is rjc@gnu.ai.mit.edu. Have fun disecting my code. Remember, '
  651.            dc.b    'this code is old and I did it when I was still a novice. Note, this program could be '
  652.            dc.b    'done in C except for the beginning of the interupt which would probably need an asm '
  653.            dc.b    'tag routine. ',0
  654.            even
  655.  
  656.  
  657.  
  658.