home *** CD-ROM | disk | FTP | other *** search
/ Computer Club Elmshorn Atari PD / CCE_PD.iso / pc / 0400 / CCE_0472.ZIP / CCE_0472.PD / HPDESK3 / FASTPRN / FASTPRN.S < prev    next >
Text File  |  1991-10-18  |  3KB  |  161 lines

  1. biosvec    = $B4
  2. savptr     = $4A2
  3. HZ200      = $4BA
  4. prt_vec    = $50A
  5. mfpport    = $FFFA01
  6. mfpddr     = $FFFA05
  7. soundchip  = $FF8800
  8.  
  9.     TEXT
  10.     
  11. prgstart:    move.l        4(sp),basesave
  12.             pea.l        meldung
  13.             move.w        #9,-(sp)
  14.             trap        #1
  15.             addq.l        #6,sp
  16.             pea.l        init
  17.             move.w        #$26,-(sp)
  18.             trap        #$E
  19.             addq.l        #6,sp
  20.             tst            d0
  21.             beq            init_ok
  22.             pea.l        meldung2
  23.             move.w        #9,-(sp)
  24.             trap        #1
  25.             addq.l        #6,sp
  26.             clr.l        -(sp)
  27.             trap        #1
  28.             
  29. init_ok:    move.l        basesave,a1
  30.             move.l        #$100,d0
  31.             add.l        $C(a1),d0
  32.             add.l        $14(a1),d0
  33.             add.l        $1C(a1),d0
  34.             clr.w        -(sp)
  35.             move.l        d0,-(sp)
  36.             move.w        #$31,-(sp)
  37.             trap        #1
  38.             
  39. init:        move.l        biosvec,a1
  40.             move.l        xb_id,d0
  41.             cmp.l        -8(a1),d0
  42.             bne            install
  43.             move        #1,d0
  44.             rts
  45.             
  46. install:    move.l        biosvec,oldbios
  47.             lea.l        tdisp,a1
  48.             move.l        a1,biosvec
  49.             lea.l        dumpin,a1
  50.             move.l        a1,prt_vec
  51.             clr            d0
  52.             rts
  53.             
  54. magic:        dc.b        'XBRA'
  55.  
  56. xb_id:        dc.b        'ECKI'
  57.  
  58. oldbios:    dc.l        0
  59.  
  60. tdisp:        lea.l        6(sp),a1
  61.             btst.b        #$D,(sp)
  62.             bne.b        sup
  63.             move        usp,a1
  64.             
  65. sup:        cmpi.l        #$30000,(a1)
  66.             beq.b        newprt
  67.             cmpi.l        #$80000,(a1)
  68.             beq.b        newstat
  69.             movea.l        oldbios,a0
  70.             jmp            (a0)
  71.             
  72. newstat:    lea.l        _bstat,a0
  73.             bra            jover
  74.             
  75. newprt:        lea.l        _bprn,a0
  76.  
  77. jover:        movea.l        savptr,a1
  78.             move.w        (sp)+,d0
  79.             move.w        d0,-(a1)
  80.             move.l        (sp)+,-(a1)
  81.             movem.l        d1-d7/a2-a7,-(a1)
  82.             move.l        a1,savptr
  83.             btst.l        #$D,d0
  84.             bne.b        super
  85.             move        usp,sp
  86.             
  87. super:        move        4(sp),d0
  88.             jsr            (a0)
  89.             movea.l        savptr,a1
  90.             movem.l        (a1)+,d1-d7/a2-a7
  91.             move.l        (a1)+,-(sp)
  92.             move.w        (a1)+,-(sp)
  93.             move.l        a1,savptr
  94.             rte
  95.             
  96. _bstat:        moveq.l        #-1,d0
  97.             and.b        #$FE,mfpddr
  98.             btst        #0,mfpport
  99.             beq            statend
  100.             moveq.l        #0,d0
  101.             
  102. statend:    rts
  103.  
  104. dumpin:        move        4(sp),d0
  105.             
  106. _bprn:        move.l        HZ200,d2
  107.             sub.l        errtime,d2
  108.             cmp.l        #2000,d2
  109.             bcs            olderror
  110.             move.l        HZ200,d2
  111.             
  112. wait:        and.b        #$FE,mfpddr
  113.             btst        #0,mfpport
  114.             beq            goon
  115.             move.l        HZ200,d1
  116.             sub.l        d2,d1
  117.             cmp.l        #6000,d1
  118.             blt            wait
  119.             
  120. olderror:    clr.l        d0
  121.             move.l        HZ200,errtime
  122.             rts
  123.             
  124. goon:        move.w        SR,-(sp)
  125.             or.w        #$0700,SR
  126.             lea.l        soundchip,a1
  127.             move.b        #7,(a1)
  128.             move.b        (a1),d1
  129.             or.b        #%11000000,d1
  130.             move.b        d1,2(a1)
  131.             move.b        #$0F,(a1)
  132.             move.b        d0,2(a1)
  133.             move.b        #$0E,(a1)
  134.             move.b        (a1),d1
  135.             and.b        #$DF,d1
  136.             move.b        d1,2(a1)
  137. *            move        #100,d2
  138. *w2:        nop
  139. *            dbf            d2,w2
  140.             or.b        #$20,d1
  141.             move.b        d1,2(a1)
  142.             move.w        (sp)+,SR
  143.             move.l        #-1,d0
  144.             rts
  145.             
  146.             DATA
  147.  
  148. meldung:    dc.b        $D,$A,'Centronics-Driver  '
  149.             dc.b        '(c) 1991 by Ecki & c`t',$D,$A,$0
  150.             
  151. meldung2:    dc.b        '...aborted: Driver already'
  152.             dc.b        ' installed',$A,$0
  153.             
  154. EVEN
  155.  
  156. errtime:    dc.l        0
  157.  
  158. EVEN
  159.  
  160. basesave:    ds.l        1
  161.