void writelit (unsigned char c) { writeoutf (c, 8); return; } unsigned char CompZX0 (void) { unsigned m, c; unsigned char n; OutBit=8; InEnd=cbm_read (10, &lzdict, 7*1024); if (InEnd==-1) return 1; for (InPos=OutPos=lzoffs=lastlitpos=backlen.len=L16Pos=L16Full=lzo_nument=0; InPos=0x8C00) return 2; if (lzoffs>=7*1024) { lzoffs=0; m=cbm_read (10, &lzdict, 7*1024); if (m==-1) return 1; InEnd+=m; backlen.len=0; lzo_nument=0; lastlitpos=0; } if ((int)(loc=LZO_GetBlock())>=0) { writeoutf_11 (); writeoutf (loc, 11); c=lzdict[lzoffs+len]; writelit (c); LZO_AddBlock (lzoffs, len+1); lastlitpos=lzoffs+len; lzoffs+=len+1; InPos+=len+1; if (lzo_nument>=2000) { writeoutf_11 (); writeoutf (2046, 11); lzo_nument=0; } continue; } else { e: LZO_AddBlock (lzoffs, 2); writeoutf_01 (); c=lzdict[lzoffs]; writelit (c); ++lzoffs; ++InPos; } } writeoutf_11 (); writeoutf (2047, 11); writeoutlast (); return 0; }