home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff369.lzh / VaxTerm / src / str.a < prev    next >
Text File  |  1990-08-15  |  3KB  |  159 lines

  1.         INCLUDE        "exec/types.i"
  2.         INCLUDE        "graphics/gfx.i"
  3.         INCLUDE        "graphics/rastport.i"
  4.  
  5.         csect        str.o,0,0,1,2
  6.  
  7.         XDEF        _stretch
  8.  
  9. UPPER_SIDE    EQU        3
  10. LOWER_SIDE    EQU        4
  11. HORIZ_ONLY    EQU        6
  12.  
  13. RASTPORT    EQU        48
  14. X_COORD        EQU        52
  15. Y_COORD        EQU        56
  16. WIDTH        EQU        60
  17. HEIGHT        EQU        64
  18. MODE        EQU        68
  19.  
  20. INNER_WIDTH    EQU        76
  21. INNER_HEIGHT    EQU        80
  22.  
  23. _stretch    MOVEM.L        D2-D7/A2-A6,-(A7)
  24.         MOVEA.L        RASTPORT(A7),A0
  25.         MOVEA.L        rp_BitMap(A0),A0
  26.         MOVE.W        bm_BytesPerRow(A0),D7
  27.         MOVE.L        HEIGHT(A7),D6
  28.         MOVE.W        D6,D2
  29.         SUBQ.W        #1,D2
  30.         MOVE.W        D2,D4
  31.         CMPI.L        #HORIZ_ONLY,MODE(A7)
  32.         BNE        upper_side
  33. horiz_only    MOVE.W        D2,D3
  34.         SUBQ.W        #1,D3
  35.         MOVEQ        #-2,D0
  36.         MOVEQ        #-2,D1
  37.         BRA        counters_set
  38. upper_side    MOVE.L        HEIGHT(A7),D6
  39.         ASR.W        #1,D6
  40.         CMPI.L        #LOWER_SIDE,MODE(A7)
  41.         BEQ        lower_side
  42.         CMPI.L        #UPPER_SIDE,MODE(A7)
  43.         BNE        exit
  44.         SUBQ.W        #1,D6
  45.         MOVEQ        #-1,D0
  46.         MOVEQ        #-2,D1
  47.         BRA        sides
  48. lower_side    MOVEQ        #1,D4
  49.         MOVEQ        #1,D0
  50.         MOVEQ        #2,D1
  51. sides        MOVE.W        D6,D2
  52.         MOVE.W        D2,D3
  53. counters_set    MOVE.W        D4,D5
  54.         SUBQ.W        #1,D5
  55.         MOVE.L        Y_COORD(A7),D6
  56.         ADD.W        D6,D2
  57.         ADD.W        D6,D3
  58.         ADD.W        D6,D4
  59.         ADD.W        D6,D5
  60.         MOVE.L        WIDTH(A7),D6
  61.         ADD.L        X_COORD(A7),D6
  62.         SUBQ.L        #1,D6
  63.         MOVEA.W        D6,A6
  64.         ASR.L        #3,D6
  65.         MULS.W        D7,D2
  66.         ADD.L        D6,D2
  67.         MULS.W        D7,D3
  68.         ADD.L        D6,D3
  69.         MOVE.W        A6,D6
  70.         ANDI.W        #7,D6
  71.         MOVEA.W        #7,A6
  72.         SUBA.W        D6,A6
  73.         MOVE.W        A6,D6
  74.         SWAP        D6
  75.         MOVEA.L        D6,A6
  76.         MOVE.L        WIDTH(A7),D6
  77.         ASL.L        #1,D6
  78.         ADD.L        X_COORD(A7),D6
  79.         SUBQ.L        #1,D6
  80.         MOVEA.W        D6,A6
  81.         ASR.L        #3,D6
  82.         MULS.W        D7,D4
  83.         ADD.L        D6,D4
  84.         MULS.W        D7,D5
  85.         ADD.L        D6,D5
  86.         MULS.W        D7,D0
  87.         MULS.W        D7,D1
  88.         MOVE.L        WIDTH(A7),D6
  89.         ASR.L        #3,D6
  90.         ADD.L        D6,D0
  91.         ASL.L        #1,D6
  92.         ADD.L        D6,D1
  93.         MOVEQ        #0,D7
  94.         MOVE.B        bm_Depth(A0),D7
  95.         SUBQ.B        #1,D7
  96.         ASL.B        #2,D7
  97. plane_loop    MOVEA.L        bm_Planes(A0,D7.W),A1
  98.         MOVEA.L        A1,A2
  99.         ADDA.L        D2,A2
  100.         MOVEA.L        A1,A3
  101.         ADDA.L        D3,A3
  102.         MOVEA.L        A1,A4
  103.         ADDA.L        D4,A4
  104.         MOVEA.L        A1,A5
  105.         ADDA.L        D5,A5
  106.         MOVEM.L        D2-D5,-(A7)
  107.         MOVE.L        INNER_HEIGHT(A7),D3
  108.         ASR.B        #1,D3
  109.         SUBQ.B        #1,D3
  110. line_loop    MOVE.L        INNER_WIDTH(A7),D2
  111.         SUBQ.W        #1,D2
  112.         MOVE.L        A6,D4
  113.         ANDI.B        #7,D4
  114.         MOVEQ        #7,D5
  115.         SUB.B        D4,D5
  116.         SWAP        D4
  117. pixel_loop    BTST.B        D4,(A2)
  118.         BEQ        reset_bit_1
  119.         BSET.B        D5,(A4)
  120.         ADDQ.B        #1,D5
  121.         BSET.B        D5,(A4)
  122.         BRA        bit_set_1
  123. reset_bit_1    BCLR.B        D5,(A4)
  124.         ADDQ.B        #1,D5
  125.         BCLR.B        D5,(A4)
  126. bit_set_1    SUBQ.B        #1,D5
  127.         BTST.B        D4,(A3)
  128.         BEQ        reset_bit_2
  129.         BSET.B        D5,(A5)
  130.         ADDQ.B        #1,D5
  131.         BSET.B        D5,(A5)
  132.         BRA        bit_set_2
  133. reset_bit_2    BCLR.B        D5,(A5)
  134.         ADDQ.B        #1,D5
  135.         BCLR.B        D5,(A5)
  136. bit_set_2    ADDQ.B        #1,D4
  137.         ANDI.B        #7,D4
  138.         BNE        no_next_source
  139.         SUBA.L        #1,A2
  140.         SUBA.L        #1,A3
  141. no_next_source    ADDQ.B        #1,D5
  142.         ANDI.B        #7,D5
  143.         BNE        no_next_dest
  144.         SUBA.L        #1,A4
  145.         SUBA.L        #1,A5
  146. no_next_dest    DBRA        D2,pixel_loop
  147.         ADDA.L        D0,A2
  148.         ADDA.L        D0,A3
  149.         ADDA.L        D1,A4
  150.         ADDA.L        D1,A5
  151.         DBRA        D3,line_loop
  152.         MOVEM.L        (A7)+,D2-D5
  153.         SUBQ.B        #4,D7
  154.         BPL        plane_loop
  155. exit        MOVEM.L        (A7)+,D2-D7/A2-A6
  156.         RTS
  157.  
  158.         END
  159.