# HG changeset patch # User Pascal Bellard # Date 1721908914 0 # Node ID 54dc5622a7857e928220a6bb1ad603a9641a2bac # Parent e7bac1c24680e19a6f31f9684e2ccf54da430b95 Add shrinkler diff -r e7bac1c24680 -r 54dc5622a785 TeXmacs/receipt --- a/TeXmacs/receipt Fri Jul 05 14:08:34 2024 +0000 +++ b/TeXmacs/receipt Thu Jul 25 12:01:54 2024 +0000 @@ -7,13 +7,14 @@ MAINTAINER="slitaz@leledy.fr" LICENSE="GPL" TARBALL="$PACKAGE-$VERSION-src.tar.gz" -WEB_SITE="http://www.texmacs.org/" +WEB_SITE="https://www.texmacs.org/" WGET_URL="ftp://ftp.texmacs.org/pub/$PACKAGE/targz/$TARBALL" DEPENDS="ghostscript gmp guile freetype TeXmacs-windows-fonts" # freetype and TeXmacs-windows-fonts avoid depending on TeX which is a *huge* system BUILD_DEPENDS="xorg-libX11-dev gmp-dev guile-dev freetype-dev imlib2-dev" +# What is the latest version available today? current_version() { wget -O - http://ftp.texmacs.org/pub/$PACKAGE/targz/ 2>/dev/null | \ diff -r e7bac1c24680 -r 54dc5622a785 c-ares-dev/receipt --- a/c-ares-dev/receipt Fri Jul 05 14:08:34 2024 +0000 +++ b/c-ares-dev/receipt Thu Jul 25 12:01:54 2024 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="c-ares-dev" -VERSION="1.27.0" +VERSION="1.32.0" CATEGORY="development" SHORT_DESC="A C library for asynchronous DNS requests, development files." MAINTAINER="pascal.bellard@slitaz.org" diff -r e7bac1c24680 -r 54dc5622a785 c-ares/receipt --- a/c-ares/receipt Fri Jul 05 14:08:34 2024 +0000 +++ b/c-ares/receipt Thu Jul 25 12:01:54 2024 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="c-ares" -VERSION="1.27.0" +VERSION="1.32.0" CATEGORY="network" SHORT_DESC="A C library for asynchronous DNS requests." MAINTAINER="pascal.bellard@slitaz.org" @@ -9,7 +9,7 @@ WEB_SITE="https://c-ares.org/" TARBALL="$PACKAGE-$VERSION.tar.gz" -WGET_URL="${WEB_SITE}download/$TARBALL" +WGET_URL="https://github.com/c-ares/c-ares/releases/download/v$VERSION/$TARBALL" # What is the latest version available today? current_version() diff -r e7bac1c24680 -r 54dc5622a785 ebtables/receipt --- a/ebtables/receipt Fri Jul 05 14:08:34 2024 +0000 +++ b/ebtables/receipt Thu Jul 25 12:01:54 2024 +0000 @@ -10,7 +10,7 @@ WEB_SITE="https://netfilter.org/" TARBALL="$PACKAGE-$VERSION.tar.gz" -WGET_URL="http://ftp.netfilter.org/pub/$PACKAGE/$TARBALL" +WGET_URL="https://ftp.netfilter.org/pub/$PACKAGE/$TARBALL" BUILD_DEPENDS="autoconf automake libtool" diff -r e7bac1c24680 -r 54dc5622a785 exiftool/receipt --- a/exiftool/receipt Fri Jul 05 14:08:34 2024 +0000 +++ b/exiftool/receipt Thu Jul 25 12:01:54 2024 +0000 @@ -10,7 +10,7 @@ SOURCE="Image-ExifTool" TARBALL="$PACKAGE-$VERSION.tar.gz" -WGET_URL="$WEB_SITE/$SOURCE-$VERSION.tar.gz" +WGET_URL=""http://www.cpan.org/authors/id/E/EX/EXIFTOOL/$SOURCE-$VERSION.tar.gz" SUGGESTED="perl-archive-zip perl-io-compress" DEPENDS="perl" @@ -19,7 +19,7 @@ # What is the latest version available today? current_version() { - wget -O - ${WGET_URL%/*} 2>/dev/null | \ + wget -O - $WGET_SITE 2>/dev/null | \ sed "/latest/d;/$SOURCE-/!d;/tar/!d;s|.*$SOURCE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q } diff -r e7bac1c24680 -r 54dc5622a785 iptstate/receipt --- a/iptstate/receipt Fri Jul 05 14:08:34 2024 +0000 +++ b/iptstate/receipt Thu Jul 25 12:01:54 2024 +0000 @@ -6,7 +6,7 @@ SHORT_DESC="IPTState is a top-like interface to your netfilter connection-tracking table." MAINTAINER="paul@slitaz.org" LICENSE="zlib/libpng" -WEB_SITE="https://www.phildev.net/iptstate/" +WEB_SITE="https://github.com/jaymzh/$PACKAGE/" TARBALL="$PACKAGE-$VERSION.tar.bz2" WGET_URL="https://github.com/jaymzh/$PACKAGE/releases/download/v$VERSION/$TARBALL" diff -r e7bac1c24680 -r 54dc5622a785 memtest/receipt --- a/memtest/receipt Fri Jul 05 14:08:34 2024 +0000 +++ b/memtest/receipt Thu Jul 25 12:01:54 2024 +0000 @@ -22,7 +22,7 @@ asm() { - cc -o $1.o -Wa,-a=$1.lst -c $1.S + cc -o $1.o -Wa,-a=$1.lst,-acm -c $1.S objcopy --only-section=.text -O binary $1.o $1.bin } diff -r e7bac1c24680 -r 54dc5622a785 memtest/stuff/pack --- a/memtest/stuff/pack Fri Jul 05 14:08:34 2024 +0000 +++ b/memtest/stuff/pack Thu Jul 25 12:01:54 2024 +0000 @@ -62,9 +62,10 @@ { case "$PACKER" in lz4) lz4 -l --best | tail -c +5 ;; - lzsa1) cat > /tmp/in$$$1 ; lzsa XXXR -f1 /tmp/in$$$1 /tmp/out$$$1 ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; - lzsa2) cat > /tmp/in$$$1 ; lzsa XXXR -f2 /tmp/in$$$1 /tmp/out$$$1 ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; - zx0) cat > /tmp/in$$$1 ; salvador /tmp/in$$$1 /tmp/out$$$1 ; cat /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; + lzsa1) cat > /tmp/in$$$1 ; lzsa XXXR -f1 /tmp/in$$$1 /tmp/out$$$1 > /dev/null ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; + lzsa2) cat > /tmp/in$$$1 ; lzsa XXXR -f2 /tmp/in$$$1 /tmp/out$$$1 > /dev/null ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; + zx0) cat > /tmp/in$$$1 ; salvador /tmp/in$$$1 /tmp/out$$$1 > /dev/null ; cat /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; + shr) cat > /tmp/in$$$1 ; shrinkler -d -p -9 /tmp/in$$$1 /tmp/out$$$1 > /dev/null ; cat /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; *) xz -z -e --format=raw --lzma1=lc=$(bits LC),lp=$(bits LP),pb=$(bits PB) --stdout esac } diff -r e7bac1c24680 -r 54dc5622a785 memtest/stuff/reverse.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memtest/stuff/reverse.c Thu Jul 25 12:01:54 2024 +0000 @@ -0,0 +1,17 @@ +#include + +#define BUFSZ 4096 +static char output[BUFSZ]; + +void main(void) +{ + char input[BUFSZ]; + int i, j, count; + + count = read(0, input, BUFSZ); + if (count > 0) { + main(); + for (i = 0, j = count; j != 0; output[--j] = input[i++]); + write(1, output, count); + } +} diff -r e7bac1c24680 -r 54dc5622a785 memtest/stuff/unlz4.S --- a/memtest/stuff/unlz4.S Fri Jul 05 14:08:34 2024 +0000 +++ b/memtest/stuff/unlz4.S Thu Jul 25 12:01:54 2024 +0000 @@ -33,6 +33,38 @@ //#define PARANOIA // cover rare cases, optional +.macro norm1 reg, seg, ptr + movw \seg, %ax + movw \ptr, \reg +#ifdef ONLY8086 + shrw %cl, \reg +#else + shrw $4, \reg +#endif +#ifdef BACKWARD + subw $0xFFF, %ax + orw $0xFFF0, \ptr +#else + andw $0xF, \ptr +#endif + addw \reg, %ax + movw %ax, \seg +.endm + +.macro norm reg +#ifdef ONLY8086 + pushw %cx + movb $4, %cl +#endif +#ifndef FLAT16 + norm1 \reg, %ds, %si +#endif + norm1 \reg, %es, %di +#ifdef ONLY8086 + popw %cx +#endif +.endm + lz4main: #ifdef PARANOIA cld @@ -115,35 +147,17 @@ pushw %ds pushw %si movw %di, %si + movw %es, %ax +# ifdef BACKWARD + addw %bx, %si + jnc axok + addb $0x10, %ah +# else subw %bx, %si - movw %es, %ax jnc axok subb $0x10, %ah +# endif axok: -.macro norm reg - movw %si, \reg - andw $0xF, %si -# ifdef ONLY8086 - pushw %cx - movb $4, %cl - shrw %cl, \reg -# else - shrw $4, \reg -# endif - addw \reg, %ax - movw %ax, %ds - movw %di, \reg - andw $0xF, %di -# ifdef ONLY8086 - shrw %cl, \reg - popw %cx -# else - shrw $4, \reg -# endif - movw %es, %ax - addw \reg, %ax - movw %ax, %es -.endm # if !defined (NeedLz4mov) norm %bx rep movsb @@ -159,8 +173,12 @@ # endif lz4notfast: xchg AX, SI +# ifdef BACKWARD + lea (DI,BX), SI +# else mov DI, SI sub BX, SI +# endif # ifdef ONLY8086 lz4movsb: movsb %es:(SI), %es:(DI) // NMOS 8088/8086 workaround. diff -r e7bac1c24680 -r 54dc5622a785 memtest/stuff/unlzma.S --- a/memtest/stuff/unlzma.S Fri Jul 05 14:08:34 2024 +0000 +++ b/memtest/stuff/unlzma.S Thu Jul 25 12:01:54 2024 +0000 @@ -830,11 +830,19 @@ #endif #if !defined(FLAT16) && !defined(FLAT32) testw %si, %si +# ifdef BACKWARD + js RC_READ_BYTE + movw %ds, %ax + decw %ax + movw %ax, %ds + addw $16, %si +# else jns RC_READ_BYTE movw %ds, %ax incw %ax movw %ax, %ds addw $-16, %si +# endif RC_READ_BYTE: #endif lodsb diff -r e7bac1c24680 -r 54dc5622a785 memtest/stuff/unlzsa1.S --- a/memtest/stuff/unlzsa1.S Fri Jul 05 14:08:34 2024 +0000 +++ b/memtest/stuff/unlzsa1.S Thu Jul 25 12:01:54 2024 +0000 @@ -25,10 +25,16 @@ #define PACKED_ONLY // assume no copy block, optional //#define PARANOIA // cover rare cases, optional -.macro shrclw cnt,obj +.macro shrclw cnt,obj,keepcx=0 #ifdef ONLY8086 + .if \keepcx + pushw %cx + .endif movb \cnt, %cl shrw %cl, \obj + .if \keepcx + popw %cx + .endif #else shrw \cnt, \obj #endif @@ -39,7 +45,11 @@ #endif lzsa1main: #ifdef PARANOIA +# ifdef BACKWARD + std +# else cld +# endif #endif #ifndef RAW_FORMAT # ifndef NO_LZSA1_HEADER @@ -107,7 +117,7 @@ movb $-1, %ah // set offset bits 15-8 to 1 #endif lodsb - .byte 0x3C // mask lodsw with cmpb $0xAD, %al + .byte 0xA8 // mask lodsw with testb $0xAD, %al lzsa1LongOfs: lodsw xchg AX, BX // %bx: match offset %ax: original token @@ -117,24 +127,31 @@ jcxz lzsa1quit // bail if we hit EOD #endif +#ifdef BACKWARD + neg BX +#endif #if !defined(FLAT16OUT) && !defined(FLAT32) xchg AX, SI // save %si lea (BX,DI), SI pushw %ds movw %es, %bp cmpw %si, %di +# ifdef BACKWARD + jc lzsa1sameSeg +# else jnc lzsa1sameSeg +# endif pushw %si -# ifdef ONLY8086 - pushw %cx -# endif - shrclw $4, %si -# ifdef ONLY8086 - popw %cx -# endif + shrclw $4, %si, 1 +# ifdef BACKWARD + lea -4095(%bp,%si), %bp + popw %si + orw $0xFFF0, %si +# else lea -4096(%bp,%si), %bp popw %si andw $0xF, %si +# endif lzsa1sameSeg: movw %bp, %ds # ifdef FASTFILL @@ -202,7 +219,7 @@ movb %al, %ah // S=256-1791, L=256-4607 or S=256-511, L=256-511 jne lzsa1midNumber lodsw // 0-65535 %cx = word if (%al & %cl == %cl && %ch + %cl + byte == 0x100) - .byte 0x3C // mask lodsb with cmpb $0xAC, %al + .byte 0xA8 // mask lodsb with testb $0xAC, %al lzsa1midNumber: lodsb // %cx = (%ch + %cl + byte)*256 + byte2 if (%al & %cl == %cl && %ch + %cl + byte > 0x100) lzsa1gotNumber: diff -r e7bac1c24680 -r 54dc5622a785 memtest/stuff/unlzsa2.S --- a/memtest/stuff/unlzsa2.S Fri Jul 05 14:08:34 2024 +0000 +++ b/memtest/stuff/unlzsa2.S Thu Jul 25 12:01:54 2024 +0000 @@ -25,10 +25,16 @@ #define PACKED_ONLY // assume no copy block, optional //#define PARANOIA // cover rare cases, optional -.macro shrcl cnt,obj +.macro shrcl cnt,obj,keepcx=0 #ifdef ONLY8086 + .if \keepcx + pushw %cx + .endif movb \cnt, %cl shr %cl, \obj + .if \keepcx + popw %cx + .endif #else shr \cnt, \obj #endif @@ -39,7 +45,11 @@ #endif lzsa2main: #ifdef PARANOIA +# ifdef BACKWARD + std +# else cld +# endif #endif #ifndef RAW_FORMAT # ifndef NO_LZSA2_HEADER @@ -167,6 +177,9 @@ je lzsa2quit // bail if we hit EOD in (%si-2) #endif +#ifdef BACKWARD + neg BX +#endif #if !defined(FLAT16OUT) && !defined(FLAT32) xchg AX, SI // save %si lea (BX,DI), SI @@ -176,18 +189,22 @@ # endif movw %es, %bp cmpw %si, %di +# ifdef BACKWARD + jc lzsa2sameSeg +# else jnc lzsa2sameSeg +# endif pushw %si -# ifdef ONLY8086 - pushw %cx -# endif - shrcl $4, %si -# ifdef ONLY8086 - popw %cx -# endif + shrcl $4, %si, 1 +# ifdef BACKWARD + lea -4095(%bp,%si), %bp + popw %si + orw $0xFFF0, %si +# else lea -4096(%bp,%si), %bp popw %si andw $0xF, %si +# endif lzsa2sameSeg: movw %bp, %ds # ifdef FASTFILL @@ -270,7 +287,7 @@ # endif xchgb %al, %ah // S=256-4351, L=256-5887 lodsb // %cx = (%ch + %cl + 0xE + byte)*256 + byte2 if (%al & %cl == %cl && nibble == 0xF && %ch + %cl + 0xF + byte > 0x100) - .byte 0xB1 // mask lodsw with movb $0xAD, %cl + .byte 0xA8 // mask lodsw with testb $0xAD, %al lzsa2maxNumber: #endif lodsw // 0-65535 %cx = word if (%al & %cl == %cl && nibble == 0xF && %ch + %cl + 0xF + byte == 0x100) diff -r e7bac1c24680 -r 54dc5622a785 memtest/stuff/unzx0.S --- a/memtest/stuff/unzx0.S Fri Jul 05 14:08:34 2024 +0000 +++ b/memtest/stuff/unzx0.S Thu Jul 25 12:01:54 2024 +0000 @@ -40,20 +40,23 @@ // 3. This notice may not be removed or altered from any source distribution. zx0_decompress: - cld // make string operations go forward movb $0x80, %al // initialize empty bit queue // plus bit to roll into carry - stc - sbb BX, BX // initialize rep-offset to 1 + movw $-1, BX // initialize rep-offset to 1 .literals: #if !defined(FLAT16) && !defined(FLAT32) - movw $32768, %dx - cmpw %dx, %si // assume 32767 literals max - jb .si_ok - subw %dx, %si + testw %si, %si // assume 32767 literals max +# ifdef BACKWARD + js .si_ok + movw %ds, %dx + subb $8, %dh +# else + jns .si_ok movw %ds, %dx addb $8, %dh +# endif + xorw $0x8000, %si movw %dx, %ds .si_ok: #endif @@ -68,17 +71,30 @@ #if !defined(FLAT16OUT) && !defined(FLAT32) jmp .copy_match .fix_di: - subw $256, %di +# ifdef BACKWARD + addw $256*64, %di movw %es, %dx - addw $16, %dx + subw $16*64, %dx + movw %dx, %es +.copy_match: + cmpw $32640, %di // assume 32639 max window + jb .fix_di +# else + subw $256*64, %di + movw %es, %dx + addw $16*64, %dx movw %dx, %es .copy_match: cmpw $-32640, %di // assume 32639 max window ja .fix_di +# endif #else .copy_match: #endif push SI // save si (current pointer to compressed data) +#ifdef BACKWARD + neg BX +#endif lea (BX,DI), SI // point to destination in es:di + offset in bx #ifdef ONLY8086 .copy_loop: @@ -99,11 +115,12 @@ je .done // exit if EOD marker movb %cl, %bh // transfer negative high byte into bh + xchgw %ax, %bx + lodsb // read low byte of offset + 1 bit of len + xchgw %ax, %bx movw $1, %cx // initialize match length value to 1 - movb (%si), %bl // read low byte of offset + 1 bit of len - incw %si // inc instruction keep carry set // set high bit that is shifted into bit 15 - rcrw $1, %bx // shift len bit into carry/offset in place + rcrw %cl, %bx // shift len bit into carry/offset in place call .elias_bt // if len bit is set, no need for more // else read rest of elias-encoded match length incw %cx // fix match length diff -r e7bac1c24680 -r 54dc5622a785 plop/receipt --- a/plop/receipt Fri Jul 05 14:08:34 2024 +0000 +++ b/plop/receipt Thu Jul 25 12:01:54 2024 +0000 @@ -10,7 +10,7 @@ TARBALL="plpbt-$VERSION.zip" WGET_URL="https://download.plop.at/files/bootmngr/$TARBALL" -BUILD_DEPENDS="xz lz4 lzsa salvador" +BUILD_DEPENDS="xz lz4 lzsa salvador shrinkler" # What is the latest version available today? current_version() @@ -36,7 +36,7 @@ cp plpbt.bin plop cp plpbt.bin plop.bin dd if=/dev/zero bs=1 count=500 seek=3 conv=notrunc of=plop.bin 2> /dev/null - for c in lzma lz4x2 lzsa1x2 lzsa2x2 zx0 ; do + for c in lzma lz4x2 lzsa1x2 lzsa2x2 zx0 shr ; do sed "s|uncompress|un${c%x2}|" < $stuff/unpack.S > unpack.S cp $stuff/pack . sed "s/VERSION/$VERSION/;s|lzma1=|&nice=$nice,|" -i pack diff -r e7bac1c24680 -r 54dc5622a785 plop/stuff/pack --- a/plop/stuff/pack Fri Jul 05 14:08:34 2024 +0000 +++ b/plop/stuff/pack Thu Jul 25 12:01:54 2024 +0000 @@ -62,9 +62,10 @@ { case "$PACKER" in lz4) lz4 -l --best | tail -c +5 ;; - lzsa1) cat > /tmp/in$$$1 ; lzsa XXXR -f1 /tmp/in$$$1 /tmp/out$$$1 ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; - lzsa2) cat > /tmp/in$$$1 ; lzsa XXXR -f2 /tmp/in$$$1 /tmp/out$$$1 ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; - zx0) cat > /tmp/in$$$1 ; salvador /tmp/in$$$1 /tmp/out$$$1 ; cat /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; + lzsa1) cat > /tmp/in$$$1 ; lzsa XXXR -f1 /tmp/in$$$1 /tmp/out$$$1 > /dev/null ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; + lzsa2) cat > /tmp/in$$$1 ; lzsa XXXR -f2 /tmp/in$$$1 /tmp/out$$$1 > /dev/null ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; + zx0) cat > /tmp/in$$$1 ; salvador /tmp/in$$$1 /tmp/out$$$1 > /dev/null ; cat /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; + shr) cat > /tmp/in$$$1 ; shrinkler -d -9 /tmp/in$$$1 /tmp/out$$$1 > /dev/null ; cat /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;; *) xz -z -e --format=raw --lzma1=lc=$(bits LC),lp=$(bits LP),pb=$(bits PB) --stdout esac } diff -r e7bac1c24680 -r 54dc5622a785 plop/stuff/unshr.S --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plop/stuff/unshr.S Thu Jul 25 12:01:54 2024 +0000 @@ -0,0 +1,143 @@ +// https://github.com/pzagrebin/shrd86 +// This is depacker for data compressed with Shrinkler by Aske Simon Christensen. +// You can freely use it as you like. +// Uses only 8086 instructions, suitable for IBM PC/XT (~2 KB/s on 4.77 MHz 8088). +// Assembled size is 170/167 bytes. + +#define NUM_CONTEXTS 1024 +#define INIT_ONE_PROB 0x8000 +#define ADJUST_SHIFT 4 + +// How to use: +// ds:si - must point to byte 0x80 immediately followed by compressed data block. +// es:di - decompressed data pointer, value in di must be even! +// Call shrd86, it will rewrite compressed data block with zeroes and can change up to two next bytes. +// It uses 2 KB on the stack. + +.macro shrclw cnt,obj +#ifdef ONLY8086 + pushw %cx + movb \cnt, %cl + shrw %cl, \obj + popw %cx +#else + shrw \cnt, \obj +#endif +.endm + +shrd86: + decw %si + movw $NUM_CONTEXTS, %cx + movw $INIT_ONE_PROB, %ax +.init_prob: + pushw %ax + loop .init_prob + movw %sp, %cs:prob_base+2 // store table pointer by modifying dummy constant + pushw %ax // make room for offset variable + +// range decoder state + xorw %bp, %bp + incw %cx // bp=0 - base / cx=1 - range + + xorw %bx, %bx +.lit: +// bl=0 after getkind + incw %bx +.getlit: + call getbit + adcb %bl, %bl + jnc .getlit + xchgw %ax, %bx + stosb + + call getkind + jnc .lit + movb $2, %bh + call getbit + jnc .readoff +.readlen: + movb $2, %bh + call getnum + popw %bx // offset value can be reused later, must be saved + pushw %bx +.copy: + movb %es:(%bx,%di), %al + stosb + decw %dx + jnz .copy + + call getkind + jnc .lit +.readoff: + movb $3, %bh + call getnum + negw %dx + incw %dx + incw %dx // offset=2-getnum() + popw %ax + pushw %dx // save ofset value + jnz .readlen + +.end: + addw $NUM_CONTEXTS*2+2, %sp + ret + +readbit: + shlb $1, (%si) + jnz .nonewbyte + incw %si +// cf=1 + rclb $1, (%si) +.nonewbyte: + adcw %bp, %bp + addw %cx, %cx + +getbit: + testw %cx, %cx + jns readbit + push %bx + add %bx, %bx +prob_base: + addw $0xDEAD, %bx // this constant will be rewritten by actual sp value + movw %ss:(%bx), %ax + shrclw $ADJUST_SHIFT, %ax + subw %ax, %ss:(%bx) + addw %ss:(%bx), %ax + mulw %cx + subw %dx, %bp + jc .one + subw %dx, %cx + popw %bx + ret +.one: + addw $0xFFFF>>ADJUST_SHIFT, %ss:(%bx) + movw %dx, %cx + addw %dx, %bp + popw %bx + ret + +getkind: + movw $1, %bx + andw %di, %bx // di value is used as context + // and Shrinkler assumes it's even for the first byte + xchgb %bl, %bh + jmp getbit + +getnum: +.numloop: + incw %bx + call getbit + jc .numloop + negb %bl + movw $1, %dx +.bitloop: + pushw %dx + call getbit + popw %dx + adcw %dx, %dx + incb %bl + jnz .bitloop + ret + + .byte 0x80 + .align 2, 0x80 diff -r e7bac1c24680 -r 54dc5622a785 plop/stuff/unzx0.S --- a/plop/stuff/unzx0.S Fri Jul 05 14:08:34 2024 +0000 +++ b/plop/stuff/unzx0.S Thu Jul 25 12:01:54 2024 +0000 @@ -40,11 +40,9 @@ // 3. This notice may not be removed or altered from any source distribution. zx0_decompress: - cld // make string operations go forward movb $0x80, %al // initialize empty bit queue // plus bit to roll into carry - stc - sbb BX, BX // initialize rep-offset to 1 + movw $-1, BX // initialize rep-offset to 1 .literals: #if !defined(FLAT16) && !defined(FLAT32) @@ -68,9 +66,9 @@ #if !defined(FLAT16OUT) && !defined(FLAT32) jmp .copy_match .fix_di: - subw $256, %di + subw $256*64, %di movw %es, %dx - addw $16, %dx + addw $16*64, %dx movw %dx, %es .copy_match: cmpw $-32640, %di // assume 32639 max window @@ -99,11 +97,12 @@ je .done // exit if EOD marker movb %cl, %bh // transfer negative high byte into bh + xchgw %ax, %bx + lodsb // read low byte of offset + 1 bit of len + xchgw %ax, %bx movw $1, %cx // initialize match length value to 1 - movb (%si), %bl // read low byte of offset + 1 bit of len - incw %si // inc instruction keep carry set // set high bit that is shifted into bit 15 - rcrw $1, %bx // shift len bit into carry/offset in place + rcrw %cl, %bx // shift len bit into carry/offset in place call .elias_bt // if len bit is set, no need for more // else read rest of elias-encoded match length incw %cx // fix match length diff -r e7bac1c24680 -r 54dc5622a785 shrinkler/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/shrinkler/receipt Thu Jul 25 12:01:54 2024 +0000 @@ -0,0 +1,39 @@ +# SliTaz package receipt. + +PACKAGE="shrinkler" +VERSION="4.7" +CATEGORY="system-tools" +SHORT_DESC="Cruncher for Amiga executables." +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="MIT" +WEB_SITE="https://github.com/askeksa/Shrinkler" + +TARBALL="$PACKAGE-$VERSION.tar.gz" +WGET_URL="https://github.com/askeksa/Shrinkler/archive/refs/tags/v$VERSION.tar.gz" + +DEPENDS="gcc83-lib-base" +BUILD_DEPENDS="gcc83" + +# What is the latest version available today? +current_version() +{ + wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \ + sed '/tag\//!d;s|.*tag/v*||;s|".*||;q' +} + +# Rules to configure and make the package. +compile_rules() +{ + make CC=gcc-83 CXX=g++-83 +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/bin + mkdir -p $install/usr/share/doc + + cp -a $src/build/native/Shrinkler $fs/usr/bin/ + cp $src/README* $install/usr/share/doc + cp $src/LICENS* $install/usr/share/doc +}