home *** CD-ROM | disk | FTP | other *** search
/ Supremacy 2 / Supremacy-2.iso / Pompey / PP_043.MSA / PACK_ICE.211 / ICE_UNPA.S < prev   
Text File  |  1989-04-06  |  3KB  |  145 lines

  1. ;***************************************************************************
  2. ; Unpacking source for Pack-Ice Version 2.1
  3. ; a0: Pointer on packed Data
  4. ; a1: Pointer on destination of unpacked data
  5. decrunch:    movem.l d0-a6,-(sp)
  6.         cmpi.l    #'Ice!',(a0)+    ; Is data packed?
  7.         bne.s    ice_03        ; no!
  8.         move.l    (a0)+,d0    ; read packed data
  9.         lea    -8(a0,d0.l),a5
  10.         move.l    (a0)+,(sp)
  11.         movea.l a1,a4
  12.         movea.l a1,a6
  13.         adda.l    (sp),a6
  14.         movea.l a6,a3
  15.         bsr.s    ice_08
  16.         bsr.s    ice_04
  17.         bsr    ice_0c        ;; Picture decrunch!
  18.         bcc.s    ice_03        ;; These marked lines may be
  19.         move.w    #$0f9f,d7    ;; removed in your own sources
  20. ice_00:        moveq    #3,d6        ;; if you do not use the
  21. ice_01:        move.w    -(a3),d4    ;; additional algorithm.
  22.         moveq    #3,d5        ;;
  23. ice_02:        add.w    d4,d4        ;;
  24.         addx.w    d0,d0        ;;
  25.         add.w    d4,d4        ;;
  26.         addx.w    d1,d1        ;;
  27.         add.w    d4,d4        ;;
  28.         addx.w    d2,d2        ;;
  29.         add.w    d4,d4        ;;
  30.         addx.w    d3,d3        ;;
  31.         dbra    d5,ice_02    ;;
  32.         dbra    d6,ice_01    ;;
  33.         movem.w d0-d3,(a3)    ;;
  34.         dbra    d7,ice_00    ;;
  35. ice_03:        movem.l (sp)+,d0-a6
  36.         rts
  37. ice_04:        bsr.s    ice_0c
  38.         bcc.s    ice_07
  39.         moveq    #0,d1
  40.         bsr.s    ice_0c
  41.         bcc.s    ice_06
  42.         lea    ice_1a(pc),a1
  43.         moveq    #4,d3
  44. ice_05:        move.l    -(a1),d0
  45.         bsr.s    ice_0f
  46.         swap    d0
  47.         cmp.w    d0,d1
  48.         dbne    d3,ice_05
  49.         add.l    20(a1),d1
  50. ice_06:        move.b    -(a5),-(a6)
  51.         dbra    d1,ice_06
  52. ice_07:        cmpa.l    a4,a6
  53.         bgt.s    ice_12
  54.         rts
  55. ice_08:        moveq    #3,d0
  56. ice_09:        move.b    -(a5),d7
  57.         ror.l    #8,d7
  58.         dbra    d0,ice_09
  59.         rts
  60. ice_0a:        move.w    a5,d7
  61.         btst    #0,d7
  62.         bne.s    ice_0b
  63.         move.l    -(a5),d7
  64.         addx.l    d7,d7
  65.         bra.s    ice_11
  66. ice_0b:        move.l    -5(a5),d7
  67.         lsl.l    #8,d7
  68.         move.b    -(a5),d7
  69.         subq.l    #3,a5
  70.         add.l    d7,d7
  71.         bset    #0,d7
  72.         bra.s    ice_11
  73. ice_0c:        add.l    d7,d7
  74.         beq.s    ice_0d
  75.         rts
  76. ice_0d:        move.w    a5,d7
  77.         btst    #0,d7
  78.         bne.s    ice_0e
  79.         move.l    -(a5),d7
  80.         addx.l    d7,d7
  81.         rts
  82. ice_0e:        move.l    -5(a5),d7
  83.         lsl.l    #8,d7
  84.         move.b    -(a5),d7
  85.         subq.l    #3,a5
  86.         add.l    d7,d7
  87.         bset    #0,d7
  88.         rts
  89. ice_0f:        moveq    #0,d1
  90. ice_10:        add.l    d7,d7
  91.         beq.s    ice_0a
  92. ice_11:        addx.w    d1,d1
  93.         dbra    d0,ice_10
  94.         rts
  95. ice_12:        lea    ice_1b(pc),a1
  96.         moveq    #3,d2
  97. ice_13:        bsr.s    ice_0c
  98.         dbcc    d2,ice_13
  99.         moveq    #0,d4
  100.         moveq    #0,d1
  101.         move.b    1(a1,d2.w),d0
  102.         ext.w    d0
  103.         bmi.s    ice_14
  104.         bsr.s    ice_0f
  105. ice_14:        move.b    6(a1,d2.w),d4
  106.         add.w    d1,d4
  107.         beq.s    ice_16
  108.         lea    ice_1c(pc),a1
  109.         moveq    #1,d2
  110. ice_15:        bsr.s    ice_0c
  111.         dbcc    d2,ice_15
  112.         moveq    #0,d1
  113.         move.b    1(a1,d2.w),d0
  114.         ext.w    d0
  115.         bsr.s    ice_0f
  116.         add.w    d2,d2
  117.         add.w    6(a1,d2.w),d1
  118.         bra.s    ice_18
  119. ice_16:        moveq    #0,d1
  120.         moveq    #5,d0
  121.         moveq    #0,d2
  122.         bsr.s    ice_0c
  123.         bcc.s    ice_17
  124.         moveq    #8,d0
  125.         moveq    #$40,d2
  126. ice_17:        bsr.s    ice_0f
  127.         add.w    d2,d1
  128. ice_18:        lea    2(a6,d4.w),a1
  129.         adda.w    d1,a1
  130.         move.b    -(a1),-(a6)
  131. ice_19:        move.b    -(a1),-(a6)
  132.         dbra    d4,ice_19
  133.         bra    ice_04
  134.         DC.B $7f,$ff,$00,$0e,$00,$ff,$00,$07
  135.         DC.B $00,$07,$00,$02,$00,$03,$00,$01
  136.         DC.B $00,$03,$00,$01
  137. ice_1a:        DC.B $00,$00,$01,$0d,$00,$00,$00,$0e
  138.         DC.B $00,$00,$00,$07,$00,$00,$00,$04
  139.         DC.B $00,$00,$00,$01
  140. ice_1b:        DC.B $09,$01,$00,$ff,$ff,$08,$04,$02
  141.         DC.B $01,$00
  142. ice_1c:        DC.B $0b,$04,$07,$00,$01,$20,$00,$00
  143.         DC.B $00,$20
  144. ;***************************************************************************
  145.