home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 4: Demo 1 / almathera_demo1.bin / sourcecode / german / ltest.s < prev    next >
Text File  |  1995-03-17  |  7KB  |  362 lines

  1. BitPlane1=$50000    ;Adresse Bitplane 1
  2. BitPlane2=$54000    ;Adresse Bitplane 2
  3. BitPlane3=$58000    ;Adresse Bitplane 3
  4. BitPlane4=$5c000    ;Adresse Bitplane 4
  5. BitPlane5=$60000    ;Adresse BItplane 5
  6. Exec=4            ;Basisadresse Execbase
  7. Permit=-138        ;Stop Multitasking
  8. Open= -30
  9. Close= -30 -6
  10. Read= -30 -12
  11. Forbid=-132        ;Start Multitasking
  12. OpenLibrary=-408    
  13. CloseLibrary=-414
  14. InitRastPort=-198
  15. InitBitMap=-390
  16. SetRast= -30 -204
  17. Move= -30 -210
  18. Draw= -30 -216
  19. Text= -30 -30
  20. RectFill= -30 -276
  21. ScrollRaster= -30 -366
  22. WritePixel= -30 -294
  23. SetAPen= -30 -312
  24. WaitTOF= -30 -240
  25.  
  26. start:
  27.     jsr setup    ;Initialisiert die Bitmaps und
  28.             ;oeffnet benoetigte Libraries
  29.  
  30. grafik:
  31.     jsr setcopper
  32.     move.l gfxbase,a6
  33.     lea rastport,a1
  34.     move.l #1,d0             ; Farbe für Laufschrift
  35.      jsr setapen(a6)         
  36. init:    move.l #text1,a2
  37.     move.l #len1-text1,d7
  38.     sub #1,d7    
  39.     move.b #1,dauer
  40.  
  41. l2:
  42.     sub.b #1,dauer
  43.     bne no
  44.     move.b #3,dauer
  45. ;    eor.b #2,$bfe001
  46. no:    jsr set1                ; Setzt den Cursor auf die 1L
  47.     move.l a2,a0
  48.     move.l gfxbase,a6
  49.     lea rastport,a1
  50.     move.l #2,d0            ; Farbe für Laufschrift
  51.     jsr setapen(a6)
  52.     move.w #1,d0
  53.     jsr text(a6)            ; a0 = string, d0 = count
  54.     jsr set2                ; Setzt den Cursor auf die 2L
  55.     move.l a2,a0
  56.     move.l gfxbase,a6
  57.     move.w #3,d0            ; Farbe für Laufschrift
  58.     jsr setapen(a6)
  59.     lea rastport,a1
  60.     move.w #1,d0
  61.     jsr text(a6)
  62.     jsr scroll
  63.     add.l #1,a2
  64.     jsr wait
  65.     dbra d7,l2
  66.     jmp init
  67.  
  68. scroll:
  69.     move #4,d6
  70. l1:    move.l gfxbase,a6
  71.     jsr waittof(a6)
  72.     lea rastport,a1
  73.     move.w #2,d0            ; Geschwindigkeit 1 Sch. in x
  74.     move.w #0,d1            ;        "        1  "   in y
  75.     move.w #0,d2            ; x min.
  76.     move.w #180,d3          ; y min.
  77.     move.w #330,d4          ; x max.
  78.     move.w #187,d5          ; y max.
  79.     jsr scrollraster(a6)
  80.     move.l gfxbase,a6
  81.     lea rastport,a1
  82.     move.w #3,d0            ; Geschwindigkeit 2 Sch. in x
  83.     move.w #0,d1            ;        "        2  "   in y
  84.     move.w #0,d2            ; x min.
  85.     move.w #191,d3          ; y min.
  86.     move.w #330,d4          ; x max.
  87.     move.w #200,d5          ; x min.
  88.     jsr scrollraster(a6)
  89.     dbra d6,l1
  90.     rts
  91.  
  92. set1:    move.l gfxbase,a6
  93.     lea rastport,a1
  94.     move.l #321,d0
  95.     move.l #197,d1
  96.     jsr move(a6)
  97.     rts
  98.  
  99. set2:    move.l gfxbase,a6
  100.     lea rastport,a1
  101.     move.l #321,d0
  102.     move.l #186,d1 ; 186
  103.     jsr move(a6)
  104.     rts
  105.  
  106. wait:
  107.     andi.b    #64,$bfe001    ;Bit 7 (linke Maustaste)
  108.     beq stop
  109.     rts
  110. stop:
  111.     move.l    oldcop,(a0)    ;Alte Copperliste wieder bereit-
  112.     move.l exec,a6
  113.     move.l    GfxBase,a1    ;stellen und Gfxlibrary
  114.     jsr    CloseLibrary(a6);schliessen
  115.     move.l dos_base,a1
  116.     jsr closelibrary(a6)
  117.     jsr    Permit(a6)    ;Multitasking wieder zulassen
  118.     ILLEGAL            ;Rueckkehr zum SEKA
  119.     rts            ;ende
  120.  
  121. setup:
  122.     move.l    Exec,a6        ;Exebase-Adresse nach a6
  123.     jsr    Forbid(a6)    ;Stop Multitasking
  124.  
  125.     move.l exec,a6
  126.     lea.l dosname,a1
  127.     jsr Openlibrary(a6)
  128.     move.l d0,dos_base
  129.  
  130.     lea    GrName,a1    ;Gfxname nach a1
  131.     jsr    OpenLibrary(a6)    ;Gfxlibrary oeffnen
  132.     move.l    d0,GfxBase    ;Basisadresse buffern
  133.     move.l    d0,a6
  134.     add.l    #$32,d0
  135.     move.l    d0,copptr
  136.  
  137. ; ---- Setup the BitMap
  138.  
  139.     lea    BitMap,a0    ;Bitmapstruktur nach a0
  140.     moveq    #5,d0        ;Tiefe (5 Bitplanes)
  141.     move.l    #640,d1        ;320 Pixel nach x
  142.     move.l    #200,d2        ;200 Pixel nach y
  143.     jsr    InitBitMap(a6)    ;Bitmap Initialisieren
  144.     lea    RastPort,a1    ;erhaltenen Rastport nach a1
  145.     jsr    InitRastPort(a6);Rastport initialisieren    
  146.     move.l    #BitMap,R_BitMap
  147.  
  148.  
  149.     move.l    #BitPlane1,d0    ;Adresse Bitplane nach d0
  150.     move.l    d0,Plane1    ;Adresse auch nach Plane1
  151.     move.l    d0,a0        ;und nach Adressregister a0
  152.     move.w    d0,lo1        ;sowie in Copperliste speichern
  153.     swap    d0        ;Hi-Nibble isolieren und eben-
  154.     move.w    d0,hi1        ;falls nach Copperliste
  155.     move.l    #16000,d0    ;8000 Bytes fuer Bitplane bele-
  156.     move.b    #$00,d1        ;gen
  157. cl1:    move.b    d1,(a0)+
  158.     dbf    d0,cl1
  159.  
  160.     move.l    #BitPlane2,d0
  161.     move.l d0,Plane2
  162.     move.l d0,a0
  163.     move.w d0,lo2
  164.     swap d0
  165.     move.w d0,hi2
  166.     move.l #16000,d0
  167.     move.b #$00,d1
  168. cl2:    move.b d1,(a0)+
  169.     dbf d0,cl2
  170.  
  171.     move.l    #BitPlane3,d0
  172.     move.l    d0,Plane3
  173.     move.l    d0,a0
  174.     move.w    d0,lo3
  175.     swap    d0
  176.     move.w    d0,hi3
  177.     move.l    #16000,d0
  178.     move.b    #$00,d1
  179. cl3:    move.b    d1,(a0)+
  180.     dbf    d0,cl3
  181.  
  182.     move.l    #BitPlane4,d0
  183.     move.l    d0,Plane4
  184.     move.l    d0,a0
  185.     move.w    d0,lo4
  186.     swap    d0
  187.     move.w    d0,hi4
  188.     move.l    #16000,d0
  189.     move.b    #$00,d1
  190. cl4:    move.b    d1,(a0)+
  191.     dbf    d0,cl4
  192.  
  193.     move.l    #BitPlane5,d0
  194.     move.l    d0,Plane5
  195.     move.l    d0,a0
  196.     move.w    d0,lo5
  197.     swap    d0
  198.     move.w    d0,hi5
  199.     move.l    #16000,d0
  200.     move.b    #$00,d1
  201. cl5:    move.b    d1,(a0)+
  202.     dbf    d0,cl5
  203.     rts
  204.  
  205. setcopper:
  206.     move.l    copptr,a0    ;Adresse der Copperliste nach a0
  207.     move.l    (a0),oldcop    ;Alte Liste zwischenspeichern
  208.     move.l    #Copper,(a0)    ;Neue Liste fue Copper
  209.     rts
  210.     
  211.  
  212.  
  213. Copper:
  214.     DC.W    $0180
  215. co0:    dc.w    $0000
  216.     DC.W    $0182
  217. co1:    dc.w    $0fff
  218.     DC.W    $0184
  219. co2:    dc.w    $000f
  220.     DC.W    $0186    
  221. co3:    dc.w    $0f00
  222.     DC.W    $0188
  223. co4:    dc.w    $000f
  224.     DC.W    $018a
  225. co5:    dc.w    $0f0f
  226.     DC.W    $018c
  227. co6:    dc.w    $00ff
  228.     DC.W    $018e
  229. co7:    dc.w    $f0ff
  230.     DC.W    $0190
  231. co8:    dc.w    $0620
  232.     DC.W    $0192
  233. co9:    dc.w    $0e50
  234.     DC.W    $0194
  235. co10:    dc.w    $09f1
  236.     DC.W    $0196    
  237. co11:    dc.w    $0eb0
  238.     dc.w    $0198
  239. co12:    dc.w    $055f
  240.     dc.w    $019a
  241. co13:    dc.w    $092f
  242.     dc.w    $019c
  243. co14:    dc.w    $00f8
  244.     dc.w    $019e
  245. co15:    dc.w    $0ccc
  246.     dc.w    $01a0
  247. co16:    dc.w    $0000        
  248.     dc.w    $01a2
  249. co17:    dc.w    $0d22
  250.     dc.w    $01a4
  251. co18:    dc.w    $0000
  252.     dc.w    $01a6
  253. co19:    dc.w    $0fca
  254.     dc.w    $01a8
  255. co20:    dc.w    $0444    
  256.     dc.w    $01aa
  257. co21:    dc.w    $0555
  258.     dc.w    $01ac
  259. co22:    dc.w    $0666
  260.     dc.w    $01ae
  261. co23:    dc.w    $0777
  262.     dc.w    $01b0
  263. co24:    dc.w    $0888
  264.     dc.w    $01b2
  265. co25:    dc.w    $0999
  266.     dc.w    $01b4
  267. co26:    dc.w    $0aaa
  268.     dc.w    $01b6
  269. co27:    dc.w    $0bbb
  270.     dc.w    $01b8
  271. co28:    dc.w    $0ccc
  272.     dc.w    $01ba
  273. co29:    dc.w    $0ddd
  274.     dc.w    $01bc
  275. co30:    dc.w    $0eee
  276.     dc.w    $01be
  277. co31:    dc.w    $0fff
  278.     DC.W    $00e0
  279. hi1:    DC.W    $0002
  280.     DC.W    $00e2
  281. lo1:    DC.W    $1000
  282.     DC.W    $00e4
  283. hi2:    DC.W    $0002
  284.     DC.W    $00e6
  285. lo2:    DC.W    $1000
  286.     DC.W    $00e8
  287. hi3:    DC.W    $0002
  288.     DC.W    $00ea
  289. lo3:    DC.W    $1000
  290.     DC.W    $00ec
  291. hi4:    DC.W    $0002
  292.     DC.W    $00ee
  293. lo4:    DC.W    $1000
  294.     DC.W    $00f0
  295. hi5:    DC.W    $0002
  296.     DC.W    $00f2
  297. lo5:    DC.W    $1000
  298.     DC.W    $0100,%0101000000000000
  299.     DC.W    $0102
  300. delay:    DC.W    $ff
  301.     DC.W    $0108,38
  302.     DC.W    $010a,38
  303.     DC.W    $0092,$0030
  304.     DC.W    $0094,$00d0
  305.     DC.W    $008e,$3681
  306.     DC.W    $0090,$fdc1
  307.     DC.W    $ffff,$fffe
  308.  
  309. ;----- Hier beginnt die Bitmap-Struktur -----
  310.  
  311.  
  312. BitMap:
  313. BytesPerRow:     blk.w 1,0
  314. Bytes:        blk.w 1,0
  315. Flags:         blk.b 1,0
  316. Depth:         blk.b 1,0
  317. Pad:          blk.w 1,0
  318. Plane1:        blk.l 1,0
  319. Plane2:        blk.l 1,0
  320. Plane3:        blk.l 1,0
  321. Plane4:        blk.l 1,0
  322. Plane5:        blk.l 1,0
  323. Planes:        blk.l 1,0
  324.  
  325.  
  326. ;----- Hier beginnt die Rasterport-Struktur -----
  327.  
  328. RastPort:
  329.         blk.l 1,0
  330. R_BitMap:    blk.l 1,0
  331.         blk.b 2+4+4+4+8,0
  332.         blk.b 4,0
  333. cp_x:        blk.w 1,0
  334. cp_y:        blk.w 1,0
  335.            blk.b 8+22+[7*2]+[2*4]+8,0
  336.         blk.w 6,0
  337. even
  338. filename:    DC.B 'df1:lightlogo.lo5',0
  339. GrName:        DC.B 'graphics.library',0
  340. Dosname:    DC.B 'dos.library',0
  341. even
  342.  
  343. copptr:        blk.l 1,0
  344. oldcop:        blk.l 1,0
  345. GfxBase:    blk.l 1,0
  346. Dos_base:    blk.l 1,0
  347. bif:        blk.l 1,0
  348. disk_buf:    blk.l 1,0
  349. col_buf:    dc.w  64,0
  350.  
  351. align 4
  352.  
  353. text1:    
  354.  
  355. dc.b '           '
  356. dc.b 'Hallo Angel das ist der Quellecode der '
  357. dc.b 'Laufschrift cool wa !!! - oder wie du '
  358. dc.b 'sagst echt SCHIMMLIG - So long S I D - '
  359. len1:    equ *
  360.  
  361. dauer:    dc.b 1,0
  362.