lea prg(pc),a0 move.l #$1c0000,a1 bsr.s crmlzhdecrunch rts * CrunchMania V1.9t LZ-Huffman Decruncher * Arguments: A0=Crunched A1=DeCrunched * Lzh Tables Are 1248 Bytes Long! CrMLZHDeCrunch: movem.l d0-d7/a0-a6,-(sp) move.l a0,a2 cmp.l #"CrM2",(a2)+ bne.w .no addq.l #2,a2 move.l (a2)+,d1 move.l (a2)+,d2 lea 4(a2),a3 cmp.l a1,a3 ble.s .lbc000036 move.l a1,a3 add.l d1,a3 cmp.l a2,a3 ble.s .lbc000036 move.l a2,a3 lea -4(a1),a4 move.l d2,d7 lsr.l #2,d7 addq.l #1,d7 move.l a4,a2 .lbc000030: move.l (a3)+,(a4)+ subq.l #1,d7 bne.s .lbc000030 .lbc000036: move.l a1,a5 movem.l d5/a4/a5,-(sp) add.l d1,a1 add.l d2,a2 lea .lztable(pc),a6 ; LZ-Huffman Decr.Tables (1248 Bytes!) move.w -(a2),d0 move.l -(a2),d6 moveq #$10,d7 sub.w d0,d7 lsr.l d7,d6 move.w d0,d7 moveq #$10,d3 .lbc000054: lea $049e(a6),a0 moveq #$0f,d2 .lbc00005a: clr.l (a0)+ dbra d2,.lbc00005a lea $04be(a6),a0 lea $009e(a6),a4 moveq #9,d2 bsr .lbc00014a lea $049e(a6),a0 lea $0080(a6),a4 moveq #4,d2 bsr .lbc00014a lea $04be(a6),a3 lea -2(a6),a4 bsr .lbc000182 lea $049e(a6),a3 lea $001e(a6),a4 bsr .lbc000182 moveq #$10,d1 bsr.s .lbc000112 move.w d0,d5 lea $009e(a6),a0 lea -$001e(a0),a5 .lbc0000a2: move.l a6,a4 bsr.s .lbc0000e6 btst #8,d0 bne.s .lbc0000d4 move.w d0,d4 lea $0020(a6),a4 exg a0,a5 bsr.s .lbc0000e6 exg a0,a5 move.w d0,d1 move.w d0,d2 bne.s .lbc0000c2 moveq #1,d1 moveq #$10,d2 .lbc0000c2: bsr.s .lbc000112 bset d2,d0 lea 1(a1,d0.w),a3 .lbc0000ca: move.b -(a3),-(a1) dbra d4,.lbc0000ca move.b -(a3),-(a1) move.b -(a3),d0 .lbc0000d4: move.b d0,-(a1) dbra d5,.lbc0000a2 moveq #1,d1 bsr.s .lbc000112 bne .lbc000054 bra .lbc0001b6 .lbc0000e6: moveq #0,d1 .lbc0000e8: subq.w #1,d7 beq.s .lbc0000f0 lsr.l #1,d6 bra.s .lbc0000fe .lbc0000f0: moveq #$10,d7 move.w d6,d0 lsr.l #1,d6 swap d6 move.w -(a2),d6 swap d6 lsr.w #1,d0 .lbc0000fe: addx.w d1,d1 move.w (a4)+,d0 cmp.w d1,d0 bls.s .lbc0000e8 add.w $003e(a4),d1 add.w d1,d1 move.w 0(a0,d1.w),d0 rts .lbc000112: move.w d6,d0 lsr.l d1,d6 sub.w d1,d7 bgt.s .lbc000122 add.w d3,d7 ror.l d7,d6 move.w -(a2),d6 rol.l d7,d6 .lbc000122: add.w d1,d1 and.w .lbc000128(pc,d1.w),d0 .lbc000128: rts dc.l $00010003,$0007000f,$001f003f,$007f00ff,$01ff03ff dc.l $07ff0fff,$1fff3fff,$7fffffff .lbc00014a: movem.l d1-d5/a3,-(sp) moveq #4,d1 bsr.s .lbc000112 move.w d0,d5 subq.w #1,d5 moveq #0,d4 sub.l a3,a3 .lbc00015a: addq.w #1,d4 move.w d4,d1 cmp.w d2,d1 ble.s .lbc000164 move.w d2,d1 .lbc000164: bsr.s .lbc000112 move.w d0,(a0)+ add.w d0,a3 dbra d5,.lbc00015a move.w a3,d5 subq.w #1,d5 .lbc000172: move.w d2,d1 bsr.s .lbc000112 move.w d0,(a4)+ dbra d5,.lbc000172 movem.l (sp)+,d1-d5/a3 rts .lbc000182: movem.l d0-d7,-(sp) clr.w (a4)+ moveq #$0e,d7 moveq #-1,d4 moveq #0,d2 moveq #0,d3 moveq #1,d1 .lbc000192: move.w (a3)+,d6 move.w d3,$0040(a4) move.w -2(a4),d0 add.w d0,d0 sub.w d0,$0040(a4) add.w d6,d3 mulu d1,d6 add.w d6,d2 move.w d2,(a4)+ lsl.w #1,d2 dbra d7,.lbc000192 movem.l (sp)+,d0-d7 rts .lbc0001b6: movem.l (sp)+,d5/a4/a5 movem.l (sp)+,d0-d7/a0-a6 .no rts ; Final Rts (Jump Address) dc.w 0 .lztable blk.b 1248,0 incdir hd3:audiomega_disk2/ prg incbin crm.insurrection .