# HG changeset patch # User Pascal Bellard # Date 1560358555 -7200 # Node ID 861efbf7a5de06c35b1493f625621817e1d88e9a # Parent 982e49d39cc7e1e13e264d3947d1ce10d053eab7 Add npush & oldrunner diff -r 982e49d39cc7 -r 861efbf7a5de linld/stuff/src/ISO9660.CPP --- a/linld/stuff/src/ISO9660.CPP Wed Jun 12 17:42:20 2019 +0100 +++ b/linld/stuff/src/ISO9660.CPP Wed Jun 12 18:55:55 2019 +0200 @@ -77,7 +77,7 @@ endname = p + len; } p += len; - } while (x->buffer + x->curpos + size - p > 2); + } while (x->buffer + x->curpos + size - 2 > p); if (endname) *endname = 0; else diff -r 982e49d39cc7 -r 861efbf7a5de linld/stuff/src/pipehole.awk --- a/linld/stuff/src/pipehole.awk Wed Jun 12 17:42:20 2019 +0100 +++ b/linld/stuff/src/pipehole.awk Wed Jun 12 18:55:55 2019 +0200 @@ -1,16 +1,51 @@ -BEGIN { hold=0 } +BEGIN { hold=0; is386=0; isload=0; wascall=0 } function isnum(n) { return match(n,/^[0-9+-]/) } { sub(/segment word public/,"segment byte public") if (/^@.*:$/ || / endp$/) afterjmp=0 + if (/dword ptr/) is386=1 + if (/heap_top = _rm_buf/) isload=1 + if (isload) { # LOAD.LST + if (/mov al,byte ptr/ && is386) { + print " movzx eax,byte ptr [si]" + next + } + if (/ax,word ptr/) next + if (/^ call/) isload=0 + } + if (/const char \*n = name, \*i = x->filename;/) isiso=1 + if (isiso) { # ISO9660.LST + if ((/mov word ptr \[bp-6\],ax/ ) || + (/mov ax,word ptr \[bp-2\]/) || + (/bx,word ptr \[bp-6\]/) || (/ax,dx/)) next + if (/dx,/) sub(/dx/,"ax") + if ((/sub ax,word ptr \[bp-2\]/) || + (/\[di\+12\]/) || (/ax,si/)) sub(/ax/,"bx") + if (/add word ptr \[bp-6\],ax/) $0=" add bx,word ptr [di+12]" + if (/@strcmp\$qpxzct1/) isiso=0 + } + if (wascall) { + if (rcall != "") { + if (/,ax$/) print " mov " rcall ",ax" + else print " xchg ax," rcall + wascall=0 + } + else if (/^ mov .i,ax$/) { + split($2,y,",") + rcall=y[1] + next + } + else wascall=0 + } + if (/^ call /) { wascall=1; rcall="" } if (hold == 0) { s=$0 if (/^ mov .[ix],bx$/ || /^ mov .[ix],.i$/) { r=$2; kept=0 hold=1; split($2,regs,","); next } - if (/^ inc e?.[ix]/ || /^ dec e?.[ix]/) { + if (/^ inc e?.[ixhl]/ || /^ dec e?.[ixhl]/) { hold=2; r=$2; next } if (/^ mov [abcds][ix],/ && ! /,.s/) { @@ -64,7 +99,10 @@ for (i = 0; i < kept; i++) print line[i]; kept=0 } else if (hold == 2) { - hold=0; split($2,args,","); print s + split($0,args,",") + if (/^ mov / && r == args[2]) { print s; s=$0; next } + split($2,args,",") + hold=0; print s if ($1 == "or" && r == args[1] && r == args[2]) next # don't clear C ... } else if (hold == 3) { diff -r 982e49d39cc7 -r 861efbf7a5de npush/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/npush/receipt Wed Jun 12 18:55:55 2019 +0200 @@ -0,0 +1,29 @@ +# SliTaz package receipt. + +PACKAGE="npush" +VERSION="0.7" +CATEGORY="games" +SHORT_DESC="http://npush.sourceforge.net/" +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="GPL2" +TARBALL="$PACKAGE-$VERSION.tgz" +WEB_SITE="http://zsync.moria.org.uk/" +WGET_URL="$SF_MIRROR/$PACKAGE/$VERSION/$TARBALL" + +BUILD_DEPENDS="ncurses" + +# Rules to configure and make the package. +compile_rules() +{ + sed -i 's|"levels|"/usr/share/npush|' npush.cpp + sed -i 's|-lncurses|& -ltinfo|' Makefile + make +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/bin $fs/usr/share + cp -a $src/levels $fs/usr/share/npush + cp $src/npush $fs/usr/bin +} diff -r 982e49d39cc7 -r 861efbf7a5de oldrunner/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oldrunner/receipt Wed Jun 12 18:55:55 2019 +0200 @@ -0,0 +1,31 @@ +# SliTaz package receipt. + +PACKAGE="oldrunner" +VERSION="20120131" +CATEGORY="games" +SHORT_DESC="a text-based remake of Broderbund's Loderunner" +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="BSD" +TARBALL="$PACKAGE-$VERSION.tar.gz" +WEB_SITE="http://culot.org/public/Code/oldrunner.html" +WGET_URL="http://freebsd.sin.openmirrors.asia/pub/FreeBSD/ports/local-distfiles/culot/$TARBALL" + +BUILD_DEPENDS="ncurses" + +# Rules to configure and make the package. +compile_rules() +{ + echo '#define LEVELS_PATH "/usr/share/oldrunner"' >> cfg.h + export LDFLAGS="$LDFLAGS -ltinfo" + ./configure && + make +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/share $fs/usr/bin $install/usr/man + cp -a $src/levels $fs/usr/share/oldrunner + cp $src/$PACKAGE-$VERSION $fs/usr/bin/$PACKAGE + cp $src/oldrunner.6 $install/usr/man +}