2 * xDMS v1.3 - Portable DMS archive unpacker - Public Domain
3 * Written by Andre Rodrigues de la Rocha <adlroc@usa.net>
11 #include <exec/types.h>
19 UWORD medium_text_loc
;
30 UWORD freq
[628]; // freq[T + 1]
31 UWORD prnt
[941]; // prnt[T + N_CHAR]
32 UWORD son
[627]; // son[T];
36 UWORD left
[1019]; // left[2 * NC - 1]
37 UWORD right
[1028]; // right[2 * NC - 1 + 9]
38 UBYTE c_len
[510]; // c_len[NC]
39 UBYTE pt_len
[20]; // pt_len[NPT]
47 UWORD
Calc_CheckSum (const UBYTE
*mem
, ULONG size
);
48 UWORD
CreateCRC (const UBYTE
*mem
, ULONG size
);
51 extern const ULONG mask_bits
[];
52 void initbitbuf (struct xdms_data
*xdms
, UBYTE
*in
);
53 #define INITBITBUF(in) initbitbuf(xdms, in)
54 #define GETBITS(n) ((UWORD)(xdms->bitbuf >> (xdms->bitcount-(n))))
55 #define DROPBITS(n) {xdms->bitbuf &= mask_bits[xdms->bitcount-=(n)]; while (xdms->bitcount<16) {xdms->bitbuf = (xdms->bitbuf << 8) | *xdms->indata++; xdms->bitcount += 8;}}
58 extern const UBYTE d_code
[];
59 extern const UBYTE d_len
[];
62 UWORD
make_table (struct xdms_data
*xdms
, UWORD nchar
, UBYTE bitlen
[],UWORD tablebits
, UWORD table
[]);
65 void Init_Decrunchers (struct xdms_data
*xdms
);
68 UWORD
Unpack_DEEP (struct xdms_data
*xdms
, UBYTE
*in
, UBYTE
*out
, UWORD origsize
);
71 UWORD
Unpack_HEAVY (struct xdms_data
*xdms
, UBYTE
*in
, UBYTE
*out
, UBYTE flags
, UWORD origsize
);
74 UWORD
Unpack_MEDIUM (struct xdms_data
*xdms
, UBYTE
*in
, UBYTE
*out
, UWORD origsize
);
77 UWORD
Unpack_QUICK(struct xdms_data
*xdms
, UBYTE
*in
, UBYTE
*out
, UWORD origsize
);
80 UWORD
Unpack_RLE (struct xdms_data
*xdms
, UBYTE
*in
, UBYTE
*out
, UWORD origsize
);