home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / gfx / piccon-2.20.lha / PicCon / Sources / init.i < prev    next >
Text File  |  1994-04-13  |  2KB  |  83 lines

  1.     include    includes.i
  2. ;------
  3. start
  4.     movem.l    d0-d7/a0-a6,-(a7)
  5.     move.l    SysBase,a6
  6.     lea    gfxname,a1
  7.     jsr    OpenLibrary(a6)
  8.     move.l    d0,gfxbase
  9.     tst.l    d0
  10.     bne.s    gfxbaseOK
  11.     rts
  12.  
  13. gfxbaseOK
  14.     move.l    #copper,$dff080
  15.     move.w    #$0,$dff088
  16.  
  17.     move.w    #$20,$dff1dc
  18.     move.w    #$0,$dff106
  19.  
  20.     lea     $dff000,a0
  21.     move.w  intenar(a0),intbits
  22.     move.w  dmaconr(a0),dmabits
  23.     move.w  #$7fff,intena(a0)
  24.     move.w  #$7fff,dmacon(a0)
  25.  
  26.     move.w  #DMA_SETCLR!DMA_COPPER!DMA_RASTER!DMA_MASTER,dmacon(a0)
  27.  
  28.     jsr    init
  29.  
  30.     moveq    #0,d0
  31. mainloop
  32.     btst    #$2,$dff016
  33.     beq.s    freeze
  34.  
  35.     bsr    waitline
  36.     bsr    waitnotline
  37.     jsr    main
  38.  
  39. freeze    btst    #$6,$bfe001
  40.     bne.s    mainloop
  41.  
  42. restore_all:
  43.     move.l    gfxbase,a6
  44.     move.l    38(a6),$dff080
  45.     move.w    #0,$dff088
  46.     move.l    SysBase,a6
  47.     move.l    gfxbase,a1
  48.     jsr    CloseLibrary(a6)
  49.  
  50.     or.w    #$8000,intbits
  51.     or.w    #$8000,dmabits
  52.     lea     $dff000,a0
  53.     move.w  #$7fff,intena(a0)
  54.     move.w  #$7fff,dmacon(a0)
  55.  
  56.     move.w  dmabits,dmacon(a0)
  57.     move.w  intbits,intena(a0)
  58.     movem.l    (a7)+,d0-d7/a0-a6
  59.     rts
  60. ;------------------------------------------------------------------------------
  61. waitline:
  62.     move.l    $dff004,d1
  63.     and.l    #$0001ff00,d1
  64.     lsr.l    #8,d1
  65.     cmp.w    d0,d1
  66.     bne.s     waitline
  67.     rts
  68. ;------------------------------------------------------------------------------
  69. waitnotline:
  70.     move.l    $dff004,d1
  71.     and.l    #$0001ff00,d1
  72.     lsr.l    #8,d1
  73.     cmp.w    d0,d1
  74.     beq.s     waitnotline
  75.     rts
  76. ;------------------------------------------------------------------------------
  77. intbits:    dc.w    0
  78. dmabits:    dc.w    0
  79. gfxbase:    dc.l    0
  80. gfxname:    dc.b    'graphics.library',0
  81.     even
  82. ;------------------------------------------------------------------------------
  83.