wok rev 21729

Add npush & oldrunner
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jun 12 18:55:55 2019 +0200 (3 days ago)
parents 982e49d39cc7
children c101210f8efc
files linld/stuff/src/ISO9660.CPP linld/stuff/src/pipehole.awk npush/receipt oldrunner/receipt
line diff
     1.1 --- a/linld/stuff/src/ISO9660.CPP	Wed Jun 12 17:42:20 2019 +0100
     1.2 +++ b/linld/stuff/src/ISO9660.CPP	Wed Jun 12 18:55:55 2019 +0200
     1.3 @@ -77,7 +77,7 @@
     1.4  			endname = p + len;
     1.5  		}
     1.6  		p += len;
     1.7 -	} while (x->buffer + x->curpos + size - p > 2);
     1.8 +	} while (x->buffer + x->curpos + size - 2 > p);
     1.9  	if (endname)
    1.10  		*endname = 0;
    1.11  	else
     2.1 --- a/linld/stuff/src/pipehole.awk	Wed Jun 12 17:42:20 2019 +0100
     2.2 +++ b/linld/stuff/src/pipehole.awk	Wed Jun 12 18:55:55 2019 +0200
     2.3 @@ -1,16 +1,51 @@
     2.4 -BEGIN { hold=0 }
     2.5 +BEGIN { hold=0; is386=0; isload=0; wascall=0 }
     2.6  function isnum(n) { return match(n,/^[0-9+-]/) }
     2.7  {
     2.8  	sub(/segment word public/,"segment byte public")
     2.9  
    2.10  	if (/^@.*:$/ || /	endp$/) afterjmp=0
    2.11 +	if (/dword ptr/) is386=1
    2.12 +	if (/heap_top = _rm_buf/) isload=1
    2.13 +	if (isload) {  # LOAD.LST
    2.14 +		if (/mov	al,byte ptr/ && is386) {
    2.15 +			print "	movzx	eax,byte ptr [si]"
    2.16 +			next
    2.17 +		}
    2.18 +		if (/ax,word ptr/) next
    2.19 +		if (/^	call/) isload=0
    2.20 +	}
    2.21 +	if (/const char \*n = name, \*i = x->filename;/) isiso=1
    2.22 +	if (isiso) { # ISO9660.LST
    2.23 +		if ((/mov	word ptr \[bp-6\],ax/ ) ||
    2.24 +		    (/mov	ax,word ptr \[bp-2\]/) ||
    2.25 +		    (/bx,word ptr \[bp-6\]/) || (/ax,dx/)) next
    2.26 +		if (/dx,/) sub(/dx/,"ax")
    2.27 +		if ((/sub	ax,word ptr \[bp-2\]/) ||
    2.28 +		    (/\[di\+12\]/) || (/ax,si/)) sub(/ax/,"bx")
    2.29 +		if (/add	word ptr \[bp-6\],ax/) $0="	add	bx,word ptr [di+12]"
    2.30 +		if (/@strcmp\$qpxzct1/) isiso=0
    2.31 +	}
    2.32 +	if (wascall) {
    2.33 +		if (rcall != "") {
    2.34 +			if (/,ax$/) 	print "	mov	" rcall ",ax"
    2.35 +			else		print "	xchg	ax," rcall
    2.36 +			wascall=0
    2.37 +		}
    2.38 +		else if (/^	mov	.i,ax$/) {
    2.39 +			split($2,y,",")
    2.40 +			rcall=y[1]
    2.41 +			next
    2.42 +		}
    2.43 +		else wascall=0
    2.44 +	}
    2.45 +	if (/^	call	/) { wascall=1; rcall="" }
    2.46  	if (hold == 0) {
    2.47  		s=$0
    2.48  		if (/^	mov	.[ix],bx$/ || /^	mov	.[ix],.i$/) {
    2.49  			r=$2; kept=0
    2.50  			hold=1; split($2,regs,","); next
    2.51  		}
    2.52 -		if (/^	inc	e?.[ix]/ || /^	dec	e?.[ix]/) {
    2.53 +		if (/^	inc	e?.[ixhl]/ || /^	dec	e?.[ixhl]/) {
    2.54  			hold=2; r=$2; next
    2.55  		}
    2.56  		if (/^	mov	[abcds][ix],/ && ! /,.s/) {
    2.57 @@ -64,7 +99,10 @@
    2.58  		for (i = 0; i < kept; i++) print line[i]; kept=0
    2.59  	}
    2.60  	else if (hold == 2) {
    2.61 -		hold=0; split($2,args,","); print s
    2.62 +		split($0,args,",")
    2.63 +		if (/^	mov	/ && r == args[2]) { print s; s=$0; next }
    2.64 +		split($2,args,",")
    2.65 +		hold=0; print s
    2.66  		if ($1 == "or" && r == args[1] && r == args[2]) next	# don't clear C ...
    2.67  	}
    2.68  	else if (hold == 3) {
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/npush/receipt	Wed Jun 12 18:55:55 2019 +0200
     3.3 @@ -0,0 +1,29 @@
     3.4 +# SliTaz package receipt.
     3.5 +
     3.6 +PACKAGE="npush"
     3.7 +VERSION="0.7"
     3.8 +CATEGORY="games"
     3.9 +SHORT_DESC="http://npush.sourceforge.net/"
    3.10 +MAINTAINER="pascal.bellard@slitaz.org"
    3.11 +LICENSE="GPL2"
    3.12 +TARBALL="$PACKAGE-$VERSION.tgz"
    3.13 +WEB_SITE="http://zsync.moria.org.uk/"
    3.14 +WGET_URL="$SF_MIRROR/$PACKAGE/$VERSION/$TARBALL"
    3.15 +
    3.16 +BUILD_DEPENDS="ncurses"
    3.17 +
    3.18 +# Rules to configure and make the package.
    3.19 +compile_rules()
    3.20 +{
    3.21 +	sed -i 's|"levels|"/usr/share/npush|' npush.cpp
    3.22 +	sed -i 's|-lncurses|& -ltinfo|' Makefile
    3.23 +	make
    3.24 +}
    3.25 +
    3.26 +# Rules to gen a SliTaz package suitable for Tazpkg.
    3.27 +genpkg_rules()
    3.28 +{
    3.29 +	mkdir -p $fs/usr/bin $fs/usr/share
    3.30 +	cp -a $src/levels $fs/usr/share/npush
    3.31 +	cp $src/npush $fs/usr/bin
    3.32 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/oldrunner/receipt	Wed Jun 12 18:55:55 2019 +0200
     4.3 @@ -0,0 +1,31 @@
     4.4 +# SliTaz package receipt.
     4.5 +
     4.6 +PACKAGE="oldrunner"
     4.7 +VERSION="20120131"
     4.8 +CATEGORY="games"
     4.9 +SHORT_DESC="a text-based remake of Broderbund's Loderunner"
    4.10 +MAINTAINER="pascal.bellard@slitaz.org"
    4.11 +LICENSE="BSD"
    4.12 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    4.13 +WEB_SITE="http://culot.org/public/Code/oldrunner.html"
    4.14 +WGET_URL="http://freebsd.sin.openmirrors.asia/pub/FreeBSD/ports/local-distfiles/culot/$TARBALL"
    4.15 +
    4.16 +BUILD_DEPENDS="ncurses"
    4.17 +
    4.18 +# Rules to configure and make the package.
    4.19 +compile_rules()
    4.20 +{
    4.21 +	echo '#define LEVELS_PATH     "/usr/share/oldrunner"' >> cfg.h
    4.22 +	export LDFLAGS="$LDFLAGS -ltinfo"
    4.23 +	./configure &&
    4.24 +	make
    4.25 +}
    4.26 +
    4.27 +# Rules to gen a SliTaz package suitable for Tazpkg.
    4.28 +genpkg_rules()
    4.29 +{
    4.30 +	mkdir -p $fs/usr/share $fs/usr/bin $install/usr/man
    4.31 +	cp -a $src/levels $fs/usr/share/oldrunner
    4.32 +	cp $src/$PACKAGE-$VERSION $fs/usr/bin/$PACKAGE
    4.33 +	cp $src/oldrunner.6 $install/usr/man
    4.34 +}