diff --git a/sys/msdos/exceptn.S.patch b/sys/msdos/exceptn.S.patch new file mode 100644 index 000000000..3092e604a --- /dev/null +++ b/sys/msdos/exceptn.S.patch @@ -0,0 +1,20 @@ +source https://www.vogons.org/viewtopic.php?f=61&t=71459 +--- orig/src/libc/go32/exceptn.S 2002-12-21 21:08:39.000000000 -0800 ++++ ./src/libc/go32/exceptn.S 2020-01-18 18:37:27.397176800 -0800 +@@ -337,6 +337,15 @@ + je 6f + orb $2,%ah /* If RShift is set, set LShift as well */ + 6: ++ movb %ah,%al ++ andb %cs:___djgpp_sigint_mask, %ah /* Mask off irrelevant bits */ ++ cmpb %cs:___djgpp_sigint_key+1, %ah /* Test for SIGINT */ ++ je 60f ++ movb %al,%ah ++ andb %cs:___djgpp_sigquit_mask, %ah /* Mask off irrelevant bits */ ++ cmpb %cs:___djgpp_sigquit_key+1, %ah /* Test for SIGQUIT*/ ++ jne Lkbd_chain ++60: + inb $0x60,%al /* Read the scan code */ + 99: + movb %ah,%bh /* Save KB status */ + diff --git a/sys/msdos/fetch-cross-compiler.sh b/sys/msdos/fetch-cross-compiler.sh index 5b5d44e70..9970f76f0 100644 --- a/sys/msdos/fetch-cross-compiler.sh +++ b/sys/msdos/fetch-cross-compiler.sh @@ -8,7 +8,7 @@ else fi if [ -z "$GCCVER" ]; then - export GCCVER=gcc1020 + export GCCVER=gcc1210 fi if [ -z "$LUA_VERSION" ]; then @@ -22,7 +22,10 @@ fi #DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v2.9/" #DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v3.0/" -DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v3.1/" +#DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v3.1/" +#DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v3.1/" +DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v3.3/" + if [ "$(uname)" = "Darwin" ]; then #Mac DJGPP_FILE="djgpp-osx-$GCCVER.tar.bz2" @@ -88,6 +91,24 @@ if [ ! -d "pdcurses" ]; then git clone --depth 1 https://github.com/wmcbrine/PDCurses.git pdcurses fi +if [ ! -d djgpp/djgpp-patch ]; then + echo "Getting djlsr205.zip" ; + cd djgpp + mkdir -p djgpp-patch + cd djgpp-patch + if [ "$(uname)" = "Darwin" ]; then + #Mac + curl http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2/djlsr205.zip + else + wget --quiet --no-hsts http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2/djlsr205.zip + fi + ls -l + mkdir -p src/libc/go32 + unzip -p djlsr205.zip src/libc/go32/exceptn.S >src/libc/go32/exceptn.S + patch -p0 -l -i ../../../sys/msdos/exceptn.S.patch + cd ../../ +fi + cd ../ # Don't fail the build if lua fetch failed because we cannot do anything about it diff --git a/sys/unix/hints/include/cross-post.370 b/sys/unix/hints/include/cross-post.370 index a27965ddd..2364a4109 100644 --- a/sys/unix/hints/include/cross-post.370 +++ b/sys/unix/hints/include/cross-post.370 @@ -18,6 +18,9 @@ $(TARGETPFX)vidvesa.o : ../sys/msdos/vidvesa.c ../sys/msdos/portio.h \ $(TARGETPFX)vidstub.o : ../sys/msdos/vidvesa.c ../sys/msdos/portio.h \ $(HACK_H) $(TARGETPFX)tile.o : tile.c +$(TARGETPFX)exceptn.o : ../lib/djgpp/djgpp-patch/src/libc/go32/exceptn.S + $(TARGET_CC) -c -o $@ ../lib/djgpp/djgpp-patch/src/libc/go32/exceptn.S + $(TARGET_AR) ru ../lib/djgpp/i586-pc-msdosdjgpp/lib/libc.a $(TARGETPFX)exceptn.o $(GAMEBIN) : $(HOBJ) $(LUACROSSLIB) $(TARGET_LINK) $(TARGET_LFLAGS) -o $(GAMEBIN) \ $(HOBJ) $(WINLIB) $(TARGET_LIBS) diff --git a/sys/unix/hints/include/cross-pre.370 b/sys/unix/hints/include/cross-pre.370 index 2857c7a37..ed0c5734c 100644 --- a/sys/unix/hints/include/cross-pre.370 +++ b/sys/unix/hints/include/cross-pre.370 @@ -183,7 +183,7 @@ override LUALIBS= override TOPLUALIB= override GAMEBIN = $(TARGETPFX)nethack.exe override PACKAGE = dospkg -override PREGAME += mkdir -p $(TARGETDIR) ; +override PREGAME += mkdir -p $(TARGETDIR) ; make $(TARGETPFX)exceptn.o ; override CLEANMORE += rm -f -r $(TARGETDIR) ; VARDATND += nhtiles.bmp #