wok rev 25708

Add shrinkler
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jul 25 12:01:54 2024 +0000 (3 months ago)
parents e7bac1c24680
children 74fa090e7bcb
files TeXmacs/receipt c-ares-dev/receipt c-ares/receipt ebtables/receipt exiftool/receipt iptstate/receipt memtest/receipt memtest/stuff/pack memtest/stuff/reverse.c memtest/stuff/unlz4.S memtest/stuff/unlzma.S memtest/stuff/unlzsa1.S memtest/stuff/unlzsa2.S memtest/stuff/unzx0.S plop/receipt plop/stuff/pack plop/stuff/unshr.S plop/stuff/unzx0.S shrinkler/receipt
line diff
     1.1 --- a/TeXmacs/receipt	Fri Jul 05 14:08:34 2024 +0000
     1.2 +++ b/TeXmacs/receipt	Thu Jul 25 12:01:54 2024 +0000
     1.3 @@ -7,13 +7,14 @@
     1.4  MAINTAINER="slitaz@leledy.fr"
     1.5  LICENSE="GPL"
     1.6  TARBALL="$PACKAGE-$VERSION-src.tar.gz"
     1.7 -WEB_SITE="http://www.texmacs.org/"
     1.8 +WEB_SITE="https://www.texmacs.org/"
     1.9  WGET_URL="ftp://ftp.texmacs.org/pub/$PACKAGE/targz/$TARBALL"
    1.10  
    1.11  DEPENDS="ghostscript gmp guile freetype TeXmacs-windows-fonts"
    1.12  # freetype and TeXmacs-windows-fonts avoid depending on TeX which is a *huge* system
    1.13  BUILD_DEPENDS="xorg-libX11-dev gmp-dev guile-dev freetype-dev imlib2-dev"
    1.14  
    1.15 +# What is the latest version available today?
    1.16  current_version()
    1.17  {
    1.18  	wget -O - http://ftp.texmacs.org/pub/$PACKAGE/targz/ 2>/dev/null | \
     2.1 --- a/c-ares-dev/receipt	Fri Jul 05 14:08:34 2024 +0000
     2.2 +++ b/c-ares-dev/receipt	Thu Jul 25 12:01:54 2024 +0000
     2.3 @@ -1,7 +1,7 @@
     2.4  # SliTaz package receipt.
     2.5  
     2.6  PACKAGE="c-ares-dev"
     2.7 -VERSION="1.27.0"
     2.8 +VERSION="1.32.0"
     2.9  CATEGORY="development"
    2.10  SHORT_DESC="A C library for asynchronous DNS requests, development files."
    2.11  MAINTAINER="pascal.bellard@slitaz.org"
     3.1 --- a/c-ares/receipt	Fri Jul 05 14:08:34 2024 +0000
     3.2 +++ b/c-ares/receipt	Thu Jul 25 12:01:54 2024 +0000
     3.3 @@ -1,7 +1,7 @@
     3.4  # SliTaz package receipt.
     3.5  
     3.6  PACKAGE="c-ares"
     3.7 -VERSION="1.27.0"
     3.8 +VERSION="1.32.0"
     3.9  CATEGORY="network"
    3.10  SHORT_DESC="A C library for asynchronous DNS requests."
    3.11  MAINTAINER="pascal.bellard@slitaz.org"
    3.12 @@ -9,7 +9,7 @@
    3.13  WEB_SITE="https://c-ares.org/"
    3.14  
    3.15  TARBALL="$PACKAGE-$VERSION.tar.gz"
    3.16 -WGET_URL="${WEB_SITE}download/$TARBALL"
    3.17 +WGET_URL="https://github.com/c-ares/c-ares/releases/download/v$VERSION/$TARBALL"
    3.18  
    3.19  # What is the latest version available today?
    3.20  current_version()
     4.1 --- a/ebtables/receipt	Fri Jul 05 14:08:34 2024 +0000
     4.2 +++ b/ebtables/receipt	Thu Jul 25 12:01:54 2024 +0000
     4.3 @@ -10,7 +10,7 @@
     4.4  WEB_SITE="https://netfilter.org/"
     4.5  
     4.6  TARBALL="$PACKAGE-$VERSION.tar.gz"
     4.7 -WGET_URL="http://ftp.netfilter.org/pub/$PACKAGE/$TARBALL"
     4.8 +WGET_URL="https://ftp.netfilter.org/pub/$PACKAGE/$TARBALL"
     4.9  
    4.10  BUILD_DEPENDS="autoconf automake libtool"
    4.11  
     5.1 --- a/exiftool/receipt	Fri Jul 05 14:08:34 2024 +0000
     5.2 +++ b/exiftool/receipt	Thu Jul 25 12:01:54 2024 +0000
     5.3 @@ -10,7 +10,7 @@
     5.4  
     5.5  SOURCE="Image-ExifTool"
     5.6  TARBALL="$PACKAGE-$VERSION.tar.gz"
     5.7 -WGET_URL="$WEB_SITE/$SOURCE-$VERSION.tar.gz"
     5.8 +WGET_URL=""http://www.cpan.org/authors/id/E/EX/EXIFTOOL/$SOURCE-$VERSION.tar.gz"
     5.9  
    5.10  SUGGESTED="perl-archive-zip perl-io-compress"
    5.11  DEPENDS="perl"
    5.12 @@ -19,7 +19,7 @@
    5.13  # What is the latest version available today?
    5.14  current_version()
    5.15  {
    5.16 -	wget -O - ${WGET_URL%/*} 2>/dev/null | \
    5.17 +	wget -O - $WGET_SITE 2>/dev/null | \
    5.18  	sed "/latest/d;/$SOURCE-/!d;/tar/!d;s|.*$SOURCE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q
    5.19  }
    5.20  
     6.1 --- a/iptstate/receipt	Fri Jul 05 14:08:34 2024 +0000
     6.2 +++ b/iptstate/receipt	Thu Jul 25 12:01:54 2024 +0000
     6.3 @@ -6,7 +6,7 @@
     6.4  SHORT_DESC="IPTState is a top-like interface to your netfilter connection-tracking table."
     6.5  MAINTAINER="paul@slitaz.org"
     6.6  LICENSE="zlib/libpng"
     6.7 -WEB_SITE="https://www.phildev.net/iptstate/"
     6.8 +WEB_SITE="https://github.com/jaymzh/$PACKAGE/"
     6.9  
    6.10  TARBALL="$PACKAGE-$VERSION.tar.bz2"
    6.11  WGET_URL="https://github.com/jaymzh/$PACKAGE/releases/download/v$VERSION/$TARBALL"
     7.1 --- a/memtest/receipt	Fri Jul 05 14:08:34 2024 +0000
     7.2 +++ b/memtest/receipt	Thu Jul 25 12:01:54 2024 +0000
     7.3 @@ -22,7 +22,7 @@
     7.4  
     7.5  asm()
     7.6  {
     7.7 -	cc -o $1.o -Wa,-a=$1.lst -c $1.S
     7.8 +	cc -o $1.o -Wa,-a=$1.lst,-acm -c $1.S
     7.9  	objcopy --only-section=.text -O binary $1.o $1.bin
    7.10  }
    7.11  
     8.1 --- a/memtest/stuff/pack	Fri Jul 05 14:08:34 2024 +0000
     8.2 +++ b/memtest/stuff/pack	Thu Jul 25 12:01:54 2024 +0000
     8.3 @@ -62,9 +62,10 @@
     8.4  {
     8.5  	case "$PACKER" in
     8.6  	lz4) lz4 -l --best | tail -c +5 ;;
     8.7 -	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 ;;
     8.8 -	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 ;;
     8.9 -	zx0) cat > /tmp/in$$$1 ; salvador /tmp/in$$$1 /tmp/out$$$1 ; cat /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;;
    8.10 +	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 ;;
    8.11 +	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 ;;
    8.12 +	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 ;;
    8.13 +	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 ;;
    8.14  	*) xz -z -e --format=raw --lzma1=lc=$(bits LC),lp=$(bits LP),pb=$(bits PB) --stdout 
    8.15  	esac
    8.16  }
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/memtest/stuff/reverse.c	Thu Jul 25 12:01:54 2024 +0000
     9.3 @@ -0,0 +1,17 @@
     9.4 +#include <unistd.h>
     9.5 +
     9.6 +#define BUFSZ 4096
     9.7 +static char output[BUFSZ];
     9.8 +
     9.9 +void main(void)
    9.10 +{
    9.11 +  char input[BUFSZ];
    9.12 +  int i, j, count;
    9.13 +
    9.14 +  count = read(0, input, BUFSZ);
    9.15 +  if (count > 0) {
    9.16 +    main();
    9.17 +    for (i = 0, j = count; j != 0; output[--j] = input[i++]);
    9.18 +    write(1, output, count);
    9.19 +  }
    9.20 +}
    10.1 --- a/memtest/stuff/unlz4.S	Fri Jul 05 14:08:34 2024 +0000
    10.2 +++ b/memtest/stuff/unlz4.S	Thu Jul 25 12:01:54 2024 +0000
    10.3 @@ -33,6 +33,38 @@
    10.4  
    10.5  //#define PARANOIA			// cover rare cases, optional
    10.6  
    10.7 +.macro norm1	reg, seg, ptr 
    10.8 +	movw	\seg, %ax
    10.9 +	movw	\ptr, \reg
   10.10 +#ifdef ONLY8086
   10.11 +	shrw	%cl, \reg
   10.12 +#else
   10.13 +	shrw	$4, \reg
   10.14 +#endif
   10.15 +#ifdef BACKWARD
   10.16 +	subw	$0xFFF, %ax
   10.17 +	orw	$0xFFF0, \ptr
   10.18 +#else
   10.19 +	andw	$0xF, \ptr
   10.20 +#endif
   10.21 +	addw	\reg, %ax
   10.22 +	movw	%ax, \seg
   10.23 +.endm 
   10.24 +
   10.25 +.macro norm	reg
   10.26 +#ifdef ONLY8086
   10.27 +	pushw	%cx
   10.28 +	movb	$4, %cl
   10.29 +#endif
   10.30 +#ifndef FLAT16
   10.31 +	norm1	\reg, %ds, %si
   10.32 +#endif
   10.33 +	norm1	\reg, %es, %di
   10.34 +#ifdef ONLY8086
   10.35 +	popw	%cx
   10.36 +#endif
   10.37 +.endm 
   10.38 +
   10.39  lz4main:
   10.40  #ifdef PARANOIA
   10.41  	cld
   10.42 @@ -115,35 +147,17 @@
   10.43  	pushw	%ds
   10.44  	pushw	%si
   10.45  	movw	%di, %si
   10.46 +	movw	%es, %ax
   10.47 +# ifdef BACKWARD
   10.48 +	addw	%bx, %si
   10.49 +	jnc	axok
   10.50 +	addb	$0x10, %ah
   10.51 +# else
   10.52  	subw	%bx, %si
   10.53 -	movw	%es, %ax
   10.54  	jnc	axok
   10.55  	subb	$0x10, %ah
   10.56 +# endif
   10.57  axok:
   10.58 -.macro norm	reg
   10.59 -	movw	%si, \reg
   10.60 -	andw	$0xF, %si
   10.61 -# ifdef ONLY8086
   10.62 -	pushw	%cx
   10.63 -	movb	$4, %cl
   10.64 -	shrw	%cl, \reg
   10.65 -# else
   10.66 -	shrw	$4, \reg
   10.67 -# endif
   10.68 -	addw	\reg, %ax
   10.69 -	movw	%ax, %ds
   10.70 -	movw	%di, \reg
   10.71 -	andw	$0xF, %di
   10.72 -# ifdef ONLY8086
   10.73 -	shrw	%cl, \reg
   10.74 -	popw	%cx
   10.75 -# else
   10.76 -	shrw	$4, \reg
   10.77 -# endif
   10.78 -	movw	%es, %ax
   10.79 -	addw	\reg, %ax
   10.80 -	movw	%ax, %es
   10.81 -.endm 
   10.82  # if !defined (NeedLz4mov)
   10.83  	norm	%bx
   10.84  	rep movsb
   10.85 @@ -159,8 +173,12 @@
   10.86  # endif
   10.87  lz4notfast:
   10.88  	xchg	AX, SI
   10.89 +# ifdef BACKWARD
   10.90 +	lea	(DI,BX), SI
   10.91 +# else
   10.92  	mov	DI, SI
   10.93  	sub	BX, SI
   10.94 +# endif
   10.95  # ifdef ONLY8086
   10.96  lz4movsb:
   10.97  	movsb	%es:(SI), %es:(DI)	//  NMOS 8088/8086 workaround.
    11.1 --- a/memtest/stuff/unlzma.S	Fri Jul 05 14:08:34 2024 +0000
    11.2 +++ b/memtest/stuff/unlzma.S	Thu Jul 25 12:01:54 2024 +0000
    11.3 @@ -830,11 +830,19 @@
    11.4  #endif
    11.5  #if !defined(FLAT16) && !defined(FLAT32)
    11.6  	testw	%si, %si
    11.7 +# ifdef BACKWARD
    11.8 +	js	RC_READ_BYTE
    11.9 +	movw	%ds, %ax
   11.10 +	decw	%ax
   11.11 +	movw	%ax, %ds
   11.12 +	addw	$16, %si
   11.13 +# else
   11.14  	jns	RC_READ_BYTE
   11.15  	movw	%ds, %ax
   11.16  	incw	%ax
   11.17  	movw	%ax, %ds
   11.18  	addw	$-16, %si
   11.19 +# endif
   11.20  RC_READ_BYTE:
   11.21  #endif
   11.22  	lodsb
    12.1 --- a/memtest/stuff/unlzsa1.S	Fri Jul 05 14:08:34 2024 +0000
    12.2 +++ b/memtest/stuff/unlzsa1.S	Thu Jul 25 12:01:54 2024 +0000
    12.3 @@ -25,10 +25,16 @@
    12.4  #define PACKED_ONLY			// assume no copy block, optional
    12.5  //#define PARANOIA			// cover rare cases, optional
    12.6   
    12.7 -.macro	shrclw cnt,obj
    12.8 +.macro	shrclw cnt,obj,keepcx=0
    12.9  #ifdef ONLY8086
   12.10 +	.if	\keepcx
   12.11 +	pushw	%cx
   12.12 +	.endif
   12.13  	movb	\cnt, %cl
   12.14  	shrw	%cl, \obj
   12.15 +	.if	\keepcx
   12.16 +	popw	%cx
   12.17 +	.endif
   12.18  #else
   12.19  	shrw	\cnt, \obj
   12.20  #endif
   12.21 @@ -39,7 +45,11 @@
   12.22  #endif
   12.23  lzsa1main:
   12.24  #ifdef PARANOIA
   12.25 +# ifdef BACKWARD
   12.26 +	std
   12.27 +# else
   12.28  	cld
   12.29 +# endif
   12.30  #endif
   12.31  #ifndef RAW_FORMAT
   12.32  # ifndef NO_LZSA1_HEADER
   12.33 @@ -107,7 +117,7 @@
   12.34  	movb	$-1, %ah	// set offset bits 15-8 to 1
   12.35  #endif
   12.36  	lodsb
   12.37 -	.byte	0x3C		// mask lodsw with cmpb $0xAD, %al
   12.38 +	.byte	0xA8		// mask lodsw with testb $0xAD, %al
   12.39  lzsa1LongOfs:
   12.40  	lodsw
   12.41  	xchg	AX, BX		// %bx: match offset  %ax: original token
   12.42 @@ -117,24 +127,31 @@
   12.43  	jcxz	lzsa1quit	// bail if we hit EOD
   12.44  #endif
   12.45  
   12.46 +#ifdef BACKWARD
   12.47 +	neg	BX
   12.48 +#endif
   12.49  #if !defined(FLAT16OUT) && !defined(FLAT32)
   12.50  	xchg	AX, SI		// save %si	
   12.51  	lea	(BX,DI), SI
   12.52  	pushw	%ds
   12.53  	movw	%es, %bp
   12.54  	cmpw	%si, %di
   12.55 +# ifdef BACKWARD
   12.56 +	jc	lzsa1sameSeg
   12.57 +# else
   12.58  	jnc	lzsa1sameSeg
   12.59 +# endif
   12.60  	pushw	%si
   12.61 -# ifdef ONLY8086
   12.62 -	pushw	%cx
   12.63 -# endif
   12.64 -	shrclw	$4, %si
   12.65 -# ifdef ONLY8086
   12.66 -	popw	%cx
   12.67 -# endif
   12.68 +	shrclw	$4, %si, 1
   12.69 +# ifdef BACKWARD
   12.70 +	lea	-4095(%bp,%si), %bp
   12.71 +	popw	%si
   12.72 +	orw	$0xFFF0, %si
   12.73 +# else
   12.74  	lea	-4096(%bp,%si), %bp
   12.75  	popw	%si
   12.76  	andw	$0xF, %si
   12.77 +# endif
   12.78  lzsa1sameSeg:
   12.79  	movw	%bp, %ds
   12.80  # ifdef FASTFILL
   12.81 @@ -202,7 +219,7 @@
   12.82  	movb	%al, %ah	// S=256-1791, L=256-4607 or S=256-511, L=256-511
   12.83  	jne	lzsa1midNumber
   12.84  	lodsw			// 0-65535			%cx = word   if (%al & %cl == %cl && %ch + %cl + byte == 0x100)
   12.85 -	.byte	0x3C		// mask lodsb with cmpb $0xAC, %al
   12.86 +	.byte	0xA8		// mask lodsb with testb $0xAC, %al
   12.87  lzsa1midNumber:
   12.88  	lodsb			//				%cx = (%ch + %cl + byte)*256 + byte2   if (%al & %cl == %cl && %ch + %cl + byte > 0x100)
   12.89  lzsa1gotNumber:
    13.1 --- a/memtest/stuff/unlzsa2.S	Fri Jul 05 14:08:34 2024 +0000
    13.2 +++ b/memtest/stuff/unlzsa2.S	Thu Jul 25 12:01:54 2024 +0000
    13.3 @@ -25,10 +25,16 @@
    13.4  #define PACKED_ONLY			// assume no copy block, optional
    13.5  //#define PARANOIA			// cover rare cases, optional
    13.6   
    13.7 -.macro	shrcl cnt,obj
    13.8 +.macro	shrcl cnt,obj,keepcx=0
    13.9  #ifdef ONLY8086
   13.10 +	.if	\keepcx
   13.11 +	pushw	%cx
   13.12 +	.endif
   13.13  	movb	\cnt, %cl
   13.14  	shr	%cl, \obj
   13.15 +	.if	\keepcx
   13.16 +	popw	%cx
   13.17 +	.endif
   13.18  #else
   13.19  	shr	\cnt, \obj
   13.20  #endif
   13.21 @@ -39,7 +45,11 @@
   13.22  #endif
   13.23  lzsa2main:
   13.24  #ifdef PARANOIA
   13.25 +# ifdef BACKWARD
   13.26 +	std
   13.27 +# else
   13.28  	cld
   13.29 +# endif
   13.30  #endif
   13.31  #ifndef RAW_FORMAT
   13.32  # ifndef NO_LZSA2_HEADER
   13.33 @@ -167,6 +177,9 @@
   13.34  	je	lzsa2quit	// bail if we hit EOD in (%si-2)
   13.35  #endif
   13.36  
   13.37 +#ifdef BACKWARD
   13.38 +	neg	BX
   13.39 +#endif
   13.40  #if !defined(FLAT16OUT) && !defined(FLAT32)
   13.41  	xchg	AX, SI		// save %si	
   13.42  	lea	(BX,DI), SI
   13.43 @@ -176,18 +189,22 @@
   13.44  # endif
   13.45  	movw	%es, %bp
   13.46  	cmpw	%si, %di
   13.47 +# ifdef BACKWARD
   13.48 +	jc	lzsa2sameSeg
   13.49 +# else
   13.50  	jnc	lzsa2sameSeg
   13.51 +# endif
   13.52  	pushw	%si
   13.53 -# ifdef ONLY8086
   13.54 -	pushw	%cx
   13.55 -# endif
   13.56 -	shrcl	$4, %si
   13.57 -# ifdef ONLY8086
   13.58 -	popw	%cx
   13.59 -# endif
   13.60 +	shrcl	$4, %si, 1
   13.61 +# ifdef BACKWARD
   13.62 +	lea	-4095(%bp,%si), %bp
   13.63 +	popw	%si
   13.64 +	orw	$0xFFF0, %si
   13.65 +# else
   13.66  	lea	-4096(%bp,%si), %bp
   13.67  	popw	%si
   13.68  	andw	$0xF, %si
   13.69 +# endif
   13.70  lzsa2sameSeg:
   13.71  	movw	%bp, %ds
   13.72  # ifdef FASTFILL
   13.73 @@ -270,7 +287,7 @@
   13.74  # endif
   13.75  	xchgb	%al, %ah	// S=256-4351, L=256-5887
   13.76  	lodsb			//				%cx = (%ch + %cl + 0xE + byte)*256 + byte2   if (%al & %cl == %cl && nibble == 0xF && %ch + %cl + 0xF + byte > 0x100)
   13.77 -	.byte	0xB1		// mask lodsw with movb $0xAD, %cl
   13.78 +	.byte	0xA8		// mask lodsw with testb $0xAD, %al
   13.79  lzsa2maxNumber:
   13.80  #endif
   13.81  	lodsw			// 0-65535			%cx = word   if (%al & %cl == %cl && nibble == 0xF && %ch + %cl + 0xF + byte == 0x100)
    14.1 --- a/memtest/stuff/unzx0.S	Fri Jul 05 14:08:34 2024 +0000
    14.2 +++ b/memtest/stuff/unzx0.S	Thu Jul 25 12:01:54 2024 +0000
    14.3 @@ -40,20 +40,23 @@
    14.4  //  3. This notice may not be removed or altered from any source distribution.
    14.5  
    14.6  zx0_decompress:
    14.7 -        cld                     // make string operations go forward
    14.8          movb    $0x80, %al      // initialize empty bit queue
    14.9                                  // plus bit to roll into carry
   14.10 -        stc
   14.11 -        sbb     BX, BX          // initialize rep-offset to 1
   14.12 +        movw    $-1, BX         // initialize rep-offset to 1
   14.13  
   14.14  .literals:
   14.15  #if !defined(FLAT16) && !defined(FLAT32)
   14.16 -        movw    $32768, %dx
   14.17 -        cmpw    %dx, %si        // assume 32767 literals max
   14.18 -        jb      .si_ok
   14.19 -        subw    %dx, %si
   14.20 +        testw   %si, %si        // assume 32767 literals max
   14.21 +# ifdef BACKWARD
   14.22 +        js      .si_ok
   14.23 +        movw    %ds, %dx
   14.24 +        subb    $8, %dh
   14.25 +# else
   14.26 +        jns     .si_ok
   14.27          movw    %ds, %dx
   14.28          addb    $8, %dh
   14.29 +# endif
   14.30 +        xorw    $0x8000, %si
   14.31          movw    %dx, %ds
   14.32  .si_ok:
   14.33  #endif
   14.34 @@ -68,17 +71,30 @@
   14.35  #if !defined(FLAT16OUT) && !defined(FLAT32)
   14.36          jmp     .copy_match
   14.37  .fix_di:
   14.38 -        subw    $256, %di
   14.39 +# ifdef BACKWARD
   14.40 +        addw    $256*64, %di
   14.41          movw    %es, %dx
   14.42 -        addw    $16, %dx
   14.43 +        subw    $16*64, %dx
   14.44 +        movw    %dx, %es
   14.45 +.copy_match:
   14.46 +        cmpw    $32640, %di     // assume 32639 max window
   14.47 +        jb      .fix_di
   14.48 +# else
   14.49 +        subw    $256*64, %di
   14.50 +        movw    %es, %dx
   14.51 +        addw    $16*64, %dx
   14.52          movw    %dx, %es
   14.53  .copy_match:
   14.54          cmpw    $-32640, %di    // assume 32639 max window
   14.55          ja      .fix_di
   14.56 +# endif
   14.57  #else
   14.58  .copy_match:
   14.59  #endif
   14.60          push    SI              // save si (current pointer to compressed data)
   14.61 +#ifdef BACKWARD
   14.62 +        neg     BX
   14.63 +#endif
   14.64          lea     (BX,DI), SI     // point to destination in es:di + offset in bx
   14.65  #ifdef ONLY8086
   14.66  .copy_loop:
   14.67 @@ -99,11 +115,12 @@
   14.68          je      .done           // exit if EOD marker
   14.69          
   14.70          movb    %cl, %bh        // transfer negative high byte into bh
   14.71 +        xchgw   %ax, %bx
   14.72 +        lodsb                   // read low byte of offset + 1 bit of len
   14.73 +        xchgw   %ax, %bx
   14.74          movw    $1, %cx         // initialize match length value to 1
   14.75 -        movb    (%si), %bl      // read low byte of offset + 1 bit of len
   14.76 -        incw    %si             // inc instruction keep carry set
   14.77                                  // set high bit that is shifted into bit 15
   14.78 -        rcrw    $1, %bx         // shift len bit into carry/offset in place
   14.79 +        rcrw    %cl, %bx        // shift len bit into carry/offset in place
   14.80          call    .elias_bt       // if len bit is set, no need for more
   14.81                                  // else read rest of elias-encoded match length
   14.82          incw    %cx             // fix match length
    15.1 --- a/plop/receipt	Fri Jul 05 14:08:34 2024 +0000
    15.2 +++ b/plop/receipt	Thu Jul 25 12:01:54 2024 +0000
    15.3 @@ -10,7 +10,7 @@
    15.4  TARBALL="plpbt-$VERSION.zip"
    15.5  WGET_URL="https://download.plop.at/files/bootmngr/$TARBALL"
    15.6  
    15.7 -BUILD_DEPENDS="xz lz4 lzsa salvador"
    15.8 +BUILD_DEPENDS="xz lz4 lzsa salvador shrinkler"
    15.9  
   15.10  # What is the latest version available today?
   15.11  current_version()
   15.12 @@ -36,7 +36,7 @@
   15.13  	cp plpbt.bin plop
   15.14  	cp plpbt.bin plop.bin
   15.15  	dd if=/dev/zero bs=1 count=500 seek=3 conv=notrunc of=plop.bin 2> /dev/null
   15.16 -	for c in lzma lz4x2 lzsa1x2 lzsa2x2 zx0 ; do
   15.17 +	for c in lzma lz4x2 lzsa1x2 lzsa2x2 zx0 shr ; do
   15.18  		sed "s|uncompress|un${c%x2}|" < $stuff/unpack.S > unpack.S
   15.19  		cp $stuff/pack .
   15.20  		sed "s/VERSION/$VERSION/;s|lzma1=|&nice=$nice,|" -i pack
    16.1 --- a/plop/stuff/pack	Fri Jul 05 14:08:34 2024 +0000
    16.2 +++ b/plop/stuff/pack	Thu Jul 25 12:01:54 2024 +0000
    16.3 @@ -62,9 +62,10 @@
    16.4  {
    16.5  	case "$PACKER" in
    16.6  	lz4) lz4 -l --best | tail -c +5 ;;
    16.7 -	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 ;;
    16.8 -	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 ;;
    16.9 -	zx0) cat > /tmp/in$$$1 ; salvador /tmp/in$$$1 /tmp/out$$$1 ; cat /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;;
   16.10 +	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 ;;
   16.11 +	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 ;;
   16.12 +	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 ;;
   16.13 +	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 ;;
   16.14  	*) xz -z -e --format=raw --lzma1=lc=$(bits LC),lp=$(bits LP),pb=$(bits PB) --stdout 
   16.15  	esac
   16.16  }
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/plop/stuff/unshr.S	Thu Jul 25 12:01:54 2024 +0000
    17.3 @@ -0,0 +1,143 @@
    17.4 +// https://github.com/pzagrebin/shrd86
    17.5 +// This is depacker for data compressed with Shrinkler by Aske Simon Christensen.
    17.6 +// You can freely use it as you like.
    17.7 +// Uses only 8086 instructions, suitable for IBM PC/XT (~2 KB/s on 4.77 MHz 8088).
    17.8 +// Assembled size is 170/167 bytes.
    17.9 +
   17.10 +#define NUM_CONTEXTS	1024
   17.11 +#define INIT_ONE_PROB	0x8000
   17.12 +#define ADJUST_SHIFT	4
   17.13 +
   17.14 +// How to use:
   17.15 +// ds:si - must point to byte 0x80 immediately followed by compressed data block.
   17.16 +// es:di - decompressed data pointer, value in di must be even!
   17.17 +// Call shrd86, it will rewrite compressed data block with zeroes and can change up to two next bytes.
   17.18 +// It uses 2 KB on the stack.
   17.19 +
   17.20 +.macro	shrclw cnt,obj
   17.21 +#ifdef ONLY8086
   17.22 +	pushw	%cx
   17.23 +	movb	\cnt, %cl
   17.24 +	shrw	%cl, \obj
   17.25 +	popw	%cx
   17.26 +#else
   17.27 +	shrw	\cnt, \obj
   17.28 +#endif
   17.29 +.endm
   17.30 +
   17.31 +shrd86:
   17.32 +	decw	%si
   17.33 +	movw	$NUM_CONTEXTS, %cx
   17.34 +	movw	$INIT_ONE_PROB, %ax
   17.35 +.init_prob:
   17.36 +	pushw	%ax
   17.37 +	loop	.init_prob
   17.38 +	movw	%sp, %cs:prob_base+2	// store table pointer by modifying dummy constant
   17.39 +	pushw	%ax			// make room for offset variable
   17.40 +
   17.41 +// range decoder state
   17.42 +	xorw	%bp, %bp
   17.43 +	incw	%cx			// bp=0 - base / cx=1 - range
   17.44 +
   17.45 +	xorw	%bx, %bx
   17.46 +.lit:
   17.47 +// bl=0 after getkind
   17.48 +	incw	%bx
   17.49 +.getlit:
   17.50 +	call	getbit
   17.51 +	adcb	%bl, %bl
   17.52 +	jnc	.getlit
   17.53 +	xchgw	%ax, %bx
   17.54 +	stosb
   17.55 +
   17.56 +	call	getkind
   17.57 +	jnc	.lit
   17.58 +	movb	$2, %bh
   17.59 +	call	getbit
   17.60 +	jnc	.readoff
   17.61 +.readlen:
   17.62 +	movb	$2, %bh
   17.63 +	call	getnum
   17.64 +	popw	%bx 			// offset value can be reused later, must be saved
   17.65 +	pushw	%bx
   17.66 +.copy:
   17.67 +	movb	%es:(%bx,%di), %al
   17.68 +	stosb
   17.69 +	decw	%dx
   17.70 +	jnz	.copy
   17.71 +
   17.72 +	call	getkind
   17.73 +	jnc	.lit
   17.74 +.readoff:
   17.75 +	movb	$3, %bh
   17.76 +	call	getnum
   17.77 +	negw	%dx
   17.78 +	incw	%dx
   17.79 +	incw	%dx			// offset=2-getnum()
   17.80 +	popw	%ax
   17.81 +	pushw	%dx			// save ofset value
   17.82 +	jnz	.readlen
   17.83 +
   17.84 +.end:
   17.85 +	addw	$NUM_CONTEXTS*2+2, %sp
   17.86 +	ret
   17.87 +
   17.88 +readbit:
   17.89 +	shlb	$1, (%si)
   17.90 +	jnz	.nonewbyte
   17.91 +	incw	%si
   17.92 +// cf=1
   17.93 +	rclb	$1, (%si)
   17.94 +.nonewbyte:
   17.95 +	adcw	%bp, %bp
   17.96 +	addw	%cx, %cx
   17.97 +
   17.98 +getbit:
   17.99 +	testw	%cx, %cx
  17.100 +	jns	readbit
  17.101 +	push	%bx
  17.102 +	add	%bx, %bx
  17.103 +prob_base:
  17.104 +	addw 	$0xDEAD, %bx		// this constant will be rewritten by actual sp value
  17.105 +	movw	%ss:(%bx), %ax
  17.106 +	shrclw	$ADJUST_SHIFT, %ax
  17.107 +	subw	%ax, %ss:(%bx)
  17.108 +	addw	%ss:(%bx), %ax
  17.109 +	mulw	%cx
  17.110 +	subw	%dx, %bp
  17.111 +	jc	.one
  17.112 +	subw	%dx, %cx
  17.113 +	popw	%bx
  17.114 +	ret
  17.115 +.one:
  17.116 +	addw	$0xFFFF>>ADJUST_SHIFT, %ss:(%bx)
  17.117 +	movw	%dx, %cx
  17.118 +	addw	%dx, %bp
  17.119 +	popw	%bx
  17.120 +	ret
  17.121 +
  17.122 +getkind:
  17.123 +	movw	$1, %bx
  17.124 +	andw	%di, %bx		// di value is used as context
  17.125 +           // and Shrinkler assumes it's even for the first byte
  17.126 +	xchgb	%bl, %bh
  17.127 +	jmp	getbit
  17.128 +
  17.129 +getnum:
  17.130 +.numloop:
  17.131 +	incw	%bx
  17.132 +	call	getbit
  17.133 +	jc	.numloop
  17.134 +	negb	%bl
  17.135 +	movw	$1, %dx
  17.136 +.bitloop:
  17.137 +	pushw	%dx
  17.138 +	call	getbit
  17.139 +	popw	%dx
  17.140 +	adcw	%dx, %dx
  17.141 +	incb	%bl
  17.142 +	jnz	.bitloop
  17.143 +	ret
  17.144 +
  17.145 +	.byte	0x80
  17.146 +	.align	2, 0x80
    18.1 --- a/plop/stuff/unzx0.S	Fri Jul 05 14:08:34 2024 +0000
    18.2 +++ b/plop/stuff/unzx0.S	Thu Jul 25 12:01:54 2024 +0000
    18.3 @@ -40,11 +40,9 @@
    18.4  //  3. This notice may not be removed or altered from any source distribution.
    18.5  
    18.6  zx0_decompress:
    18.7 -        cld                     // make string operations go forward
    18.8          movb    $0x80, %al      // initialize empty bit queue
    18.9                                  // plus bit to roll into carry
   18.10 -        stc
   18.11 -        sbb     BX, BX          // initialize rep-offset to 1
   18.12 +        movw    $-1, BX         // initialize rep-offset to 1
   18.13  
   18.14  .literals:
   18.15  #if !defined(FLAT16) && !defined(FLAT32)
   18.16 @@ -68,9 +66,9 @@
   18.17  #if !defined(FLAT16OUT) && !defined(FLAT32)
   18.18          jmp     .copy_match
   18.19  .fix_di:
   18.20 -        subw    $256, %di
   18.21 +        subw    $256*64, %di
   18.22          movw    %es, %dx
   18.23 -        addw    $16, %dx
   18.24 +        addw    $16*64, %dx
   18.25          movw    %dx, %es
   18.26  .copy_match:
   18.27          cmpw    $-32640, %di    // assume 32639 max window
   18.28 @@ -99,11 +97,12 @@
   18.29          je      .done           // exit if EOD marker
   18.30          
   18.31          movb    %cl, %bh        // transfer negative high byte into bh
   18.32 +        xchgw   %ax, %bx
   18.33 +        lodsb                   // read low byte of offset + 1 bit of len
   18.34 +        xchgw   %ax, %bx
   18.35          movw    $1, %cx         // initialize match length value to 1
   18.36 -        movb    (%si), %bl      // read low byte of offset + 1 bit of len
   18.37 -        incw    %si             // inc instruction keep carry set
   18.38                                  // set high bit that is shifted into bit 15
   18.39 -        rcrw    $1, %bx         // shift len bit into carry/offset in place
   18.40 +        rcrw    %cl, %bx        // shift len bit into carry/offset in place
   18.41          call    .elias_bt       // if len bit is set, no need for more
   18.42                                  // else read rest of elias-encoded match length
   18.43          incw    %cx             // fix match length
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/shrinkler/receipt	Thu Jul 25 12:01:54 2024 +0000
    19.3 @@ -0,0 +1,39 @@
    19.4 +# SliTaz package receipt.
    19.5 +
    19.6 +PACKAGE="shrinkler"
    19.7 +VERSION="4.7"
    19.8 +CATEGORY="system-tools"
    19.9 +SHORT_DESC="Cruncher for Amiga executables."
   19.10 +MAINTAINER="pascal.bellard@slitaz.org"
   19.11 +LICENSE="MIT"
   19.12 +WEB_SITE="https://github.com/askeksa/Shrinkler"
   19.13 +
   19.14 +TARBALL="$PACKAGE-$VERSION.tar.gz"
   19.15 +WGET_URL="https://github.com/askeksa/Shrinkler/archive/refs/tags/v$VERSION.tar.gz"
   19.16 +
   19.17 +DEPENDS="gcc83-lib-base"
   19.18 +BUILD_DEPENDS="gcc83"
   19.19 +
   19.20 +# What is the latest version available today?
   19.21 +current_version()
   19.22 +{
   19.23 +	wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
   19.24 +	sed '/tag\//!d;s|.*tag/v*||;s|".*||;q'
   19.25 +}
   19.26 +
   19.27 +# Rules to configure and make the package.
   19.28 +compile_rules()
   19.29 +{
   19.30 +	make CC=gcc-83 CXX=g++-83
   19.31 +}
   19.32 +
   19.33 +# Rules to gen a SliTaz package suitable for Tazpkg.
   19.34 +genpkg_rules()
   19.35 +{
   19.36 +	mkdir -p $fs/usr/bin
   19.37 +	mkdir -p $install/usr/share/doc
   19.38 +
   19.39 +	cp -a $src/build/native/Shrinkler	$fs/usr/bin/
   19.40 +	cp $src/README*	$install/usr/share/doc
   19.41 +	cp $src/LICENS*	$install/usr/share/doc
   19.42 +}