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

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