From: notaz Date: Sun, 10 Nov 2013 00:46:42 +0000 (+0200) Subject: first compiling version X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60f7539b5bd64b7bbcd43ef0de297a705e1c1633;p=ia32rtools.git first compiling version --- 60f7539b5bd64b7bbcd43ef0de297a705e1c1633 diff --git a/runimp.sh b/runimp.sh new file mode 100755 index 0000000..25086c7 --- /dev/null +++ b/runimp.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +grep 'extrn ' StarCraft.asm | awk '{print $2}' | awk -F: '{print $1}' > implist + +echo -n "" > tramp.s + +cat implist | while read i; do + rm -f tmpsym + case $i in + __imp_*) + si=`echo $i | cut -c 7-` + ;; + *) + si=$i + ;; + esac + + grep "\<_$si\>" /usr/i586-mingw32msvc/lib/lib* | awk '{print $3}' | \ + while read f; do + sym=`i586-mingw32msvc-nm $f | grep "\<_$si\>" | grep ' T ' | awk '{print $3}'` + if test -n "$sym"; then + echo $sym > tmpsym + break + fi + done + sym=`cat tmpsym` + if test -z "$sym"; then + echo "no file/sym for $i, lf $f" + exit 1 + fi + + echo ".globl $i" >> tramp.s + echo "$i:" >> tramp.s + echo " jmp $sym" >> tramp.s + echo >> tramp.s +done diff --git a/runsed.sh b/runsed.sh new file mode 100755 index 0000000..c2821ba --- /dev/null +++ b/runsed.sh @@ -0,0 +1,21 @@ +#!/bin/sh -x + +# sed -i -e '/.model flat/i\ +# \t\t.xmm\r' StarCraft.asm + +usyms="copy_start ___from_strstr_to_strchr unknown_libname_36 unknown_libname_41 unknown_libname_58" + +f=/tmp/sedcmd_ +echo -n "sed -i -e '/.model flat/i\\\t\t.xmm\r' -e '" > $f +for sym in $usyms; do + echo -n "s/^\<$sym\>:\([^:]\)/$sym::\1/g;" >> $f +done + +echo "\ +s/^\(loc[r_].*[0-9A-F]:\)[^:]\(.*\;\)/\1:\t\2/g;\ +s/dd[[:blank:]]rva/dd/;\ +s/\\t\[esp+4+var_4\]/fldcw\tword ptr \[esp\]/;\ +s/\> $f +. $f + diff --git a/uni.inc b/uni.inc new file mode 100644 index 0000000..e69de29